Dynamic fee hook on Base

Uniswap v4 Hook Contract 0x76e1032910874446f4ba1bcb96d251dd1b5e658b on Base · Dynamic fee

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

What it does

This hook takes a dynamic fee and routes part of the value from swaps and liquidity changes to a fee receiver, though the exact fee amounts and which trade direction pays more cannot be determined from the decoded bytecode.

How it works step by step

  • Runs on beforeInitialize, beforeSwap, afterAddLiquidity and afterRemoveLiquidity callbacks of a Uniswap v4 pool
  • Has beforeSwapReturnDelta and afterAdd/RemoveLiquidityReturnDelta enabled, so it can take or credit tokens against the pool's deltas
  • Stores a fee-receiver address and a mapping keyed by pool id and address, suggesting per-pool, per-user accounting of owed amounts
  • Exposes a debtOf(uint256,address) view, indicating it tracks debt owed to users or the hook
  • Calls take(address,address,uint256) on the PoolManager to pull currency out of the pool
  • Uses a uint16 parameter setter (selector 0x534eb4cf and 0xcb9442e2) that writes to packed storage in slot 0 and slot 2
Swap behaviour
beforeSwap is handled and can return a fee override and a delta; exact trade pricing and which direction pays more cannot be determined from the decoded bytecode alone.
Liquidity behaviour
afterAddLiquidity and afterRemoveLiquidity are handled and can return deltas, so the hook may take a share of liquidity flows and record debt per pool and address.
Fee behaviour
Dynamic fee callback is indicated by the dynamic-fee tag and the beforeSwap handler; the fee-receiver address is stored and the hook appears to route part of the accrued amount to it. The exact fee formula is not determinable.
Owner & admin controls
Owner (ownable) can transfer or renounce ownership and set the fee receiver via setFeeReceiver. Fee-related uint16 setters exist but their gating cannot be confirmed without source.

Enabled Uniswap v4 callbacks

beforeInitialize, afterAddLiquidity, afterRemoveLiquidity, beforeSwap, beforeSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeInitialize sets up per-pool state; beforeSwap applies fee logic and can return a delta; beforeSwapReturnDelta lets it adjust swap deltas; afterAddLiquidity and afterRemoveLiquidity run accounting and can return deltas; afterAddLiquidityReturnDelta and afterRemoveLiquidityReturnDelta let these callbacks take or credit currency.

Security & trust assessment

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

Who controls it: The owner key can change the fee receiver and fee-related parameters and can transfer or renounce ownership, which directly affects fees collected from users' trades and liquidity actions.

Risk to user funds: The hook can take currency through return deltas and take() calls during swaps and liquidity changes, so user funds flowing through affected pools are exposed to the hook's fee and debt logic.

Security findings

  • [high] Return-delta hook moves currency: The hook enables beforeSwapReturnDelta and liquidity return deltas and calls take on the PoolManager, so it can extract tokens from swaps and liquidity operations.
  • [medium] Owner-controlled fee receiver and parameters: The owner can change the fee receiver and uint16 parameters, which could redirect fees or alter the fee rate for pools using the hook.
  • [medium] Unverified source: No verified source is available, so the exact fee formula, debt logic and access checks on setters cannot be confirmed from bytecode alone.
  • [info] Custom error for unauthorized access: An Unauthorized() error selector appears in the bytecode, indicating some functions are access-gated.

Contract details

Verified source
No
Bytecode size
13,513 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, ownable, return-delta

Pools using Dynamic fee hook