Dynamic fee hook on Base
Uniswap v4 Hook Contract 0xb0086555f0c17bb5679d2804307ede4631e54088 on Base · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook charges an owner-set fee on swaps in each pool, capped by a fixed maximum, and it can adjust swap settlement, so swappers pay the configured fee and the owner controls how high it goes.
How it works step by step
- Implements beforeSwap with a return delta, so the hook can alter the amount a swap settles against the pool
- Stores an owner-set fee per pool in a mapping keyed by pool configuration, and applies it when computing swaps
- Routes swaps through external pool sources via pancakeV3SwapCallback and uniswapV3SwapCallback handlers, indicating it can execute trades against other liquidity venues
- Holds an owner address that can set fees (setFee), register pool configurations, and withdraw tokens
- Caps configurable fees with a MAX_FEE_BPS constant and limits source count with MAX_SOURCES
- Swap behaviour
- Swaps pass through beforeSwap, which can return a delta that changes the amounts settled with the pool; the exact pricing against external sources cannot be fully confirmed without source, so trades routed through the hook may pay the configured fee on top of the underlying price.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Fee is set per pool by the owner through setFee and is bounded by MAX_FEE_BPS; the hook applies it during beforeSwap.
- Owner & admin controls
- Owner can set per-pool fees, register or update pool configurations, transfer ownership, and withdraw tokens held by the contract.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap is used to compute a fee and possibly return a delta that adjusts the swap amounts; beforeSwapReturnDelta allows that delta to change settlement.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: A single owner key can set fees up to the cap, redirect pool configuration, and withdraw tokens the contract holds, so the owner can extract value or disadvantage traders.
Risk to user funds: The hook can hold tokens and, through return deltas and external routing, influence amounts settled for swappers; the owner can withdraw any tokens the contract holds.
Security findings
- [medium] Return delta can alter settlement: beforeSwapReturnDelta lets the hook change swap amounts, so incorrect logic could shift value between traders and the pool.
- [medium] Owner-controlled fee: setFee lets the owner change the fee for a pool up to MAX_FEE_BPS, which can be raised to the cap at any time, affecting every swap on that pool.
- [high] Owner withdrawal of tokens: withdraw(address,address) lets the owner move tokens held by the contract, so any balances parked in the hook can be removed by the owner key.
- [medium] Single owner key with transferable ownership: ownership is stored in slot 0 and can be transferred via transferOwnership, so compromise of one key grants full control over fees and withdrawals.
- [info] External source routing: Callback selectors indicate swaps may be routed to external pools, adding counterparty and price-manipulation exposure outside the hook itself.
Contract details
- Verified source
- No
- Bytecode size
- 8,549 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, ownable, return-delta
Pools using Dynamic fee hook
- WETH / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today