Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0x8fb4228579feca76d35f8fe361209cffe58c60c4 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 takes a fee on swaps through a return delta and sends the proceeds to a treasury, and it blocks trading until it is opened, though exact fee rates and which trade direction pays more could not be confirmed from the bytecode.

How it works step by step

  • Hook is attached to a Uniswap v4 pool and is called before initialization, before and after swaps, and around liquidity add, remove and donate operations.
  • Uses afterSwap with return deltas, meaning the hook can take a portion of swap output for itself and account it through the pool manager.
  • Exposes fee-related getters (feeBps, MAX_FEE_BPS, treasury) and a collectFees function, indicating a fee is accrued and forwarded to a treasury address.
  • Uses ERC6909 claim tokens (mint and burn selectors present) and take/unlock calls, so collected fees are held as claims inside the pool manager.
  • Tracks pool creation and trading-open state through storage (poolCreated, tradingOpen, tradingOpenedAt, poolOpenedAt), and reverts swaps with TradingNotOpen until trading is enabled.
  • Calls an external isAgentHolder check and exposes portraits, ink, imd and released getters, which suggest holder-gated or metadata-related logic not fully determinable without source.
Swap behaviour
beforeSwap is gated: it reverts with TradingNotOpen when trading has not been opened. afterSwap computes a fee in basis points (bounded by MAX_FEE_BPS) on the swap output and returns it as a return delta, so the hook takes that share of the trade; exact direction-dependent rates cannot be confirmed from decoded bytecode.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present and handle liquidity changes, apparently with liquidity-management logic. Exact effects are not determinable without source.
Fee behaviour
Fee is a hook-level fee in basis points (feeBps, capped by MAX_FEE_BPS) taken on swaps via afterSwap return delta and sent to a treasury; collectFees moves accumulated fees out. The pool's static fee is not the only fee source.
Owner & admin controls
Treasury address, fee rate (feeBps) and trading-open state appear to be set by privileged logic, but the exact setter functions and their access control cannot be identified from decoded bytecode alone. Whether an owner can change fees or pause trading is therefore not confirmed.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, afterSwapReturnDelta

beforeInitialize and afterInitialize run setup and record pool creation; beforeSwap gates trading until open; afterSwap takes the fee via afterSwapReturnDelta; liquidity and donate callbacks apply liquidity-management or pass-through checks.

Security & trust assessment

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

Who controls it: A privileged key may be able to set the fee rate, treasury destination and trading-open state; the exact setters could not be identified, so the scope of that power is unconfirmed.

Risk to user funds: The hook holds and moves swap value through return deltas and ERC6909 claims, and can block swaps before trading opens, so user trades are directly affected by the fee and gating logic.

Security findings

  • [medium] Hook takes swap output via return delta: afterSwapReturnDelta lets the hook keep a portion of every swap output; the rate is set by feeBps, which may be adjustable by a privileged key.
  • [medium] Trading can be gated before opening: beforeSwap reverts with TradingNotOpen until tradingOpen is set, so swaps can be blocked by whoever controls that flag.
  • [info] Fee collection and treasury routing: collectFees and treasury getter indicate accumulated fees are forwarded to a treasury address; the recipient is changeable only if a setter exists, which could not be verified.
  • [medium] Unverified external holder check: isAgentHolder is called externally; the dependency and any access restriction it implies cannot be verified without source.
  • [info] No source available: Analysis is from decoded bytecode only, so privileged setters and upgrade paths are not confirmed.

Contract details

Verified source
No
Bytecode size
6,246 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, fee-sharing, liquidity-management, moves-currency, return-delta, self-unlock

Pools using Fee sharing hook