Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$259.13K
Pools using this hook
19
Swaps (24h)
0 (0 traders)
Total swaps
23,832

What it does

Applies an owner-configurable dynamic swap fee per pool and can take a currency delta when liquidity is added, so traders pay a fee set by the hook rather than a static fee.

How it works step by step

  • Initializes per-pool fee state in afterInitialize
  • Reads the stored dynamic fee for each pool in beforeSwap
  • Stores and updates fee configuration per pool via owner-gated setter
  • Enforces fee bounds between minimum and maximum allowed fees
  • Can take tokens from the pool and return a currency delta in afterAddLiquidity
Swap behaviour
beforeSwap reads the stored fee for the pool and returns it as the dynamic LP fee used for the swap.
Liquidity behaviour
After liquidity is added, the hook can return a currency delta (afterAddLiquidityReturnDelta) and take tokens from the pool via take(); liquidity removal and donation callbacks are present only as views with no state changes.
Fee behaviour
Sets a dynamic LP fee per pool, bounded between DEFAULT_MIN_FEE and DEFAULT_MAX_FEE (MIN_ALLOWED_FEE and MAX_ALLOWED_FEE limits), stored in feeConfig and poolState mappings, and pushed to the PoolManager through updateDynamicLPFee; reverts with FeeOutOfBounds if out of range.
Owner & admin controls
Owner-gated via Ownable: owner (slot 0) can call 0x02b05f8c (fee/parameter configuration setter, writes slots 1 and 2 region) and transferOwnership/renounceOwnership. Pool fee bounds are constrained by MIN_ALLOWED_FEE and MAX_ALLOWED_FEE constants, and owner can update per-pool fee config via feeConfig storage.

Enabled Uniswap v4 callbacks

afterInitialize, afterAddLiquidity, beforeSwap, afterAddLiquidityReturnDelta

afterInitialize sets up initial pool fee state; beforeSwap computes and applies the dynamic fee for each swap; afterAddLiquidity may take and return a currency delta to adjust accounting on liquidity addition.

Security & trust assessment

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

Who controls it: The owner can change fee configuration for pools, potentially raising fees up to the maximum allowed or lowering them to the minimum, affecting trader cost; the owner can also transfer or renounce ownership.

Risk to user funds: The hook can take tokens from the pool during afterAddLiquidity and adjust deltas, but it does not appear to hold user funds itself; the main exposure is through fee manipulation by the owner and accounting errors in the return-delta path.

Security findings

  • [medium] Hook moves currency via return delta: Afterdd-liquidity return delta and take() calls let the hook move pool currency during liquidity additions, so its accounting logic must be correct to avoid misallocating funds.
  • [medium] Owner controls dynamic fee: Single Ownable owner controls fee parameters; a compromised key could set fees to the maximum on all configured pools.
  • [info] No upgrade path detected: Hook is non-upgradeable as far as the bytecode shows, with no proxy or upgrade selectors found.

Contract details

Verified source
No
Bytecode size
6,577 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, ownable, return-delta

Pools using Dynamic fee hook