Dynamic fee hook on Base

Uniswap v4 Hook Contract 0xd837b8629be8907bc1b5733588badc858ed869cc 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 sets dynamic swap fees per pool under owner control, and the exact fee level and which trades pay more could not be determined from the unverified bytecode.

How it works step by step

  • Hook is a proxy; all calls run the implementation 0x8b1121d41e03f35565a7d226eabaa1720c180f45, which is unverified.
  • Sets pool fees dynamically through a dynamicFee setter (setDynamicFee) and a per-pool swapFee mapping (setSwapFee, swapFee).
  • beforeSwap reads the stored dynamic fee and a gas limit, and tracks a per-pool swapCount with a MAX_SWAPS cap.
  • Enables beforeSwapReturnDelta and afterSwapReturnDelta, so the hook can take or give currency deltas on swaps.
  • Hooks liquidity add and remove (beforeAddLiquidity, afterRemoveLiquidity) and pool initialisation (beforeInitialize), but the bytecode does not reveal what these do beyond the selectors.
Swap behaviour
beforeSwap and afterSwap run on every swap; beforeSwap reads the dynamic fee and gas limit and enforces a swap count limit, and afterSwap can adjust deltas. Exact fee amounts and which trade directions pay more cannot be determined from the decoded bytecode.
Liquidity behaviour
beforeAddLiquidity and afterRemoveLiquidity are enabled; the bytecode does not reveal their effects beyond the selectors.
Fee behaviour
Fee is set dynamically via setDynamicFee and per-pool setSwapFee, with a DEFAULT_SWAP_FEE constant as fallback; the exact fee formula is not determinable from the bytecode.
Owner & admin controls
An owner (owner() view) can call setDynamicFee, setSwapFee, setMid, setGasLimit, initialize and a further privileged setter; the hook is upgradeable via a proxy, so the implementation can be changed.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize sets up pool state, beforeAddLiquidity and afterRemoveLiquidity hook liquidity changes, beforeSwap applies the fee and swap limits, afterSwap runs post-swap logic, and the two return-delta flags allow the hook to adjust amounts settled with the pool manager.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, low confidence).

Who controls it: A single owner key can change fees, the gas limit, the mid parameter and the implementation, and so could alter or block trades for users.

Risk to user funds: Return-delta permissions let the hook move currency on swaps, and the upgradeable proxy could change how it does so; user funds in affected pools are therefore exposed to the owner.

Security findings

  • [high] Owner-set dynamic fee: setDynamicFee and setSwapFee let the owner set fees on pools, and the bytecode does not show an upper bound, so the owner could raise fees sharply on users.
  • [high] Return-delta permissions: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, letting the hook adjust swap amounts and take value from user swaps.
  • [high] Upgradeable proxy: The hook delegates to an implementation that can be swapped, so the logic could change after deployment without users' consent.
  • [medium] Swap count limit: A MAX_SWAPS cap tracked per pool via swapCount could block swaps once reached, halting trading in that pool.
  • [medium] Unverified implementation: No verified source is available, so behaviour is inferred from selectors and storage only.

Contract details

Verified source
No
Bytecode size
2,345 bytes
Upgradeable proxy
Yes
Detected patterns
dynamic-fee, ownable, return-delta, upgradeable

Pools using Dynamic fee hook