Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
$0.83
All-time volume
$10.17K
Pools using this hook
2
Swaps (24h)
0 (0 traders)
Total swaps
95

What it does

A Uniswap v4 hook that applies a tiered, owner-configurable dynamic LP fee to swaps, with a pause switch, an address allowlist and per-address fee overrides, while gating liquidity additions to registered pools.

How it works step by step

  • beforeSwap computes and returns a dynamic LP fee from tier one, two and three values and a default fee stored in packed storage
  • Per-address fee overrides let the owner charge specific callers a set fee and clear it later
  • A global pause flag causes swaps to revert when set by the owner
  • beforeAddLiquidity checks pool registration or allowlist state before permitting liquidity additions
  • A per-pool swap counter is incremented on every swap and exposed via swapCount
  • A gas threshold and gas buffer are stored and readable, suggesting gas-sensitive logic in fee or call handling
Swap behaviour
beforeSwap is called on every swap, reads pause status, fee tiers, default fee and per-address overrides, and returns the dynamic fee for the swap; it also increments a per-pool swap counter.
Liquidity behaviour
beforeAddLiquidity is enabled and appears to check a registration or allowlist mapping (slot 3, mapping of pool id to bool) and pool key mapping (slot 4), so adding liquidity may be restricted to registered pools. beforeRemoveLiquidity and afterAddLiquidity/afterRemoveLiquidity selectors exist but are not enabled in the hook permissions, so they are not called by the pool manager.
Fee behaviour
Fees are set by a tiered scheme (tierOne, tierTwo, tierThree, defaultFee, MAX_LP_FEE) stored in packed storage slot 0, with per-address fee overrides in mapping slots 9 and 10 that can be set and cleared by the owner. beforeSwap reads these values and likely returns a dynamic fee with the override flag set, so the pool fee can vary per swap and per caller.
Owner & admin controls
Owner-gated functions include setPaused (global pause), setAllowed (allowlist of addresses), setGasThreshold, a multi-parameter fee configuration setter (0x2d398609 and 0x5ddf0f5e, which write fee tiers and a paused flag), and clearFeeOverride (per-address fee override removal). Owner is readable via owner(), and an owner-only 0x20892176 setter writes per-address fee overrides (uint24 fee plus bool flag). Whether these setters are onlyOwner is inferred from the owner() function and storage writes, not confirmed from source.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap

beforeAddLiquidity: gates or registers liquidity additions for pools. beforeSwap: computes the dynamic LP fee per swap using tier, default and override fee settings and records swap counts per pool.

Security & trust assessment

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

Who controls it: A single owner key controls the global pause, the allowlist, the fee tiers, the gas threshold and per-address fee overrides. The owner could raise fees up to MAX_LP_FEE for chosen addresses, or pause the hook so that swaps or liquidity additions revert, affecting all users of pools using this hook.

Risk to user funds: The hook does not appear to take custody of tokens or use return deltas, so it likely cannot directly move pool funds. Its exposure is indirect: it can block swaps and liquidity additions via pause or allowlist changes, and it can impose high or discriminatory fees on swappers.

Security findings

  • [medium] Owner-controlled pause: The contract has a global paused flag (slot 2) read in beforeSwap, so the owner can halt pool activity for all users.
  • [medium] Per-address fee discrimination: The owner can set per-address fee overrides (mapping slot 9 and 10), so specific addresses can be charged different fees than the public tiers.
  • [medium] Mutable fee parameters: Fee tiers and the default fee are writable by the owner through the packed fee configuration setter, so the fee applied to all swaps can be changed after pools are created.
  • [low] Unverified external call: The contract appears to call an external function with selector 0x3521ab9f and reads positionManager and poolManager addresses; the call target is determined at runtime and cannot be verified without source.
  • [info] Access control not verified: Without verified source, the exact access checks on owner-only setters cannot be confirmed from bytecode alone.

Contract details

Verified source
No
Bytecode size
7,827 bytes
Upgradeable proxy
No
Detected patterns
pausable

Pools using Dynamic fee hook