Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$7.42M
Pools using this hook
10
Swaps (24h)
0 (0 traders)
Total swaps
2,501

What it does

A fee-and-routing hook that charges tiered dynamic swap fees, can split a portion of fees to a fee recipient, and restricts or exempts routers and addresses, with an owner-controlled pause switch.

How it works step by step

  • Overrides the pool fee per swap through a tiered scheme (tierOneFee, tierTwoFee, tierThreeFee) and a defaultFee, with the active tier selected from swap count or gas thresholds
  • Reads a per-address fee tier mapping (mapping keyed by address) that can change the fee charged to specific addresses
  • Maintains a whitelist mode and a trustedRouter mapping so only approved routers or addresses can trade when whitelistOnly is enabled
  • Tracks swap counts per pool-and-block style key (mapping keyed by uint256) to drive tier selection
  • Can take a fee share (splitBps, splitEnabled) and send it to feeRecipient via the pool manager's take function, using return deltas in afterSwap and liquidity callbacks
  • Includes a withdraw function that moves token balances out of the hook to a given address
Swap behaviour
beforeSwap sets the dynamic LP fee and checks whitelist and router status; afterSwap increments the swap counter and may take a fee split through a return delta.
Liquidity behaviour
afterAddLiquidity, afterRemoveLiquidity and their return-delta variants run; they record per-position data and can adjust the balance deltas the pool settles.
Fee behaviour
The hook returns an override LP fee on swaps based on tier and gas or swap-count conditions, and can divert a configurable split (splitBps) of fees to feeRecipient.
Owner & admin controls
Owner (single address) can transfer ownership, set the pause state, change fee tiers and default fee, set the split and fee recipient, toggle whitelist mode, manage trusted routers and exempt addresses, set the gas threshold, and call withdraw to move tokens out of the hook.

Enabled Uniswap v4 callbacks

afterAddLiquidity, afterRemoveLiquidity, beforeSwap, afterSwap, afterSwapReturnDelta, afterAddLiquidityReturnDelta, afterRemoveLiquidityReturnDelta

beforeSwap sets the dynamic fee and gates trading; afterSwap updates counters and takes the fee split; afterAddLiquidity and afterRemoveLiquidity record liquidity events; the three return-delta flags let the hook alter the amounts settled with the pool.

Security & trust assessment

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

Who controls it: A single owner key controls fee levels, the fee split and recipient, pausing, whitelisting and routers, and token withdrawal from the hook; ownership can be transferred to any address with no timelock visible.

Risk to user funds: The hook can hold tokens via fee and return-delta accounting and can move them out through withdraw; it can also block swaps via pause or whitelist. Traders and LPs are exposed to owner-set fees and to access restriction.

Security findings

  • [high] Owner can withdraw hook-held tokens: The withdraw(address,address,uint256) selector is owner-gated by inference from the Ownable pattern and moves ERC20 balances using the transfer selector, so accumulated fee or delta tokens held by the hook can be drained by the owner.
  • [high] Owner can set arbitrary fee levels: Setter selectors (tier fees, default fee, split basis points) appear to write fee storage without a visible hard cap in the decoded bytecode, so the owner could raise swap fees to extreme values and extract value from traders and LPs.
  • [medium] Pause can block swaps: The paused() and setPaused(bool) selectors indicate a pause switch that can make beforeSwap or liquidity callbacks revert, halting trading in affected pools.
  • [medium] Whitelist can restrict trading to approved addresses: whitelistOnly and trusted router mappings can make the pool unusable for non-approved callers when enabled, a centralization lever over access.
  • [medium] Return deltas let the hook take tokens from settlement: The afterSwap and liquidity return-delta permissions allow the hook to alter settled amounts, so the fee split is taken from user flows by design and its size is set by the owner.

Contract details

Verified source
No
Bytecode size
16,065 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, ownable, pausable, return-delta

Pools using Dynamic fee hook