Dynamic fee hook on Base

Uniswap v4 Hook Contract 0x658132413323f1900f5996fa709ea3057f7baac8 on Base · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$1.06K
All-time volume
$0
Pools using this hook
3
Swaps (24h)
172 (2 traders)
Total swaps
172

What it does

A Uniswap v4 hook with custom swap and liquidity logic that uses return deltas to move currency and includes admin-managed routing, keepers and a pause switch, with its precise purpose not confirmable without verified source.

How it works step by step

  • Runs custom logic in beforeInitialize to control pool creation
  • Gates liquidity additions and removals through beforeAddLiquidity and beforeRemoveLiquidity
  • Executes custom logic in beforeSwap and afterSwap, with return deltas that can take or give currency
  • Restricts privileged operations to an admin, keepers and trusted routers or quoters
  • Accumulates residue and provides sweep and withdrawFloat style fund movement
  • Supports a global pause flag and gas policy parameters
Swap behaviour
beforeSwap and afterSwap callbacks are implemented, and the hook can adjust swap deltas via beforeSwapReturnDelta, so swaps may be taxed, rerouted or partially absorbed by the hook.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity are present and appear to gate or inspect third-party liquidity operations; the bytecode also contains a ThirdPartyLiquidityBlocked error, suggesting liquidity from non-approved parties may be rejected. Withdrawal-style functions (withdrawFloat, sweep) move funds.
Fee behaviour
Uses the pool's static fee as far as the decoded surface shows; no obvious dynamic fee setter was identified, though several unnamed functions exist and could not be decoded.
Owner & admin controls
An admin address (slot 0, set via setAdmin) can set the residue recipient, trusted routers and quoters, keepers, gas policy values and a global pause flag. The admin appears able to reassign itself through setAdmin, so control rests with one key unless ownership is handled off-chain.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta

beforeInitialize restricts or checks pool initialization; beforeAddLiquidity and beforeRemoveLiquidity gate liquidity changes; beforeSwap and afterSwap run custom logic around swaps; beforeSwapReturnDelta lets the hook take or give currency deltas during swaps, which is the main custody-relevant permission.

Security & trust assessment

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

Who controls it: The admin key can pause the hook globally, change trusted routers and keepers, redirect residue funds to a residue recipient, adjust gas policy parameters and reassign admin. A compromised admin could block swaps or direct accumulated residue away from the intended recipient.

Risk to user funds: The hook can hold and move tokens through return deltas, sweep and withdrawFloat style functions, and residue handling. Access to these functions depends on admin, keeper and trusted-router checks that cannot be fully verified from bytecode alone, so user and pool funds may be exposed to privileged actions.

Security findings

  • [medium] Return-delta currency movement: beforeSwapReturnDelta is enabled, so the hook can absorb or inject currency during swaps and the bytecode includes transfer and take calls, meaning the hook holds and moves user-linked tokens.
  • [medium] Admin pause over core operations: A globalPaused flag and setGlobalPaused control exist; if the pause check gates swap or liquidity entry points, an admin can halt trading.
  • [medium] Single privileged admin: Admin-controlled setAdmin, setKeeper, setTrustedRouter and setResidueRecipient give one key broad authority over routing and fund destination.
  • [low] Unverified fund-moving paths: Several selectors (withdrawFloat, sweep, unlockCallback, uniswapV3SwapCallback) suggest a self-unlock pattern that moves balances; the exact authorization of these paths could not be confirmed without source.

Contract details

Verified source
No
Bytecode size
22,609 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, return-delta, self-unlock

Pools using Dynamic fee hook