Fee sharing hook on Ink

Uniswap v4 Hook Contract 0x61d70891be9c6d9eeef8a3844bf17194cbc000cc on Ink · Fee sharing

Volume (24h)
$2.00K
Value locked (TVL)
$0
All-time volume
$2.00K
Pools using this hook
1
Swaps (24h)
23 (12 traders)
Total swaps
23

What it does

A swap tax hook that withholds a buy or sell fee in basis points on trades and forwards the accumulated tax to a recipient address.

How it works step by step

  • Applies a separate buy tax and sell tax in basis points on swaps through the pool
  • Caps configurable tax rates with a MAX_TAX_BPS constant
  • Accrues withheld tax amounts in pendingTaxes
  • Forwards accumulated taxes to taxRecipient when collect() is called
  • Uses return-delta permissions to take the tax from swap amounts
Swap behaviour
On beforeSwap and afterSwap the hook applies buyTaxBps or sellTaxBps to the swap amount, withholds that share via return delta, and accrues it to pendingTaxes.
Liquidity behaviour
Liquidity add and remove callbacks are dispatched but appear to be pass-through hooks with no custom accounting; liquidity is not taken by the hook.
Fee behaviour
Charges a buy tax and a sell tax expressed in basis points, capped by MAX_TAX_BPS. Collected taxes accumulate as pendingTaxes and are forwarded to taxRecipient when collect() is called.
Owner & admin controls
Buy and sell tax rates are exposed as buyTaxBps() and sellTaxBps() with a MAX_TAX_BPS cap; the taxRecipient() address receives collected taxes via collect(). Whether any setter exists cannot be confirmed from the dispatched selectors, so admin controls are not fully determinable.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap and afterSwap run the tax logic on each swap; beforeSwapReturnDelta and afterSwapReturnDelta let the hook claim a share of the swap amounts in the return delta, which is how the tax is withheld; the hook calls unlock and take on the pool manager to move currency.

Security & trust assessment

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

Who controls it: If a privileged key can change tax rates or the tax recipient, it could redirect or raise taxes up to MAX_TAX_BPS on swaps; this cannot be verified without source.

Risk to user funds: The hook holds accrued tax balances in pendingTaxes and moves swap currency through the pool manager, so user swap amounts pass through hook accounting. Without source, the exact bounds of this exposure are not confirmed.

Security findings

  • [medium] Hook takes currency from swaps: Return-delta permissions let the hook withhold part of each swap, and the hook moves currency through the pool manager via unlock and take.
  • [medium] Self-unlock and currency movement: The hook can unlock the pool manager itself (self-unlock) and call take to move tokens, which increases the surface for accounting errors.
  • [info] Tax cap present: Tax rates are bounded by a MAX_TAX_BPS constant, limiting the maximum fee a trader can be charged.
  • [low] Taxes held in contract: Collected taxes sit in pendingTaxes until collect() is called, so funds are held by the hook contract between collections.

Contract details

Verified source
No
Bytecode size
4,469 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta, self-unlock

Pools using Fee sharing hook