Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$18.82M
Pools using this hook
17
Swaps (24h)
0 (0 traders)
Total swaps
21,572

What it does

A Uniswap v4 hook on BNB Chain that applies owner-configurable dynamic or overridden LP fees on swaps and gates liquidity additions through a whitelist, with an owner pause switch.

How it works step by step

  • Charges swap LP fees using per-pool overrides or a configurable fee config capped by MAX_LP_FEE.
  • Blocks swaps and liquidity additions while the owner has paused the hook.
  • Restricts beforeAddLiquidity to addresses on an owner-managed whitelist.
  • Tracks swap counts per pool id.
  • Enforces a gas cap parameter on swap execution.
  • Owner can transfer ownership of the hook.
Swap behaviour
beforeSwap applies the pool's LP fee (dynamic, overridden or static based on stored config), enforces the paused flag and gas cap, and increments a per-pool swap counter.
Liquidity behaviour
beforeAddLiquidity is gated by a whitelist and by the paused flag; it reverts or permits adds based on addLiquidityWhitelist. beforeRemoveLiquidity and afterRemoveLiquidity exist in the dispatch table but appear to be pass-through.
Fee behaviour
Uses a per-pool fee override mapping and a configurable fee config (four uint24 values and three uint16 values) read during swaps; the swap path appears to choose between static, dynamic and overridden LP fees based on stored config, flagged by DYNAMIC_FEE_FLAG and LP_FEE_OVERRIDE_FLAG constants and a MAX_LP_FEE cap. Exact fee formula could not be confirmed without source.
Owner & admin controls
Owner (slot 0) can pause or unpause the hook via setPaused, set the gas cap via setGasCap, manage the addLiquidity whitelist via setWhitelist, set per-pool fee overrides via the 0x20892176 setter and clear them via clearFeeOverride, update fee config via 0x2d398609, and transfer ownership via transferOwnership. Ownership is a single address with no timelock or multisig evidence in bytecode.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap

beforeAddLiquidity: restricts who may add liquidity via whitelist and pause check. beforeSwap: applies the dynamic or overridden LP fee and enforces pause and gas cap, and tracks swap counts per pool id.

Security & trust assessment

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

Who controls it: The owner can pause all swaps and liquidity additions, change fee parameters and per-pool fee overrides (potentially to the max LP fee), whitelist addresses, and transfer control of the hook at any time.

Risk to user funds: The hook does not appear to hold user tokens directly (no transfer or return-delta callbacks are enabled), but it can block swaps and liquidity adds via pause and whitelist, and it can influence the fee taken from swaps. No direct custody of pool funds was identified from the decoded functions.

Security findings

  • [medium] Owner pause can halt trading: Owner can call setPaused to block beforeSwap and beforeAddLiquidity for all pools, freezing trading for users.
  • [medium] Owner controls swap fees: Owner can set per-pool fee overrides and fee config, which determine the LP fee charged on swaps; a malicious or compromised owner could raise fees toward MAX_LP_FEE.
  • [medium] Single-key owner with no visible timelock: The owner is a single address (slot 0) with ownership transfer and no timelock or multisig evidence in bytecode.
  • [info] Whitelisted liquidity additions: Beforeadd liquidity is restricted by a whitelist, so LPs cannot freely deposit unless approved by the owner.
  • [info] Gas cap and swap counting: Swap count per pool id is stored and a gas cap is applied in beforeSwap, indicating some gas-limit logic around swap execution.

Contract details

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

Pools using Dynamic fee hook