Dynamic fee hook on Base
Uniswap v4 Hook Contract 0x061023911da6feb0e829f7c7a13f288a7173a5c7 on Base · Dynamic fee
- Volume (24h)
- $0.69
- Value locked (TVL)
- $3.68
- All-time volume
- $5.15M
- Pools using this hook
- 1
- Swaps (24h)
- 1 (1 traders)
- Total swaps
- 10,175
What it does
A Uniswap v4 hook that applies configurable swap-time fees or taxes and performs accounting on liquidity changes, with an admin-managed fee collector and LP whitelist, behind an upgradeable proxy.
How it works step by step
- Enables beforeSwap and afterSwap hooks that read packed uint16 fee and tax parameters from storage.
- Uses afterSwapReturnDelta to take a share of swap output or input for a fee collector.
- Runs afterAddLiquidity and afterRemoveLiquidity hooks with return-delta accounting.
- Maintains an admin-managed LP whitelist mapping gating certain liquidity actions.
- Sits behind a proxy that delegates all calls to a separate implementation contract.
- Swap behaviour
- beforeSwap and afterSwap run on each swap, reading packed fee and tax parameters and using return deltas to take a portion of the swap flow for the fee collector.
- Liquidity behaviour
- afterAddLiquidity and afterRemoveLiquidity callbacks are enabled with return-delta permissions, so the hook can adjust balances on liquidity changes. beforeAddLiquidity and beforeRemoveLiquidity exist as view functions in the dispatch table but are not enabled in the permission flags, so they are likely not invoked by the pool manager.
- Fee behaviour
- Fees appear to be configured via packed uint16 values in storage slots 3 and 4 (feeConfig and tax parameters with MAX_TAX_BPS and GAS_BUFFER_BPS constants), read in beforeSwap and possibly applied as dynamic or taxed fees. Exact fee formula could not be confirmed from bytecode alone.
- Owner & admin controls
- Owner-like admin role (slot 1) can transfer admin via transferAdmin(address), set the fee collector via setCollector(address) (slot 2), and manage an LP whitelist via setLpWhitelist(address,bool) and batch setLpWhitelist-style functions (mapping in slot 5). Fee and tax parameters are stored in slots 3 and 4 and appear writable through the 0x9fba224c and 0xb1411076 setters (uint16/uint32 config values). Upgradeability is indicated by the proxy with an implementation pointer, so the implementation can potentially be replaced by whoever controls the proxy admin.
Enabled Uniswap v4 callbacks
beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta
beforeInitialize: pool setup checks or config snapshot. afterAddLiquidity and afterRemoveLiquidity: post-liquidity bookkeeping with return deltas. beforeSwap and afterSwap: swap-time fee or tax logic and accounting. afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta: allow the hook to take or give back token amounts from the pool flow.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, low confidence).
Who controls it: The admin can transfer the admin role, redirect the fee collector to an arbitrary address, whitelist or de-whitelist LPs, and potentially change fee and tax parameters. Combined with the upgradeable proxy, the admin could replace the logic entirely and divert hook-taken tokens or change swap outcomes.
Risk to user funds: The hook can take and redirect swap and liquidity amounts through return deltas to a collector address, and an upgradeable proxy lets the admin change that behaviour at any time, so user and pool funds flowing through the hook are exposed to admin action.
Security findings
- [high] Upgradeable proxy: The hook is a 45-byte proxy delegating to implementation 0xbc3eebe7ab762b4e6fe6a6966e02bd3cb3c8932b, so the logic can be changed by whoever controls the proxy upgrade path.
- [medium] Hook takes tokens via return deltas: afterSwapReturnDelta and liquidity return-delta permissions let the hook take tokens from swaps and liquidity flows, sending them to the collector address.
- [medium] Admin can change fee and collector settings: The admin can change the fee collector and fee or tax parameters, which could redirect or inflate fees charged to traders and LPs.
- [low] Whitelist-gated liquidity: An LP whitelist mapping gates some liquidity actions; the admin controls membership, which may restrict who can provide liquidity.
- [info] Unverified source: No verified source is available, so function semantics and parameter effects are inferred from selectors and storage only.
Contract details
- Verified source
- No
- Bytecode size
- 45 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- access-control, return-delta, tax, upgradeable
Pools using Dynamic fee hook
- ETH / NVDAc (0.01% fee) — 24h volume $0.69, TVL $3.68, 1 swaps today