Dynamic fee hook on Base
Uniswap v4 Hook Contract 0xc90eddf51569270e06270ea98f7efff828dde0cc on Base · Dynamic fee
- Volume (24h)
- $18.00K
- Value locked (TVL)
- $113.04K
- All-time volume
- $7.86M
- Pools using this hook
- 4
- Swaps (24h)
- 480 (45 traders)
- Total swaps
- 47,368
What it does
A Uniswap v4 hook that applies an owner-configured swap fee to allowed pools and routes collected fees to a treasury.
How it works step by step
- Validates pool initialization against token and pair allowlists in beforeInitialize.
- Applies an owner-set fee in basis points on swaps via beforeSwap.
- Takes fee deltas from swaps using beforeSwapReturnDelta and afterSwapReturnDelta.
- Tracks total fees collected per pair and token in storage.
- Sends collected fees to an owner-set treasury address.
- Supports fee exemptions for specific addresses and a bounded fee range.
- Swap behaviour
- beforeSwap applies the configured fee and afterSwap records accounting; both can return deltas so the hook takes a fee from each swap on allowed pairs.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are dispatched in the ABI, but the hook permission flags do not enable them, so the pool manager will not call them. Liquidity is not intercepted.
- Fee behaviour
- Owner-set fee in basis points (feeBps, slot 8 packed with a uint24 fee) bounded by a configurable fee range and MAX_FEE; the hook collects fees via beforeSwap/afterSwap return deltas and tracks totals per pair and token in mapping storage, with the treasury as recipient. Per-address fee exemptions exist.
- Owner & admin controls
- Owner (Ownable2Step: transferOwnership then acceptOwnership) can call setFee, setFeeRange, setTreasury, setFeeExempt, setTokenAllowed, setPairAllowed, lockLists and the other owner-gated setters at selectors 0x83f49d8c, 0xa5a0d4c8, 0xdc98354e, 0x1e1b9d8e, 0xb9f5adee and 0x408af472. renounceOwnership is present but reverts with RenounceDisabled. Owner can change the fee within a range capped by MAX_FEE and redirect fee destination via treasury. lockLists sets a flag that freezes list changes.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: validates and registers pool initialization against token and pair allowlists. beforeSwap: applies the fee and may take a delta from the swap via beforeSwapReturnDelta. afterSwap: records swap accounting and may take a delta via afterSwapReturnDelta.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: A single owner key controls the fee, fee range, treasury address and token/pair/fee-exempt allowlists. A malicious or compromised owner could raise fees up to MAX_FEE on allowed pairs, redirect collected fees to a new treasury, or block pool initialization by disallowing tokens. Ownership transfer is two-step, which reduces accidental transfer risk.
Risk to user funds: The hook can take a fee delta from swaps and hold ERC6909 claim balances for collected fees. It can block swaps on pairs not on the allowlist. It does not appear to intercept liquidity operations.
Security findings
- [medium] Owner-adjustable swap fee: Fee is changed by the owner and applied to swaps via return deltas, so the owner can extract value from swappers up to the configured maximum.
- [medium] Return-delta fee capture: Hook takes tokens through beforeSwapReturnDelta and afterSwapReturnDelta, so it can take a portion of every swap's input or output.
- [low] Allowlist gating of pools: Pool initialization is gated by token and pair allowlists controlled by the owner, so pools may be blocked or only specific pairs may trade.
- [low] Treasury redirection: Owner can pass Ownable ownership transfer and the treasury address can be changed, so collected fees follow owner decisions.
- [info] ERC6909 claim balances: Bytecode references ERC6909 claims, so the hook may hold custody of claim tokens representing fees taken from the pool.
Contract details
- Verified source
- No
- Bytecode size
- 10,154 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc6909-claims, ownable, return-delta
Pools using Dynamic fee hook
- ETH / vAPI (0.00% fee) — 24h volume $18.00K, TVL $113.01K, 480 swaps today
- ETH / TEST (0.00% fee) — 24h volume $0, TVL $1.38, 0 swaps today
- ETH / TEST (0.30% fee) — 24h volume $0, TVL $1.35, 0 swaps today
- ETH / TEST (0.00% fee) — 24h volume $0, TVL $30, 0 swaps today