Dynamic fee hook on Monad

Uniswap v4 Hook Contract 0x4e23954e3bb8b9a78b2cc500ccca74b603a4c088 on Monad · Dynamic fee

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

What it does

A Uniswap v4 hook that intercepts swaps and uses a return delta to adjust settled amounts, with an owner-settable per-pool fee, though the exact fee logic is not verifiable without source.

How it works step by step

  • Runs custom logic in beforeSwap for every swap in pools that use this hook.
  • Returns a before-swap delta so that part of the swap amounts can be taken or adjusted.
  • Stores a per-pool fee keyed by pool id, set by the owner through setPoolFee.
  • Keeps an owner address in storage that controls administrative setters.
  • Maintains pool registry arrays and mappings (allPools, pools, getPoolCount) for the pools it serves.
Swap behaviour
On every swap the beforeSwap callback runs and may return a delta that changes the amounts settled with the PoolManager, which is how a fee or take is applied.
Liquidity behaviour
No liquidity callbacks are enabled by permissions; the beforeAddLiquidity, beforeRemoveLiquidity and related selectors exist in the dispatcher but the hook permissions only enable beforeSwap and beforeSwapReturnDelta.
Fee behaviour
Per-pool fee is stored and settable by the owner via setPoolFee(bytes32,uint24); the fee is stored in slot 0 alongside the owner address and a uint24 field, and is applied through the beforeSwap return path. The exact fee-application logic cannot be confirmed without source, so the fee may be static per pool or dynamically overridden.
Owner & admin controls
Owner-gated: setOwner(address) transfers ownership and setPoolFee(bytes32,uint24) sets per-pool fees; owner() is readable. Owner is stored in slot 0 and written by the setOwner selector; no pause or upgrade functions were decoded, and no proxy pattern was identified.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap is used to run custom logic on each swap and beforeSwapReturnDelta lets the hook return a delta that alters the amounts settled with the PoolManager, which is the mechanism for taking or redirecting part of a swap.

Security & trust assessment

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

Who controls it: The owner can change the stored pool fee via setPoolFee and reassign ownership via setOwner, and can also call the execute(address,uint256,bytes) selector, which means an owner key could move value or invoke arbitrary calls through the hook.

Risk to user funds: The hook can alter swap settlement amounts through beforeSwapReturnDelta and can set fees on pools it governs, so it can extract value from swappers; the owner-accessible execute selector may further allow movement of tokens held by the hook.

Security findings

  • [medium] Return-delta hook can take swap value: beforeSwapReturnDelta is enabled, so the hook can alter the amounts a swap settles, meaning it can take a portion of trader or pool funds on each swap.
  • [medium] Owner-controlled fee with unclear bounds: The owner can set per-pool fees via setPoolFee and transfer ownership via setOwner; no fee cap was observed in the decoded selectors, so an owner could set the fee to an extreme value.
  • [high] Generic execute function present: An execute(address,uint256,bytes) selector is present and reachable by the owner, which would allow arbitrary external calls from the hook contract context.
  • [info] Unverified source limits analysis: The contract is not verified, so the exact fee math, bounds checks and access modifiers cannot be confirmed from source; findings are inferred from selectors and storage writes.

Contract details

Verified source
No
Bytecode size
14,393 bytes
Upgradeable proxy
No
Detected patterns
return-delta

Pools using Dynamic fee hook