Dynamic fee hook on BNB Chain

Uniswap v4 Hook Contract 0x15544eba1a7c7054a4bedceb876a7bf1a6ac258b on BNB Chain · 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 sets a dynamic fee on swaps and can take or credit currency through return deltas during swaps and liquidity changes, with an owner who controls the fee receiver and key parameters, though the exact fee amounts and which trades pay more or less cannot be determined from the decoded bytecode.

How it works step by step

  • Hook initializes per-pool state in beforeInitialize, storing a uint16 configuration value and an address in packed slot 0 and an owner-like address in slot 2.
  • beforeSwap is called on every swap and can return a delta, so the hook can take or give currency during a swap.
  • afterAddLiquidity and afterRemoveLiquidity are called after liquidity changes and can return deltas, which lets the hook settle or take currency on liquidity events.
  • Accounting is tracked in a nested mapping keyed by uint256 and address (slot 1), with debtOf reading it, suggesting the hook records credits or debts owed per position or user.
  • Calls the pool manager's take function (selector 0x0b0d9c09) to withdraw currency to a receiver, and a feeReceiver address is stored and can be updated.
  • Ownable: owner can transfer or renounce ownership and set the fee receiver.
Swap behaviour
beforeSwap is invoked on every swap and can return a before-swap delta and fee override; the exact fee and direction logic cannot be fully determined without source, but the presence of dynamic-fee and return-delta tags indicates swaps may pay a variable fee or have currency taken by the hook.
Liquidity behaviour
afterAddLiquidity and afterRemoveLiquidity run after liquidity changes and can return deltas that take or credit currency; debt/credit state is updated in the nested mapping on these events.
Fee behaviour
Dynamic fee set through the hook's beforeSwap path; fee amounts and any portion sent to feeReceiver cannot be precisely determined from decoded bytecode.
Owner & admin controls
Owner can transfer ownership, renounce ownership, and set the fee receiver address; the uint16 setters (selectors 0x534eb4cf and 0xcb9442e2) change stored parameters; no pause or upgrade mechanism identified.

Enabled Uniswap v4 callbacks

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

beforeInitialize sets up per-pool state; beforeSwap computes swap-time logic and returns a delta; beforeSwapReturnDelta lets the hook take or give currency during swaps; afterAddLiquidity and afterRemoveLiquidity run post-liquidity logic; afterAddLiquidityReturnDelta and afterRemoveLiquidityReturnDelta let those hooks move currency on liquidity events.

Security & trust assessment

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

Who controls it: A single owner key can set the fee receiver, change stored uint16 parameters, and transfer or renounce ownership, which can redirect fee revenue or alter swap and liquidity economics.

Risk to user funds: The hook can take or credit currency during swaps and liquidity events via return deltas and take calls, so it can hold or move pool and user funds according to its internal accounting.

Security findings

  • [high] Return deltas let the hook move currency: beforeSwapReturnDelta and the liquidity return-delta permissions allow the hook to take or credit tokens from swaps and liquidity operations, so user funds flowing through the pool are exposed to the hook's logic.
  • [medium] Owner can change fee-related parameters: Owner-gated setters for uint16 parameters and the fee receiver can alter fees or redirect the fee share; without source the bounds on these values are unknown.
  • [medium] Currency withdrawal via take: The contract calls take on the pool manager, so the hook can withdraw pool currency to a chosen receiver under its own logic.
  • [low] Ownership is a single key: Ownable access control with transferOwnership and renounceOwnership means one privileged key controls hook configuration.

Contract details

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

Pools using Dynamic fee hook