GardenHook on Ethereum
Uniswap v4 Hook Contract 0x3d113f13fc2909ddc2e3748f3ac214d75f2820cc on Ethereum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 1
What it does
Every ETH/GARDEN trade pays a flat fee to the hook, 1% by default, charged on both buys and sells, so traders receive slightly less on sells and pay slightly more on buys while the collected ETH stays in the contract for the owner to release.
How it works step by step
- Charges a fixed 1% fee (maxBps ceiling, owner-adjustable only downward) on ETH flowing through the ETH/GARDEN pool, taken on both buys and sells
- Takes the fee into the hook contract via poolManager.take and holds it as native ETH balance
- Restricts pool initialization to one pool whose currency0 is native ETH and currency1 is the GARDEN token, opened only by the designated Launch address
- Lets the owner release collected ETH to any address via release(to, amount)
- Enforces a one-way fee ratchet: setFees can only lower buyBps and sellBps
- Swap behaviour
- Buys (ETH to GARDEN, zeroForOne) with exact-ETH input have buyBps of the ETH input taken in beforeSwap via a return delta; exact-token buys have buyBps of the ETH cost taken in afterSwap; sells (GARDEN to ETH) have sellBps of the ETH output taken in afterSwap. Trades on the pool therefore pay the hook fee on top of the pool fee, with buys and sells both charged at the current rates.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Fees are set by buyBps and sellBps (both initially set in the constructor, bounded by maxBps which is capped at 1000 bps / 10%), and are charged as a hook-taken portion of swap amounts. Fees can only decrease via setFees. Collected ETH accumulates in the hook balance and is withdrawn only by the owner via release.
- Owner & admin controls
- Owner (non-transferred by default, transferable and renounceable) can lower buyBps and sellBps, release collected ETH to any address, and transfer or renounce ownership. Fees cannot be raised, there is no pause, no upgrade mechanism, and no token or liquidity control.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize validates the pool and launch sender; beforeSwap takes the buy fee on exact-input ETH buys and returns it as a delta; afterSwap takes buy or sell fees from the resulting balance delta and returns them as a delta; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts.
Security & trust assessment
Risk level: low (verified source, high confidence).
Who controls it: The owner key can drain all collected ETH to any address and can lower fees to zero; it cannot raise fees, pause swaps, or touch pool liquidity or token balances.
Risk to user funds: The hook holds only the ETH it collected from swap fees (via poolManager.take); it holds no token and no liquidity, and cannot block swaps. User swap funds otherwise pass through the pool manager, and the hook's fee deltas reduce the amounts traders receive or pay by the configured fee percentage.
Security findings
- [info] Hook takes a fee via return deltas: beforeSwap and afterSwap return positive deltas equal to the fee, so the hook takes up to 10% (hard ceiling) of swap ETH; the current rate is 1% per the header but buyBps and sellBps are set at deployment.
- [medium] Owner can release all collected ETH: release(to, 0) sends the entire hook ETH balance to an arbitrary address; collected fees are fully controlled by the owner key.
- [info] Owner can lower fees to zero: setFees can reduce buyBps and sellBps to 0 at any time, disabling the fee; this is one-way and cannot raise fees back.
- [info] Single-pool restriction: beforeInitialize refuses any pool that is not native ETH against TOKEN, initiated by LAUNCH, and can only happen once via openedAt.
Contract details
- Verified source
- Yes (GardenHook)
- Compiler
- solc 0.8.28+commit.7893614a
- Bytecode size
- 4,233 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, launchpad, moves-currency, ownable, return-delta