Likely dynamic fee hook on Ethereum

Uniswap v4 Hook Contract 0x5218fe316144a3bd0c0ee0ddf7badac04d120ac0 on Ethereum · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$0.04
All-time volume
$0.46
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
15

What it does

A Uniswap v4 hook that sets swap fees from three stored fee tiers, so trader cost depends on the tier configured for the pool.

How it works step by step

  • Stores three fee tiers (tier1, tier2, tier3) packed into one storage slot
  • Exposes getFee and per-tier getters for off-chain reads
  • Returns a dynamic fee from beforeSwap based on the stored tier
  • Enables liquidity add and remove callbacks
  • Enables afterSwap callback for post-swap logic
  • Calls balanceOf and isEthgasSlot on external contracts
Swap behaviour
beforeSwap reads the stored fee tiers and returns a dynamic fee for each swap; afterSwap is also enabled.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present, but their bodies are not detailed by the decoded data, so any liquidity restriction or accounting cannot be confirmed.
Fee behaviour
Fees are read from storage (tier1Fee, tier2Fee, tier3Fee, getFee) and packed into slot 3 as three uint24 values; the hook appears to return a fee tier per swap via beforeSwap, with the tier selected by the function reading the stored values. Exact selection logic is not determinable from decoded bytecode alone.
Owner & admin controls
Owner-style admin is suggested by the admin() and tier-fee setter selectors (0x34a584d2, 0x691ae9ce, 0x82a87b71 each take a uint24 and write to storage slot 3); these setters are not verified, so the caller restriction cannot be confirmed from bytecode. Pool fee tiers are stored in slot 3 and can be changed through these setters.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap

beforeSwap is used to read the fee tier and return a dynamic fee; afterSwap is enabled and likely inspects the swap result; beforeAddLiquidity and beforeRemoveLiquidity gate liquidity changes; afterAddLiquidity and afterRemoveLiquidity are present in the dispatcher and may emit events or track state.

Security & trust assessment

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

Who controls it: If the setter functions are owner-restricted, a single privileged key can set any of the three fee tiers to a high value (up to the uint24 maximum), directly raising costs for every swapper in the pool.

Risk to user funds: The hook does not appear to hold pool tokens directly based on the decoded selectors (no return-delta or take functions are listed), but a high fee setting would reduce swap output for users. Liquidity callbacks could restrict deposits or withdrawals if they revert.

Security findings

  • [medium] Fee tiers writable by unverified setters: Three uint24 fee tiers are stored in a single storage slot and can be rewritten by nonpayable setter functions (0x34a584d2, 0x691ae9ce, 0x82a87b71); no access control was confirmed in the decoded bytecode.
  • [low] Liquidity hooks could block LP actions: Liquidity add and remove hooks are enabled; if they contain revert conditions, the hook could block liquidity provision or withdrawal.
  • [info] External calls to other contracts: The bytecode calls balanceOf(address) and isEthgasSlot(uint256), indicating external token and contract dependencies whose behaviour is outside this hook.

Contract details

Verified source
No
Bytecode size
7,307 bytes
Upgradeable proxy
No

Pools using Likely dynamic fee hook