Dynamic fee hook on BNB Chain

Uniswap v4 Hook Contract 0x21c2cb863f751914be525786fec908d602a500c0 on BNB Chain · Dynamic fee

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

What it does

A Uniswap v4 hook that sets a dynamic LP fee on swaps and can restrict swaps through a router whitelist and a circuit breaker, as far as the bytecode suggests.

How it works step by step

  • Computes a per-swap dynamic LP fee bounded by MAX_DYNAMIC_FEE and PENALTY_FEE
  • Calls updateDynamicLPFee on the pool manager to apply the fee
  • Checks whether the caller router is whitelisted before swap processing
  • Enforces an owner-toggled circuit breaker that can pause or penalize swaps
  • Tracks pool state and tick bounds (MIN_TICK, MAX_TICK) after each swap
Swap behaviour
beforeSwap checks router whitelist and circuit breaker state, computes a dynamic fee and applies it via the pool manager; afterSwap updates stored pool and tick state.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Hook exposes MAX_DYNAMIC_FEE, PENALTY_FEE, MAX_TICK and MIN_TICK getters and calls updateDynamicLPFee on the pool manager, indicating the hook sets a dynamic LP fee per swap; the exact fee formula cannot be determined from decoded bytecode alone.
Owner & admin controls
Owner (read via owner()) can set the whitelisted router list via setWhitelistedRouter, toggle the circuit breaker and its threshold via setCircuitBreaker, and set fee/tick parameters via functions that write slots 0, 3 and 7 (e.g. dc2e70b9 writes int24 tick bounds, bb2199eb writes a uint24/uint16 parameter set, 6b5bae80 writes a uint24 value). Ownership transfer and renouncing are possible through the owner-controlled selectors 8da5cb5b/915ca4bf/f7c37688 region; exact semantics cannot be confirmed without source.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap

beforeSwap is used to compute and apply a dynamic fee and to check whitelisted routers and circuit breaker state before a swap executes. afterSwap is used to record post-swap tick/price state and update the circuit breaker or stored pool state.

Security & trust assessment

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

Who controls it: The owner can whitelist or remove routers, enable or disable the circuit breaker, and change fee and tick parameters, which can alter the fee users pay or block routing through non-whitelisted routers.

Risk to user funds: The hook does not appear to hold user tokens directly; funds flow through the pool manager. Risk is limited to fee levels and swap blocking via the circuit breaker or router whitelist, which the owner can change.

Security findings

  • [medium] Router whitelist gating: Owner-set router whitelist gates access to beforeSwap logic; an unwhitelisted router may be rejected or treated differently.
  • [medium] Owner-controlled circuit breaker: A circuit breaker can be toggled by the owner, which may pause or penalize swaps when enabled.
  • [medium] Owner-adjustable fee parameters: Fee and tick parameters are writable by the owner, so the owner can change the fee charged to swappers.
  • [info] Unverified source: No source is available, so selector-level behaviour and any upgrade path are inferred only from bytecode and cannot be fully verified.

Contract details

Verified source
No
Bytecode size
8,753 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee

Pools using Dynamic fee hook