Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0x42ebcf86e3ab0445ba0362f911a7e8fad6ace0cc on Ethereum · Fee sharing

Volume (24h)
$35.03K
Value locked (TVL)
$7.50K
All-time volume
$35.03K
Pools using this hook
1
Swaps (24h)
196 (101 traders)
Total swaps
196

What it does

A Uniswap v4 hook that charges a configurable dynamic swap fee and routes a share of the collected value to a fee splitter and rewards accounting.

How it works step by step

  • Overrides the LP fee on each swap using owner-configured fee basis points, capped by MAX_FEE_BPS
  • Gates swaps behind a trading-open flag and reverts with TradingNotOpen when closed
  • Takes a portion of swap value through return deltas in beforeSwap and afterSwap
  • Mints or burns ERC-6909 claim tokens to account for collected fees
  • Forwards collected fees to a feeSplitter and rewards contract
  • Initializes pool state and stores the pool key in beforeInitialize
Swap behaviour
beforeSwap overrides the LP fee using stored fee parameters and reverts when trading is not open; afterSwap computes the fee taken and settles it via unlock, take, mint and burn calls, with return deltas adjusting the swap amounts.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Dynamic fee hook: swaps are charged a fee set by the owner-configured parameters stored in slot 4 (ethFeeBps and a second fee value), capped by MAX_FEE_BPS; fees are routed to a feeSplitter and rewards contract rather than just staying in the pool.
Owner & admin controls
Owner (Ownable) can call setFees(uint16,uint16) to change fee parameters (bounded by MAX_FEE_BPS and FeeTooHigh check), transferOwnership and renounceOwnership. Owner can also open trading via a flag (tradingOpen).

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records pool key and initialization state; beforeSwap overrides the LP fee and gates swaps behind tradingOpen; afterSwap computes fee amounts and claims/mints ERC-6909 claims; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take a share of swap amounts via deltas.

Security & trust assessment

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

Who controls it: The owner can change fee rates (up to the cap), open or effectively control trading state, and can transfer or renounce ownership. A malicious or compromised owner could raise fees to the maximum and redirect fee flows through the splitter.

Risk to user funds: The hook can take a share of each swap through return deltas and mint or burn ERC-6909 claims, so swap value passes through the hook. It can also block swaps when trading is closed. Fee rates are owner-set within a cap.

Security findings

  • [medium] Owner-adjustable swap fees: Owner can call setFees to adjust fee parameters that are applied to every swap; the cap is MAX_FEE_BPS but a high cap still lets the owner extract significant value from traders.
  • [medium] Hook takes currency via return deltas: Return-delta permissions let the hook take tokens from swaps, and the hook uses unlock and take/mint/burn calls to move currency, so it can hold and redirect user swap value.
  • [medium] Swaps can be blocked by owner-controlled flag: beforeSwap checks a trading-open flag and reverts with TradingNotOpen, so the owner can halt swaps for the pool.
  • [low] Fee destination not fully verifiable: Fee-splitter and rewards addresses are referenced in bytecode; if these are mutable or the splitter is a proxy, destination of fees may change without user consent.

Contract details

Verified source
No
Bytecode size
6,904 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc6909-claims, fee-sharing, moves-currency, ownable, return-delta, rewards, self-unlock

Pools using Fee sharing hook