Dynamic fee hook on Base

Uniswap v4 Hook Contract 0xf72822803b5a60d6287d367397541045ef650880 on Base · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$10.93M
Pools using this hook
3
Swaps (24h)
0 (0 traders)
Total swaps
24,150

What it does

A Uniswap v4 hook that applies owner-configurable tiered dynamic swap fees with per-address overrides, can be paused, and can restrict which addresses add liquidity.

How it works step by step

  • Selects a dynamic LP fee on each swap from tiered fee settings.
  • Applies per-address fee overrides set by the owner.
  • Counts swaps per pool id for on-chain tracking.
  • Can be paused by the owner to halt swaps.
  • Restricts liquidity additions through an address-keyed allowlist check.
  • Exposes fee configuration getters for front ends.
Swap behaviour
beforeSwap checks the pause state, increments a swap counter per pool id, and returns a dynamic fee chosen from the default, tier one, two or three fees, or a per-address override, with an override flag.
Liquidity behaviour
beforeAddLiquidity is implemented and reads a per-address mapping (slot 5), which suggests an allowlist-style gate on who may add liquidity. No liquidity removal callback is enabled.
Fee behaviour
Fees are set by the hook: a default fee (slot 1) plus three tier fees (tierOneFee, tierTwoFee, tierThreeFee) selected in beforeSwap, with per-address fee overrides stored in a mapping (slot 4) and an override flag returned with the fee. Fee config fields are packed into storage slots 0 and 1 and are owner-settable.
Owner & admin controls
Owner (slot 0) can transfer ownership, pause and unpause via setPaused, set the default fee via setDefaultFee, update the fee configuration via the 0x65a08c0e setter (which writes slots 0 and 1), set per-address fee overrides via 0xc94e2375 and 0xc3347ba1, and toggle a per-address flag via 0x6e0db89c. No upgrade proxy pattern was identified from the decoded functions.

Enabled Uniswap v4 callbacks

beforeAddLiquidity, beforeSwap

beforeAddLiquidity: checks an address-keyed mapping before liquidity is added, likely to gate or restrict LPs. beforeSwap: pause check, swap counting per pool id, and dynamic fee selection with override flag.

Security & trust assessment

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

Who controls it: The owner can pause all swaps, change the default and tier fees (including potentially to very high values, subject to the bytecode's own bounds which were not verified), grant or revoke per-address fee overrides and liquidity-gating flags, and transfer ownership to any address. A compromised owner key could therefore block trading or extract value through fee manipulation.

Risk to user funds: The hook does not appear to hold user tokens or take return deltas, so it cannot directly custody pool funds. Its exposure is indirect: it can block swaps via pause and alter the fees charged on each trade, and gate who adds liquidity.

Security findings

  • [medium] Owner can pause swaps: The owner can call setPaused, which the beforeSwap path checks (slot 0, offset 20), blocking swaps while paused.
  • [medium] Owner controls dynamic fees: Owner-settable fee configuration (setDefaultFee and the 0x65a08c0e setter writing slots 0 and 1) and per-address overrides (0xc94e2375, 0xc3347ba1) can change fees applied to swappers; the bounds on these values were not confirmed from the bytecode.
  • [low] Owner-gated liquidity additions: beforeAddLiquidity reads an address mapping and a 0x6e0db89c setter toggles it, which suggests the owner can restrict which addresses add liquidity.
  • [low] Single-step ownership transfer: Ownership is held in slot 0 and transferable via transferOwnership (0xf2fde38b) with no two-step acceptance pattern identified.
  • [info] Unverified source: Hook is not verified and was analysed from decoded bytecode only; function names and bounds are inferred and may be inaccurate.

Contract details

Verified source
No
Bytecode size
7,210 bytes
Upgradeable proxy
No
Detected patterns
ownable, pausable

Pools using Dynamic fee hook