Dynamic fee hook on Base

Uniswap v4 Hook Contract 0x1d2722104ff9c66e50fc1409d39bfbf28d3b258b 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 appears to charge owner-configurable fees by taking currency through return deltas on swaps and liquidity changes and routing it to a fee receiver, but exact per-trade fee direction and amounts cannot be confirmed without verified source.

How it works step by step

  • Enables beforeSwap return-delta and add/remove liquidity return-delta permissions, so the hook can adjust balances and take currency during swaps and liquidity operations.
  • Stores per-pool uint16 fee-related parameters in slots 0 and 2, written in beforeInitialize and by owner-only setters (selectors 0x534eb4cf and 0xcb9442e2).
  • Tracks a mapping keyed by pool id and address in slot 1, updated in afterAddLiquidity and afterRemoveLiquidity, and read through debtOf(uint256,address).
  • Uses take(address,address,uint256) from the PoolManager to move currency out of the pool on beforeSwap and liquidity callbacks.
  • Stores a feeReceiver address that receives moved funds, settable by the owner via setFeeReceiver.
  • Implements Ownable (owner, transferOwnership, renounceOwnership) and an Unauthorized() error for gated calls.
Swap behaviour
beforeSwap is callable and can return a delta, so the hook can take or give currency on each swap; exact per-trade fee and direction effects cannot be fully determined from decoded bytecode.
Liquidity behaviour
afterAddLiquidity and afterRemoveLiquidity are callable and return deltas; they update a pool/address keyed accounting mapping (debt-like) and may take currency from the liquidity operation.
Fee behaviour
Likely sets a dynamic fee or fee share through uint16 parameters stored in slots 0 and 2 and routes collected amounts to feeReceiver; exact formulas are not recoverable without source.
Owner & admin controls
Owner can change feeReceiver (setFeeReceiver), set uint16 parameters (selectors 0x534eb4cf and 0xcb9442e2), and transfer or renounce ownership.

Enabled Uniswap v4 callbacks

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

beforeInitialize sets up pool parameters; beforeSwap can alter swap deltas to take fees; afterAddLiquidity and afterRemoveLiquidity can adjust liquidity deltas and record accounting; beforeSwapReturnDelta and the liquidity return-delta flags allow the hook to take currency from these flows.

Security & trust assessment

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

Who controls it: A single owner key can change fee parameters and the fee receiver and can transfer or renounce ownership, which could alter costs for all pools using this hook.

Risk to user funds: The hook can take currency through return deltas during swaps and liquidity changes and sends it to feeReceiver; it does not appear to hold custody beyond transient deltas, but it can extract value from user flows.

Security findings

  • [high] Owner-set parameters affect swap cost: Two owner-callable uint16 setters write to slots 0 and 2, which feed fee logic in beforeSwap; an owner could raise fees sharply on trades.
  • [medium] Return-delta currency movement: beforeSwapReturnDelta and liquidity return-delta permissions let the hook take currency via take(), so user funds can be diverted from swaps and liquidity operations.
  • [medium] Redirectable fee recipient: feeReceiver can be changed by the owner, so collected amounts can be redirected to any address.
  • [info] Single-owner control: Ownable pattern with transferOwnership and renounceOwnership means one key controls all admin functions.
  • [info] Unverified source: No verified source; behaviour inferred from decoded selectors and storage, so exact logic is uncertain.

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