Dynamic fee hook on World Chain

Uniswap v4 Hook Contract 0x4b4953e02d4dc99bb47e4d57e416e20fa96054cc on World Chain · Dynamic fee

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

What it does

A dynamic-fee hook for a Uniswap v4 pool that sets and tracks per-pair fees and takes a share of swap value through return deltas, with owner-controlled withdrawal and pause.

How it works step by step

  • Initializes per-pair state when a pool is created (afterInitialize).
  • Sets or reads a dynamic fee in beforeSwap and stores pair fee data.
  • Takes a share of swap amounts via before/after swap return deltas.
  • Updates liquidity accounting after LP additions (afterAddLiquidity).
  • Holds ERC-6909 claim balances and settles them through unlockCallback, take and settle.
  • Exposes owner-gated withdraw, mint, burn and pause controls.
Swap behaviour
beforeSwap and afterSwap run on every swap; the hook updates per-pair fee and accumulator state and can take a portion of the swap as a return delta.
Liquidity behaviour
afterAddLiquidity (0x9f063efc) updates a per-pool accumulator in storage; the hook also exposes mint/burn and withdraw entry points that move tokens for the hook itself.
Fee behaviour
Fees appear to be computed by the hook and stored per pair (fees(bytes32) and swapFee() reads, beforeSwap writes to storage); the 990d9692 setter takes three uint24 values that likely configure fee tiers. Exact formula cannot be confirmed without source.
Owner & admin controls
Owner (storage slot 3) can transfer ownership via setOwner and toggle a pause flag via setPause; owner-gated functions also include withdraw, mint, burn and per-pool parameter setup (990d9692 sets three uint24 fee parameters). Confidence is limited because names are not verified.

Enabled Uniswap v4 callbacks

afterInitialize, afterAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

afterInitialize registers pair state at pool creation; afterAddLiquidity updates accounting after LP deposits; beforeSwap sets dynamic fee/state before each swap; afterSwap updates accumulators after each swap; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts as a delta, meaning it can capture part of swap value.

Security & trust assessment

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

Who controls it: The owner can pause the hook (setPause), change ownership, and call withdraw, which may let a privileged key extract tokens the hook holds, including fees accrued from swaps.

Risk to user funds: The hook can take a share of swap amounts through return deltas and hold claim balances and fees in its own accounting; the owner can withdraw those balances and pause activity, so user funds routed through the pool are partially exposed to this contract's logic.

Security findings

  • [medium] Hook takes swap value via return deltas: Return-delta permissions let the hook take a portion of every swap; the hook also calls take/settle/sync and unlock, so it moves currency during swaps.
  • [medium] Owner withdrawal and pause controls: An owner-gated withdraw(address,uint256) and setPause(bool) exist; pausing can block swaps or liquidity changes if the pause check is applied in callbacks.
  • [low] ERC-6909 claim accounting: The hook holds ERC-6909 claim balances (erc6909-claims tag) and uses an unlockCallback, so accounting depends on the hook correctly settling claims.
  • [info] Unverified source: No verified source; behaviour inferred from selectors and storage only, so exact fee math and access checks are unconfirmed.

Contract details

Verified source
No
Bytecode size
18,224 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, moves-currency, return-delta, self-unlock

Pools using Dynamic fee hook