Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0xf5dd67fc85d48dd2d940a554387db73f8e77a0cc on Ethereum · Fee sharing

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

What it does

This hook takes a basis-point fee on swaps through the pool manager and sends the collected currency to a fee recipient, so traders receive slightly less than the raw swap output while liquidity providers are unaffected.

How it works step by step

  • Initializes a pool once via beforeInitialize, storing a poolInitialized flag in slot 0
  • Exposes a fee configuration surface: LP_FEE, FEE_BPS, TICK_SPACING, feeRecipient and cosmo getters
  • Tracks cumulative fees in slot 1 (totalFeesCollected) updated during beforeSwap and afterSwap
  • Calls take(address,address,uint256) on the pool manager, indicating it withdraws currency from the pool and moves it to a recipient
  • Uses beforeSwapReturnDelta and afterSwapReturnDelta, so it can alter the net amounts settled for a swap
Swap behaviour
beforeSwap and afterSwap are both implemented and can return deltas; the hook takes a fee-based amount on swaps and forwards it via take, so swappers net less than the raw swap output. Exact direction-dependence cannot be confirmed from bytecode alone.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity are present as views that appear to only perform checks or return values; no evidence of liquidity being moved by the hook.
Fee behaviour
Fees are taken in the hook as a basis-point amount (FEE_BPS) and accumulated into totalFeesCollected, with a feeRecipient receiving them; the pool's static LP fee is also exposed via LP_FEE.
Owner & admin controls
Could not determine from decoded bytecode; no owner, pause or upgrade selectors were decoded, but feeRecipient and cosmo are readable values whose mutability was not visible.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records initialization state; beforeSwap and afterSwap compute and take the fee and update fee accounting; beforeSwapReturnDelta and afterSwapReturnDelta let the hook alter settlement amounts; liquidity and donate callbacks are enabled only as no-op views.

Security & trust assessment

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

Who controls it: If a privileged key can change feeRecipient or fee parameters, it could redirect or raise fees on all swaps; no such setter was decoded.

Risk to user funds: The hook can take currency during swaps through take() and return deltas, so user swap proceeds are directly exposed to the configured fee.

Security findings

  • [medium] Hook takes fees via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta with take() calls let the hook extract currency from every swap, so the fee rate and recipient determine user cost.
  • [info] Fee recipient and rate not verified as immutable: feeRecipient, FEE_BPS and cosmo are exposed as getters; decoded bytecode does not show whether setters exist, so mutability is unknown.
  • [info] Unverified source: No verified source is available, so behavior is inferred from selectors, storage slots and call patterns only.

Contract details

Verified source
No
Bytecode size
3,081 bytes
Upgradeable proxy
No
Detected patterns
fee-sharing, moves-currency, return-delta

Pools using Fee sharing hook