Dynamic fee hook on BNB Chain

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

Volume (24h)
$1.35K
Value locked (TVL)
$4.83K
All-time volume
$1.40K
Pools using this hook
13
Swaps (24h)
12 (6 traders)
Total swaps
15

What it does

A Uniswap v4 hook that charges a dynamically computed LP fee on each swap, with owner-configurable fee parameters.

This read was written for the hook 0xdd8e…8080 on BNB Chain and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Implements beforeSwap to return a dynamic LP fee for each swap
  • Computes the fee with calculateFee from parameters stored in packed slot 5
  • Reads current pool state (getSlot0) to inform fee calculation
  • Pushes fee updates to the pool manager via updateDynamicLPFee
  • Owner can set base currency and reconfigure fee parameters
Swap behaviour
beforeSwap computes a dynamic fee (via calculateFee and stored parameters, reading pool state) and returns it for the swap.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fee is computed on the fly by calculateFee(uint256) and beforeSwap returns a dynamic LP fee; fee parameters are stored in packed slot 5 and owner-settable, and the hook calls updateDynamicLPFee on the pool manager to apply the value.
Owner & admin controls
Owner (slot 0) can transfer ownership, set the base currency (slot 1) and set/override the dynamic LP fee via the owner-gated setters (0x279da5d9, 0x69c9e8a6 write packed fee/parameter slot 5); no pause or upgrade mechanism identified.

Enabled Uniswap v4 callbacks

beforeSwap

beforeSwap: computes and returns the dynamic swap fee for each swap based on stored parameters and pool state read via getSlot0.

Security & trust assessment

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

Who controls it: The owner can transfer ownership, change the base currency and reconfigure fee parameters, so a compromised owner key could set swap fees to extreme values and extract value from traders.

Risk to user funds: The hook does not appear to custody tokens or take return deltas; it affects user funds only by setting the LP fee charged on swaps, which an owner could raise significantly.

Security findings

  • [medium] Owner can reconfigure dynamic fees: Owner-gated setters (0x279da5d9, 0x69c9e8a6, 0xb478f416) write fee-related storage that directly determines swap fees paid by users.
  • [low] Single-step ownership transfer: The owner can reassign ownership in a single step via transferOwnership (0xf2fde38b), with no evident two-step acceptance.
  • [info] Source not verified: Without verified source, exact fee bounds and the correctness of calculateFee cannot be confirmed from bytecode alone.

Contract details

Verified source
No
Bytecode size
5,612 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, ownable

Pools using Dynamic fee hook