Dynamic fee hook on Base

Uniswap v4 Hook Contract 0xda61786fc782e12416d314b83681f536683e29cc 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

An upgradeable, owner-controlled dynamic-fee hook that charges all traders an owner-set swap fee with no visible cap, may limit swaps per pool, and could be upgraded to block LP withdrawals.

How it works step by step

  • Sets and applies a swap fee per pool, with an owner-adjustable global dynamic fee and per-pool fee overrides.
  • Tracks a swap count per pool, with a MAX_SWAPS constant that may limit swaps, and a gas limit setting checked during swaps.
  • Runs checks when LPs add liquidity and after they remove liquidity; add-liquidity appears to read the owner address, suggesting possible gating.
  • Is an upgradeable proxy whose owner can replace the logic, while staying within the hook address's fixed permissions.
Swap behaviour
Before and after each swap the hook reads the dynamic fee, the gas limit and the pool's swap count, and it can change swap amounts through enabled return deltas. The exact fee size, swap cap and any restrictions cannot be confirmed from bytecode.
Liquidity behaviour
The hook runs before liquidity is added, possibly with an owner-related check, and after liquidity is removed. Because the after-remove callback is enabled on an upgradeable proxy, a future implementation could make withdrawals revert.
Fee behaviour
Uses a default swap fee, an owner-settable dynamic fee and per-pool fees set at pool creation or later by the owner. No maximum fee cap could be verified from bytecode, and fees may be taken from swap amounts via return deltas.
Owner & admin controls
The owner can set the dynamic fee, per-pool swap fees, the gas limit, a 'mid' address, and per-address values, and can also reset swap counts. The owner can upgrade the implementation, and no fee caps are visible.

Enabled Uniswap v4 callbacks

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

beforeInitialize: records the pool's starting swap fee; beforeAddLiquidity: checks new liquidity, possibly gated; afterRemoveLiquidity: runs after withdrawals; beforeSwap: applies fee, gas limit and swap-count logic; afterSwap: post-swap accounting; beforeSwapReturnDelta/afterSwapReturnDelta: can adjust swap input or output amounts.

Security & trust assessment

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

Who controls it: A single owner controls fees, the gas limit and other settings, and can upgrade the logic. At worst they could set very high fees, block swaps, or make withdrawals revert through an upgrade.

Risk to user funds: Swap amounts can be adjusted via return deltas, with an unverified fee range. LP principal stays in the PoolManager, but withdrawals could be blocked by an upgraded implementation.

Security findings

  • [high] Upgradeable proxy with swap deltas and withdrawal hook: The implementation can be swapped by the owner, and the address has swap return deltas and afterRemoveLiquidity enabled. A new implementation could therefore take swap tokens or make LP withdrawals revert.
  • [medium] Uncapped owner-set fees: setDynamicFee and setSwapFee are owner-controlled, and no maximum bound is visible in the bytecode.
  • [low] Swap count and gas limit controls: A MAX_SWAPS constant and an owner-set gas limit are read during swaps and may restrict trading.

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