Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$101.38M
Pools using this hook
15
Swaps (24h)
0 (0 traders)
Total swaps
75,622

What it does

A Uniswap v4 hook that applies owner-configurable dynamic swap fees, with pause and whitelist controls over swaps and liquidity provision.

How it works step by step

  • Applies a dynamic swap fee read from owner-configured fee parameters stored on-chain
  • Supports per-pool fee overrides keyed by pool id and a function to clear them
  • Gates adding liquidity through a whitelist and allowed-provider mapping
  • Can be paused by the owner, which blocks swaps
  • Tracks a swap count per pool id
  • Uses a gas cap setting for external calls
Swap behaviour
beforeSwap reads the pause flag, per-pool fee overrides and fee configuration from storage, computes the swap fee, and increments a per-pool swap counter.
Liquidity behaviour
beforeAddLiquidity checks the sender against an add-liquidity whitelist and allowed-provider set and can revert for unauthorized providers. beforeRemoveLiquidity and the after-liquidity callbacks are present but appear to be pass-through with no state changes.
Fee behaviour
Fees are set by an owner-configured fee config (base, surge-style and cap values stored in slot 2 and read in beforeSwap), with optional per-pool overrides stored in a mapping keyed by pool id (slot 3). Fee values are read from storage on each swap; the exact formula could not be fully confirmed without source.
Owner & admin controls
Owner (slot 0) can pause or unpause via setPaused, set the gas cap, manage the swap and liquidity whitelists and allowed providers, set per-pool fee overrides and clear them, change the fee configuration via the 0x2d398609 setter, and transfer ownership. Owner transfer is a single step. No proxy or upgrade mechanism was identified.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap

beforeAddLiquidity gates which addresses may add liquidity; beforeSwap computes and applies the dynamic swap fee and records per-pool swap counts; no other callbacks are enabled.

Security & trust assessment

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

Who controls it: The owner can pause all swaps, arbitrarily change fee parameters including the fee cap, add or remove liquidity providers and whitelisted addresses, set per-pool fee overrides, and take over ownership in one step. A malicious or compromised key could set extreme fees on users or block trading and liquidity provision.

Risk to user funds: The hook does not appear to take custody of tokens or use return deltas, so pool funds are not held by the hook. However, the owner can block swaps through pause and block or restrict liquidity provision through the whitelist, and can set fees that affect trader outcomes.

Security findings

  • [medium] Centralized owner control with single-step ownership transfer: A single owner key controls pausing, fee configuration, per-pool fee overrides and the liquidity whitelist; ownership transfer is one step with no timelock.
  • [medium] Owner can pause swaps: The pause flag is read in beforeSwap, so the owner can halt all swaps through this hook.
  • [low] Owner-set fees may lack sufficient bounds: Fee values are stored and updated by the owner; a fee-setting path that accepts large values could impose high fees if bounds are not enforced in the setter.
  • [info] Liquidity provision is permissioned: Liquidity addition is restricted by whitelist and allowed-provider mappings, so new LPs may be blocked at the owner's discretion.

Contract details

Verified source
No
Bytecode size
8,295 bytes
Upgradeable proxy
No
Detected patterns
ownable, pausable

Pools using Dynamic fee hook