Dynamic fee hook on Arbitrum

Uniswap v4 Hook Contract 0x8fba64a2b45a4e0760a428b80f1ab59dc6e1c088 on Arbitrum · Dynamic fee

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

What it does

A pausable Uniswap v4 hook with per-pool fee settings that runs before each swap and can adjust the swap's return delta, with an owner-controlled pause switch and per-pool fee override.

How it works step by step

  • Stores an owner address and a global pause flag that gates swap-related logic
  • Keeps a registry of pools (pool count, an array of pool IDs and a mapping of pool keys to values) that the owner can manage
  • Lets the owner set a custom fee for a specific pool through setPoolFee(bytes32,uint24)
  • Implements beforeSwap with a return-delta permission, meaning it can alter the amounts a swap settles for, not only the fee
  • Exposes a generic execute(address,uint256,bytes) entry point and a bfd3da96-selector call with arbitrary calldata, which is a potential arbitrary-call surface
  • Exposes a getPoolCount, allPools, pools and version view surface for off-chain tooling
Swap behaviour
beforeSwap is executed on every swap in pools using this hook. It reads the paused flag and the pool's stored fee configuration, and because beforeSwapReturnDelta is enabled it can return a delta that changes the amounts settled for the swap. Exact logic cannot be confirmed without source.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are present but these callbacks are not enabled in the hook permissions, so the pool manager will not invoke them.
Fee behaviour
The owner can set a per-pool fee via setPoolFee. The fee is applied through the swap path, and the return-delta capability means the hook may also take or adjust amounts beyond the standard LP fee. The exact fee math cannot be determined from the decoded bytecode.
Owner & admin controls
An owner address (storage slot 0) can call setOwner to transfer ownership, setPaused to halt the hook, setPoolFee to change fees per pool, and execute/bfd3da96 to make arbitrary external calls. No upgrade proxy pattern is evident, but the owner may be able to change behaviour indirectly through these calls.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: runs custom logic (including pause check and per-pool fee lookup) before each swap. beforeSwapReturnDelta: lets the hook return a delta that changes the swap's settled amounts.

Security & trust assessment

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

Who controls it: A single owner key controls pausing, fee levels per pool, ownership transfer and generic external calls, so a compromised or malicious owner could halt trading, impose high fees, or drain funds reached through the arbitrary-call functions.

Risk to user funds: The hook can block swaps via the pause flag and can alter settled amounts via the return delta, and it may be able to move tokens through the execute entry points, so user and pool funds are exposed to the owner's discretion.

Security findings

  • [medium] Swaps can be paused by the owner: setPaused(bool) writes a flag read in beforeSwap, so the owner can halt swaps in pools using this hook at will.
  • [medium] Owner-settable per-pool fee: setPoolFee(bytes32,uint24) lets the owner set arbitrary fees for pools, with no bound visible in the decoded selectors; a very high fee would extract value from traders.
  • [high] Return-delta capability on swaps: beforeSwapReturnDelta allows the hook to alter the amounts settled in each swap, so the hook can take or redirect tokens from swappers and LPs beyond the standard fee.
  • [high] Generic arbitrary-call entry points: execute(address,uint256,bytes) and a second selector 0xbfd3da96 with the same shape accept arbitrary calldata; if callable by the owner they can move assets or change any contract the hook controls.
  • [info] Source not verified: No verified source is available, so the exact fee formulas, access checks and the purpose of the pool registry cannot be confirmed.

Contract details

Verified source
No
Bytecode size
20,728 bytes
Upgradeable proxy
No
Detected patterns
pausable, return-delta

Pools using Dynamic fee hook