Fee sharing hook on Ethereum

Uniswap v4 Hook Contract 0x31e1df074adff2d8f711202d54d572e16b7e10cc on Ethereum · Fee sharing

Volume (24h)
$0.24
Value locked (TVL)
$31
All-time volume
$15
Pools using this hook
1
Swaps (24h)
1 (1 traders)
Total swaps
17

What it does

A tax-and-reflection hook that skims a configurable fee from swaps and distributes it among a tax wallet, token holders via reflection, LP positions, and burns.

How it works step by step

  • Applies a configurable tax in basis points to swaps through beforeSwap and afterSwap return deltas
  • Splits collected fees across tax wallet, holder reflection, LP share and burn according to owner-set shares
  • Tracks per-holder reflection accounting through accPerShare and per-user mappings
  • Manages its own LP position via the PoolManager (modifyLiquidity, settle, take)
  • Exposes permissionless processFees and performUpkeep to distribute accumulated fees
  • Allows the owner to rescue tokens and adjust tax, wallet and share parameters
Swap behaviour
beforeSwap and afterSwap run on every swap and use return deltas to take a tax from the swap amount, which is then split between the tax wallet, reflection, LP, and burn shares.
Liquidity behaviour
Hook interacts with the pool through the PoolManager (modifyLiquidity, settle, take, unlock, unlockCallback), indicating it can add or remove liquidity itself. It tracks a hasPosition flag and an accumulator per share (accPerShare), suggesting it manages its own LP position for fee distribution.
Fee behaviour
A tax in basis points is applied to swaps (taxBps stored in slot 7, adjustable by owner via setTax). Collected fees are split between a tax wallet, reflection to holders, LP share, and burn according to share parameters (walletBps, reflectBps, lpBps, burnBps). Exact fee-taking path is inferred from selectors only.
Owner & admin controls
Owner (Ownable, slot 0) can set the tax rate via setTax(uint256), change the tax wallet via setTaxWallet(address), set share splits via setShares(uint256,uint256,uint256,uint256), rescue tokens via rescue(address,address,uint256), and transfer ownership via transferOwnership(address). Owner can also call bind() and initPool(uint160) during setup. No pause or upgrade function was identified in the decoded selectors.

Enabled Uniswap v4 callbacks

afterInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

afterInitialize: sets up the pool key and internal pool state at initialization. beforeSwap: applies tax or pre-swap logic and may return a delta. afterSwap: collects fees and performs accounting after the swap. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take or give currency deltas during swaps, enabling it to skim a portion of swap amounts.

Security & trust assessment

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

Who controls it: The owner can set the tax rate (setTax) with no visible cap in the decoded selectors, potentially setting it very high and extracting most of swap value from traders. The owner can redirect the tax wallet and change share splits, and can rescue arbitrary tokens, which could include pool or user funds held by the hook.

Risk to user funds: The hook takes a percentage of swap amounts via return deltas and holds balances for reflection and LP accounting, so it can hold and move user and pool funds. The owner can rescue tokens and raise the tax, so exposure depends on owner honesty and the configured limits, which could not be verified without source.

Security findings

  • [high] Owner-adjustable tax rate: setTax(uint256) changes taxBps and no bound check could be confirmed from bytecode alone; a high rate would let the owner take most swap proceeds.
  • [high] Owner token rescue: rescue(address,address,uint256) lets the owner move tokens held by the hook, which may include reflected or unclaimed user balances.
  • [medium] Return-delta fee extraction: Hook has return-delta permissions and performs currency moves through the PoolManager, so it can take a share of swap amounts on every trade.
  • [medium] Single privileged owner key: Ownable with transferOwnership; no timelock or multisig requirement visible in the bytecode.
  • [info] Permissionless fee processing: performUpkeep and processFees are publicly callable and distribute fees, so timing of distribution is externally triggered.

Contract details

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

Pools using Fee sharing hook