Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0x02ae15805894d0cafbea4d13d63459e14b8d6888 on Ethereum · Fee sharing

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

What it does

A Uniswap v4 hook that appears to take a protocol fee on swaps and route it to a token jar, using a return delta on beforeSwap.

How it works step by step

  • Enables beforeSwap with beforeSwapReturnDelta, letting the hook adjust swap deltas and take a share of currency.
  • Exposes fee(), protocolFeeMultiplier() and protocolFeeFlags(), indicating a configurable protocol fee.
  • References protocolFeeController and a TOKEN_JAR, indicating protocol fees are forwarded to a token jar.
  • Writes a token jar address in storage via pollTokenJar, a mutable destination for collected fees.
  • Gates liquidity additions in beforeAddLiquidity and records pool state in beforeInitialize.
Swap behaviour
beforeSwap is enabled with beforeSwapReturnDelta, so the hook can alter swap amounts and move currency to or from the pool during swaps; the precise delta and fee split are not recoverable without source.
Liquidity behaviour
beforeAddLiquidity is enabled and the hook exposes afterAddLiquidity and beforeRemoveLiquidity/afterRemoveLiquidity selectors; the beforeAddLiquidity permission is enabled, so liquidity addition is gated by the hook, though the exact gating logic is not recoverable.
Fee behaviour
Exposes fee(), protocolFeeMultiplier(), protocolFeeFlags() and quote(bool,int256,bytes32) and references protocolFeeController and a TOKEN_JAR, suggesting a dynamic fee where a protocol share is routed to a token jar; exact fee formula is not recoverable without source.
Owner & admin controls
Storage slot 0 holds an address that is written by pollTokenJar (3f7d1179) and read alongside tokenJar (490c98f5); no owner-only modifier is recoverable from decoded bytecode, so exact admin authority cannot be confirmed. Parameter-style functions (fee, expiryBlock, protocolFeeMultiplier, protocolFeeFlags) are exposed as views. No explicit pause or upgrade function was decoded.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize: runs logic when a pool is initialized (writes storage slot 3 keyed by index). beforeAddLiquidity: gates or inspects liquidity additions. beforeSwap: adjusts swap logic and reads reserve-like mappings in slot 2. beforeSwapReturnDelta: lets the hook return a delta so it can take or settle part of the swap amount, which is why the moves-currency heuristic was raised.

Security & trust assessment

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

Who controls it: Storage slot 0 is written by pollTokenJar and the token jar address is externally reachable; a privileged party controlling that address or the fee parameters could redirect protocol fees or alter swap deltas. Ownership is not verifiable from the decoded input.

Risk to user funds: The hook can take or redirect part of swap currency through its return delta and token transfers to a token jar address, so trader and LP funds routed through swaps may be partially diverted; exact amounts depend on logic not recoverable from bytecode.

Security findings

  • [medium] Return delta takes swap currency: beforeSwapReturnDelta is enabled, so the hook can take a share of swap amounts and move currency during swaps, which is a direct handle on trader proceeds.
  • [medium] Hook moves tokens directly: The hook calls transfer, transferFrom, take, settle and sync against token contracts, so it can move tokens held for the pool.
  • [medium] Mutable token jar destination: Slot 0 is written by pollTokenJar and cd272714 quote logic, indicating a mutable address that routes funds; no access-control check was decoded.
  • [info] Time-limited behaviour: expiryBlock suggests the hook may stop operating after a block height; behaviour after expiry is not decoded.

Contract details

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

Pools using Fee sharing hook