Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0xc201641cdd8b48aea0fb5509065c79a2cb6be888 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
0

What it does

This hook collects protocol fees on swaps in Uniswap v4 pools and forwards them to a token jar, while restricting which liquidity can be added.

How it works step by step

  • Runs logic when a pool is initialized (beforeInitialize)
  • Gates liquidity additions before they occur (beforeAddLiquidity)
  • Takes a fee portion on swaps through beforeSwapReturnDelta
  • Settles collected currency via take and settle calls
  • Forwards protocol fees to a tokenJar address
  • Reads protocol fee controller and multiplier to size fees
Swap behaviour
beforeSwap runs custom logic and uses return-delta accounting to take a share of swap currency, which is settled to a token jar.
Liquidity behaviour
beforeAddLiquidity is implemented and is likely used to gate or restrict liquidity provision; beforeRemoveLiquidity and afterRemoveLiquidity selectors are present but their behaviour is not clear from the decoded data.
Fee behaviour
Hook reads a protocol fee controller and fee flags (protocolFeeController, protocolFeeFlags, protocolFeeMultiplier) and routes protocol fees toward a tokenJar; the exact fee math could not be confirmed without source.
Owner & admin controls
No owner or admin setter found in the dispatched selectors; the tokenJar address is stored in slot 0 and can be changed via pollTokenJar/state writes (unclear); no pause or upgrade function identified.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize: runs setup when a pool is created. beforeAddLiquidity: checks or gates liquidity additions (the LiquidityNotAllowed error suggests a restriction). beforeSwap: runs custom logic before swaps and may move currency. beforeSwapReturnDelta: lets the hook alter swap accounting, so it can take or give tokens during a swap.

Security & trust assessment

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

Who controls it: Protocol-fee routing and tokenJar selection appear to be driven by stored state; if a privileged key can change the tokenJar or fee controller, it could redirect protocol fees.

Risk to user funds: The hook can take a portion of swap currency through return-delta accounting and forward it to a token jar; users can also be blocked from adding liquidity by the beforeAddLiquidity check.

Security findings

  • [medium] Hook takes currency via return delta: The hook has beforeSwapReturnDelta permission and the bytecode contains take/settle calls, so it can take tokens from swaps and send them to a tokenJar.
  • [medium] Token jar destination may be mutable: Slot 0 holds an address that is written by pollTokenJar and quote paths, suggesting the destination of collected funds may be changeable.
  • [low] Liquidity provision can be restricted: beforeAddLiquidity can revert with LiquidityNotAllowed, so the hook may restrict who can provide liquidity.
  • [info] Calls into external pools: The bytecode contains external calls to Curve-style pool functions (exchange, get_dy, get_dx, coins), so the hook interacts with an external pool that could behave unexpectedly.

Contract details

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

Pools using Fee sharing hook