Dynamic fee hook on BNB Chain

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

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$774
Pools using this hook
26
Swaps (24h)
0 (0 traders)
Total swaps
100

What it does

A Uniswap v4 hook that charges a dynamic swap fee set by an owner-managed configuration, so traders pay a fee that the hook's owner can adjust.

This read was written for the hook 0xfada…4080 on Robinhood 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 supply a dynamic LP fee for each swap
  • Reads packed fee parameters from storage slot 4
  • Allows the owner to update fee values via setFees
  • Maintains a whitelist of routers via setWhitelistedRouter
  • Exposes owner and ownership transfer functions for access control
Swap behaviour
beforeSwap is called on every swap and returns a fee derived from stored fee parameters; routers may be checked against a whitelist.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fees are read from packed storage slot 4 and updated by the owner via setFees; beforeSwap returns a dynamic fee value. Exact fee formula could not be determined without source. Fee is bounded by a MAX_DYNAMIC_FEE constant.
Owner & admin controls
Owner (set via transferOwnership) can call setFees(uint24,uint24,uint24) to change stored fee parameters and setWhitelistedRouter(address,bool) to whitelist routers; ownership can be transferred to another address. No pause or upgrade mechanism identified.

Enabled Uniswap v4 callbacks

beforeSwap

beforeSwap is enabled and used to compute a dynamic LP fee for swaps, with a router whitelist gating some behaviour.

Security & trust assessment

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

Who controls it: The owner controls fee parameters and router whitelisting; a malicious or compromised owner could raise fees toward the maximum or change which routers are allowed, affecting swappers' costs.

Risk to user funds: The hook appears to only compute fees in beforeSwap and does not return balance deltas or take custody of tokens, so it likely cannot hold or directly move user funds. Its influence is through the fee charged on swaps.

Security findings

  • [medium] Owner-adjustable fees: The owner can call setFees to modify fee parameters stored in slot 4, changing the cost of swaps for all users.
  • [low] Owner-controlled router whitelist: setWhitelistedRouter and the whitelist mapping in slot 3 give the owner control over which routers are treated as permitted in beforeSwap.
  • [low] Single-step ownership transfer: Ownership is held in slot 0 and can be transferred with a single call to transferOwnership, with no two-step confirmation observed.
  • [info] Unverified source: No source is available, so the exact fee bounds and the behaviour of the admin-only functions were inferred from selectors and storage access only.

Contract details

Verified source
No
Bytecode size
6,617 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, ownable

Pools using Dynamic fee hook