Fee sharing hook on Base

Uniswap v4 Hook Contract 0xa1dfe862f1111f5e9d466fd4d7297d7d4fa76888 on Base · Fee sharing

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
101
Swaps (24h)
199 (111 traders)
Total swaps
1,972

What it does

Takes a protocol fee on swaps through a return delta and forwards the collected tokens to a token jar, while gating liquidity additions.

How it works step by step

  • Hooks beforeSwap and returns a delta so it can take a cut of swap amounts
  • Routes skimmed tokens to a token jar contract
  • Exposes protocol fee multiplier and flag views for fee configuration
  • Checks and can revert liquidity additions in beforeAddLiquidity
  • Tracks initialized pools in storage during beforeInitialize
Swap behaviour
beforeSwap runs custom logic and uses a return delta to take a fee from the swap, with collected tokens sent via transfer and settle calls toward a token jar.
Liquidity behaviour
beforeAddLiquidity is implemented and may revert with LiquidityNotAllowed, suggesting liquidity additions are restricted or gated; afterAddLiquidity and afterRemoveLiquidity are present as selectors but their logic could not be fully determined.
Fee behaviour
The hook exposes protocolFeeMultiplier, protocolFeeFlags and protocolFeeController references and routes value to a tokenJar contract via TOKEN_JAR and tokenJar(); the hook appears to skim protocol fees from swaps into a token jar, but the exact fee calculation could not be fully decoded.
Owner & admin controls
Storage slot 0 holds an address that is written by 3f7d1179 (pollTokenJar) and cd272714 (quote); the decoded functions suggest a token jar address that can be set or polled, but no owner-gated setter was clearly identified. Exact admin roles could not be confirmed from bytecode alone.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize: runs checks or setup when a pool is initialized, likely registering pool state. beforeAddLiquidity: can gate liquidity additions (LiquidityNotAllowed error present). beforeSwap: runs custom logic on swaps and can return a delta (return-delta tag), which lets the hook take or adjust swap amounts. beforeSwapReturnDelta: enables the hook to alter the swap's token deltas, typically to skim a fee.

Security & trust assessment

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

Who controls it: Unclear from bytecode; a privileged key that can poll or redirect the token jar or change protocol fee parameters could redirect fee flows or effectively alter swap pricing for users.

Risk to user funds: The hook can take or redirect a portion of swap amounts through return deltas and transfer tokens to a token jar; funds are not expected to be held long-term but swap flows are altered.

Security findings

  • [medium] Hook moves currency during swaps: beforeSwapReturnDelta is enabled, so the hook can take a portion of swap amounts and move tokens (transfer, take, settle calls are present in the bytecode).
  • [low] Liquidity additions can be blocked: The hook contains a LiquidityNotAllowed revert path in beforeAddLiquidity, so some pools or callers may be blocked from adding liquidity.
  • [info] Limited verifiability: Without verified source, the exact owner or governance controls, fee caps and pausing behaviour cannot be confirmed.

Contract details

Verified source
No
Bytecode size
12,107 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using Fee sharing hook