Dynamic fee hook on Arbitrum
Uniswap v4 Hook Contract 0xb3f0f5219d17ba4cab6351827c6215911f0d4088 on Arbitrum · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 7
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 63
What it does
A pausable Uniswap v4 hook that intercepts swaps before execution, with owner-settable per-pool fees and an owner-controlled pause switch, and can take a return delta from swaps.
This read was written for the hook 0xa93b…4088 on Ethereum 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
- Runs a beforeSwap callback that checks a global paused flag and a per-pool registration mapping before allowing a swap to proceed.
- Stores a per-pool fee (setPoolFee(bytes32,uint24)) that the owner can set, indicating the hook can override or adjust the fee charged on pools it manages.
- Uses beforeSwapReturnDelta permission, meaning beforeSwap can return a delta that changes the amounts settled for the swap, so the hook can take or give tokens during swaps.
- Maintains an owner address and a registry of pools (pools mapping, allPools list, isPoolRegistered, getPoolCount), suggesting pools are registered to the hook.
- Exposes an execute(address,uint256,bytes) function and a unlockCallback handler, indicating it can call into the pool manager and perform arbitrary calls on behalf of the contract.
- Exposes pool manager, WETH and tick spacing getters, plus add/remove liquidity and donate callbacks that appear to be present in the ABI but are not separately enabled by the hook permissions.
- Swap behaviour
- beforeSwap is nonpayable and checks the paused flag and pool registration state; it may return a delta that alters swap settlement. The afterSwap selector exists in the ABI but afterSwap permission is not enabled, so it will not be called by the pool manager.
- Liquidity behaviour
- Liquidity callbacks (beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity, afterRemoveLiquidity) appear in the selector list but their permissions are not enabled in the address, so the pool manager should not invoke them.
- Fee behaviour
- Per-pool fees are stored and settable by the owner via setPoolFee; the exact fee application path cannot be confirmed from bytecode alone, but the fee mapping and beforeSwap return-delta permission indicate fees may be overridden or taken by the hook during swaps.
- Owner & admin controls
- The owner (slot 0) can transfer ownership via setOwner, pause or unpause swaps via setPaused, set per-pool fees via setPoolFee, and register pools via the pool-related functions. Owner can also call execute to make arbitrary external calls, which is a broad privilege.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap: gates swaps on the paused flag and pool registration and can set the fee or adjust the swap. beforeSwapReturnDelta: allows beforeSwap to return a delta so the hook can take or give tokens as part of the swap settlement.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: A single owner key controls pausing, fee levels per pool, pool registration and arbitrary external calls. Compromise or misuse of this key could freeze trading or extract value from swappers.
Risk to user funds: The hook can block swaps through the pause flag and can alter swap settlement via return deltas, and the owner can move assets the hook holds via execute. Exact fund flows cannot be confirmed without verified source.
Security findings
- [medium] Owner can pause all swaps: setPaused(bool) toggles a flag checked in beforeSwap, so the owner can halt trading on every pool using this hook at any time.
- [high] Owner can set arbitrary pool fees: setPoolFee(bytes32,uint24) lets the owner set any fee value for a pool with no visible bound in the decoded code, which could extract value from traders if the fee is applied as a taken delta.
- [high] Arbitrary execute capability: execute(address,uint256,bytes) lets the owner make arbitrary calls with value from the hook contract, which could move any tokens or ETH the hook holds.
- [medium] Return-delta can take tokens from swaps: beforeSwapReturnDelta permission means the hook can alter swap settlement, so user funds in swaps can be redirected by the hook logic, and the exact amount cannot be verified without source.
- [low] Owner key can be transferred without timelock: setOwner(address) changes the owner immediately with no visible delay or two-step process.
Contract details
- Verified source
- No
- Bytecode size
- 16,322 bytes
- Upgradeable proxy
- No
- Detected patterns
- pausable, return-delta
Pools using Dynamic fee hook
- ETH / S*SGETH (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- S*USDC / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- FRAX / S*FRAX (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- S*WOO / WOO (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- S*USDT / USD₮0 (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- MAI / S*MAI (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- S*LUSD / LUSD (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today