Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$16.71M
Pools using this hook
4
Swaps (24h)
0 (0 traders)
Total swaps
18,865

What it does

A Uniswap v4 hook that applies owner-configurable dynamic swap fees and restricts liquidity additions to an allowlist of providers, with a pause switch.

How it works step by step

  • Sets a dynamic LP fee on each swap in beforeSwap, using stored fee config and a roll-based selection
  • Supports per-pool fee overrides set by the owner
  • Caps LP fees using a MAX_LP_FEE constant
  • Restricts liquidity additions to allowlisted providers in beforeAddLiquidity
  • Counts swaps per pool in storage
  • Can be paused and has owner-managed configuration
Swap behaviour
beforeSwap computes a dynamic fee from stored fee configuration and per-pool overrides and updates a per-pool swap counter; swaps can be paused by the owner.
Liquidity behaviour
beforeAddLiquidity (259982e5) checks whether the sender is an allowed provider (mapping in slot 4); adds are restricted to allowed providers.
Fee behaviour
Fee is set dynamically in beforeSwap (575e24b4) using a fee configuration of several uint24/uint16 values stored in slot 2, a per-pool override mapping (slot 3), and a roll-based selector (d00934ba selectFeeFromRoll) with a MAX_LP_FEE cap and an override flag; exact formula not recoverable without source.
Owner & admin controls
Owner-gated functions include pause/unpause (49994147), setting fee config (7d2c6be4, 87b2a139), setting simulation gas limit (b10042df), managing allowed providers (65d24453, c4ed4354), setting per-pool fee overrides (f8d518a8, cb8a6b22), and transferring ownership (6ff1f06e). Owner is stored in slot 0.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap

beforeAddLiquidity: gates liquidity additions to allowed providers. beforeSwap: computes and applies the dynamic swap fee and tracks swap counts per pool (slot 7).

Security & trust assessment

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

Who controls it: The owner can pause the hook, change fee parameters and per-pool fee overrides, add or remove allowed liquidity providers, change the simulation gas limit, and transfer ownership. A compromised owner key could set fees to extreme values, block swaps while paused, or restrict liquidity provision.

Risk to user funds: The hook does not appear to take custody of tokens or use return deltas, so it does not directly hold user funds. Risk comes from the owner's ability to pause swaps, change fees, and restrict liquidity provision, which can affect trader and LP outcomes.

Security findings

  • [medium] Owner-controlled pause: Hook exposes a pause flag (5c975abb paused, 49994147 setter) that is checked in swap-related paths, so an owner can halt swaps.
  • [medium] Owner can alter swap fees: Fee configuration and per-pool fee overrides (f8d518a8, 7d2c6be4) are owner-settable; the bytecode includes a MAX_LP_FEE constant, which bounds the LP fee, but the override path's bounds could not be verified.
  • [low] Allowlisted liquidity provision: Liquidity additions are gated by an allowlist (c4ed4354, 65d24453); only approved providers can add liquidity to pools using this hook.
  • [low] Single-owner control: Ownership is a single address in slot 0 with a transfer function (6ff1f06e), and no timelock or multisig is evident in the decoded functions.

Contract details

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

Pools using Dynamic fee hook