Fee sharing hook on Ethereum

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

A Uniswap v4 hook that intercepts swaps and pool creation to route part of trading value to a protocol token jar, with its exact behaviour not fully confirmed without source.

This read was written for the hook 0xf101…a888 on Ethereum and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Runs logic when a pool is initialized (beforeInitialize)
  • Runs a check or setup before liquidity is added (beforeAddLiquidity)
  • Runs logic before every swap and returns a delta adjustment (beforeSwap with beforeSwapReturnDelta)
  • References a protocol fee controller and token jar for fee routing
  • Calls pool manager functions such as take, settle and sync to move currency
Swap behaviour
beforeSwap runs on every swap and, via the return delta permission, can adjust the swap's token deltas to take a fee or move currency to the protocol token jar.
Liquidity behaviour
beforeAddLiquidity is implemented as a hook callback, and the hook contains afterRemoveLiquidity and afterAddLiquidity selectors; the hook is permissioned for beforeAddLiquidity only, so liquidity callbacks beyond the add-check are not enabled.
Fee behaviour
The hook references a protocol fee controller and token jar (getters TOKEN_JAR, protocolFeeController, protocolFeeMultiplier, protocolFeeFlags) and appears to route a protocol fee from swaps to a token jar; exact fee rates cannot be determined without source.
Owner & admin controls
Storage slot 0 holds an address that is read and written by pollTokenJar, quote and tokenJar paths, suggesting a configurable token jar or fee recipient that a privileged party may be able to set; no owner setter is directly identified from the decoded selectors, so exact admin rights cannot be confirmed.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize is used to set up pool state on pool creation; beforeAddLiquidity is used to run logic before liquidity is added; beforeSwap is used to run logic before each swap, and beforeSwapReturnDelta lets the hook alter the swap's token deltas, which is how it can take a fee or moves currency from the pool.

Security & trust assessment

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

Who controls it: A privileged key may be able to change the token jar or fee controller address stored in slot 0 and redirect protocol fees; the decoded bytecode does not show a clear owner-only setter, so the extent is uncertain.

Risk to user funds: The hook can take tokens from swaps through return deltas and may forward protocol fees to a configured token jar; it can therefore move a portion of swap value, but it does not appear to hold a large custodial balance.

Security findings

  • [medium] Return delta lets hook alter swap amounts: The hook is granted beforeSwapReturnDelta and has the moves-currency tag, so it can take or settle tokens during swaps. This changes the amount users receive from the pool.
  • [medium] Mutable token jar destination: Slot 0 is written during pollTokenJar and quote paths, meaning the token jar destination may be mutable and could be redirected.
  • [low] Depends on external contracts: The hook calls external functions including take, settle and sync on the pool manager and swapIn/swapOut style routines on an external DEX, so its behaviour depends on external contracts.
  • [info] Unverified source: No verified source is available, so the exact fee maths and access control cannot be confirmed from the bytecode alone.

Contract details

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

Pools using Fee sharing hook