Fee sharing hook on Ink

Uniswap v4 Hook Contract 0x13557bc7a2127915e99b54cec299384f01596acc on Ink · Fee sharing

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

What it does

Charges a capped buy/sell tax on swaps in factory-registered pools, collected for later claiming, while listed exempt addresses trade tax-free.

How it works step by step

  • Adds a buy and sell tax to swaps in registered pools, with separate rates for each direction.
  • Taxes are taken out of swap amounts and held as claimable fees per pool.
  • A factory registers each pool with its buy/sell tax rates and a short list of fee-exempt addresses.
  • An authorized party can claim the accrued tax for a pool to a chosen address.
  • Checks that pools are registered before allowing initialization, liquidity adds and swaps.
Swap behaviour
On each swap in a registered pool, the hook deducts a tax from the swap input or output depending on direction, unless the trader is on the exempt list. Swaps in unregistered pools revert.
Liquidity behaviour
Before adding and removing liquidity the hook runs checks. The remove-liquidity check appears to be a view-only callback, but its exact conditions cannot be fully confirmed from bytecode, and it may revert if the pool is not registered.
Fee behaviour
Buy and sell taxes are set per pool at registration and capped by a hard-coded MAX_TAX_BPS constant whose exact value is not visible here. There is also a POOL_FEE_BPS constant. Taxes accrue in the hook for each pool and are claimed by an authorized caller, likely the pool creator or factory.
Owner & admin controls
The deployer can set the factory address. The factory registers pools with tax rates up to MAX_TAX_BPS and a limited number of exempt addresses. There is no visible function to change taxes after registration.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: only allows registered pools; beforeAddLiquidity: checks pool registration; beforeRemoveLiquidity: runs a check on LP withdrawals; beforeSwap and afterSwap: compute and apply the buy/sell tax; beforeSwapReturnDelta and afterSwapReturnDelta: take the tax from the swap amounts.

Security & trust assessment

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

Who controls it: The deployer controls the factory address, and the factory sets each pool's tax rates and exempt list at registration within the MAX_TAX_BPS cap.

Risk to user funds: The hook takes the configured tax from swap amounts and holds it until claimed. The maximum tax is unknown from bytecode. No function to drain LP principal was found.

Security findings

  • [medium] Swap tax via return deltas: The hook deducts buy/sell taxes from swaps up to a hard-coded maximum that cannot be read from bytecode alone.
  • [low] Fee-exempt list: Up to a fixed maximum number of addresses per pool can trade without paying the tax.
  • [low] Remove-liquidity callback enabled: The hook runs on LP withdrawals; it appears to be a view-only registration check, but its exact behaviour is unverified.

Contract details

Verified source
No
Bytecode size
5,891 bytes
Upgradeable proxy
No
Detected patterns
fee-sharing, moves-currency, return-delta, self-unlock, tax

Pools using Fee sharing hook