Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0x0cb161b8cda9b46556d743b27a9b0f732e41e044 on Ethereum · Fee sharing

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

What it does

This hook takes a fee from swap output and sends the accumulated amount to a fee recipient, with the owner able to change that fee and where it goes.

How it works step by step

  • Enables the afterSwap hook with return-delta, so it can take a cut of swap output currency after each swap
  • Stores a feeRecipient address and a pair of uint16 fee parameters that are updated through updateFees
  • Accumulates the hook's share of fees as tokens held by the hook and lets the recipient withdraw them via claimFees
  • Restricts pool initialization through beforeInitialize and initializePool, which takes a pool key and initial price
  • Uses ownable two-step ownership (transferOwnership, acceptOwnership, renounceOwnership) for administrative functions
Swap behaviour
After each swap the hook computes a fee from the swap amounts and the stored uint16 fee parameters, returns that amount as a hook delta so it is taken from the swapper's output, and keeps it in the contract for later claiming. Exact per-direction treatment cannot be fully confirmed from bytecode alone.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
The hook takes a fee from swaps through afterSwap return delta, using two uint16 parameters (the second read during swaps) that are set by the owner via updateFees. The pool's static fee is not the sole source of fees; the exact formula is not recoverable from decoded bytecode.
Owner & admin controls
The owner can change the fee recipient (setFeeRecipient), update the two fee parameters (updateFees), claim accumulated fees to an address (claimFees), and transfer or renounce ownership with a two-step pending owner flow.

Enabled Uniswap v4 callbacks

beforeInitialize, afterSwap, afterSwapReturnDelta

beforeInitialize is used to validate pool setup at initialization; afterSwap with return delta is used to take a fee from each swap and credit it to the hook.

Security & trust assessment

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

Who controls it: A single owner key controls the fee rate, the fee recipient, the claim of accumulated fees and ownership transfer; a compromised key could set a high fee and redirect all accrued fees.

Risk to user funds: The hook can take a portion of swap output and hold it until claimed, so fee tokens sit in the contract; it does not appear to hold pool liquidity itself, but the owner can withdraw the accumulated balance.

Security findings

  • [medium] Owner can change fee parameters: updateFees(uint16,uint16) is owner-gated and changes the fee charged on every swap; the fee bounds could not be confirmed from bytecode, so the owner may be able to set a very high fee.
  • [medium] Owner can redirect accrued fees: setFeeRecipient and claimFees let the owner direct accumulated hook-held fee tokens to any address.
  • [medium] Hook holds and moves currency: The contract takes tokens via afterSwap return delta and uses transfer and take, so it holds user-paid fee tokens until claimed.
  • [info] No source verification: Without verified source, the exact fee formula, bounds and access checks on each function cannot be fully confirmed.

Contract details

Verified source
No
Bytecode size
6,196 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, fee-sharing, moves-currency, ownable, return-delta

Pools using Fee sharing hook