Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0xb5ced1310e62ed2f47c39e4c3ed81ba2419c90cc 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

A Uniswap v4 hook that takes a tax on swaps in the pool and redistributes it to a tax wallet, reflection holders, protocol liquidity and a burn share.

How it works step by step

  • Charges a configurable tax (taxBps) on swaps through return-delta accounting
  • Splits collected fees into wallet, reflection, LP and burn shares set by setShares
  • Accrues reflections per holder (accPerShare, pendingReflection, claimReflection)
  • Processes accumulated fees into WETH and liquidity via processFees and performUpkeep
  • Maintains its own position in the pool through the pool manager (hasPosition, modifyLiquidity)
  • Allows the owner to rescue stray tokens
Swap behaviour
beforeSwap and afterSwap run on every swap; the hook charges a tax via return deltas and records fee accounting for distribution.
Liquidity behaviour
Hook manages its own WETH-paired position (MIN_LP_WETH threshold, hasPosition, modifyLiquidity through the pool manager) and adds protocol-owned liquidity from collected fees during fee processing; no direct user liquidity callbacks identified.
Fee behaviour
Hook takes a tax in basis points (taxBps, adjustable via setTax by owner) on swaps and routes it to a tax wallet, reflection holders, LP share and burn share according to share parameters set via setShares; fees are accumulated and later distributed via processFees/performUpkeep.
Owner & admin controls
Owner (Ownable) can call setTax, setTaxWallet, setShares, rescue (token recovery) and transferOwnership; owner can also change tax and split parameters that apply to swaps, and rescue can move tokens held by the hook. Pausing/upgrades not identified from bytecode.

Enabled Uniswap v4 callbacks

afterInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

afterInitialize: sets up pool key and initial state and possibly seeds liquidity; beforeSwap: applies tax/checks on incoming swaps and can take the tax via return delta; afterSwap: accounts fees and reflection accrual; beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a portion of swap amounts as fees.

Security & trust assessment

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

Who controls it: The owner can change the tax rate via setTax, reconfigure distribution shares via setShares, redirect the tax wallet via setTaxWallet, and rescue arbitrary tokens held by the contract via rescue; a malicious or compromised owner could set the tax very high or drain accumulated funds.

Risk to user funds: The hook holds WETH and token balances from fee collection and reflection accounting and can move them through processFees, claimReflection, its own LP position and the owner-only rescue function; swaps pass through the hook and pay the tax via return deltas.

Security findings

  • [high] Owner-adjustable swap tax: setTax allows the owner to set taxBps; without bound verification in the bytecode, the owner could raise the tax rate significantly and extract value from swappers.
  • [high] Owner token rescue: rescue(address,address,uint256) lets the owner move tokens out of the contract, which may include accumulated user reflection balances or pool-related funds.
  • [medium] Return-delta fee extraction: Hook uses return deltas to take a share of swap amounts, so fees are extracted directly from the swap flow on every trade.
  • [medium] Single owner key: Ownable pattern with transferOwnership; a single key controls all parameters and fund recovery.
  • [info] Unverified source: Contract is not verified; behaviour inferred from selectors and storage only, so exact bounds on tax and share values cannot be confirmed.

Contract details

Verified source
No
Bytecode size
16,690 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, ownable, return-delta, self-unlock

Pools using Fee sharing hook