Fee sharing hook on Ink
Uniswap v4 Hook Contract 0x5ad1a191ac3f3186b1dfb7af82602b97291e6acc on Ink · 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
This hook charges registered pools a capped buy and sell tax on every swap, accrues it for later claim by the fee owner, and leaves LP deposits and withdrawals untaxed.
How it works step by step
- Charges a buy and sell tax on swaps in registered pools, with separate rates per direction stored per pool.
- Taxes are capped by a hard-coded maximum tax constant (exact value not readable from bytecode).
- Collected taxes accrue per pool and can be claimed to an address via a claim function.
- Pools must be registered by a factory before they can be initialized or used.
- Liquidity add and remove checks only confirm the pool is registered; no withdrawal fee is charged.
- Swap behaviour
- On each swap the hook takes a tax from the swap amount (input or output, depending on direction) using return deltas and records it as accrued fees for the pool. Buys and sells can have different tax rates.
- Liquidity behaviour
- Add-liquidity runs a check that the pool is registered. The remove-liquidity callback appears to be a view check with no fee, so LPs should be able to withdraw, though it could revert for unregistered pools.
- Fee behaviour
- A per-pool buy tax and sell tax are set at registration and capped by a maximum tax constant; the exact cap is unknown from bytecode. Accrued taxes are claimed by an authorized party (likely the pool creator or factory) for later withdrawal.
- Owner & admin controls
- A deployer can set the factory address, and the factory registers pools with tax rates bounded by a maximum tax constant. No function to change taxes after registration was found.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: only allows registered pools; beforeAddLiquidity: registration check; beforeRemoveLiquidity: view check on withdrawals; beforeSwap and afterSwap: compute and take the tax; beforeSwapReturnDelta and afterSwapReturnDelta: deduct tax from swap amounts.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, medium confidence).
Who controls it: The deployer controls the factory address, which decides pool registration and tax rates up to a hard-coded maximum. Accrued fees are claimable by an authorized party.
Risk to user funds: Traders pay a per-direction tax on swaps up to an unverified cap; LP principal cannot be taxed via deltas and withdrawals appear unrestricted.
Security findings
- [medium] Swap tax via return deltas: The hook deducts a buy or sell tax from swaps; a maximum tax cap exists but its value cannot be confirmed from unverified bytecode.
- [low] Factory controls registration: The deployer sets the factory, which registers pools and their tax rates within the cap.
- [info] Withdrawals not taxed: The remove-liquidity callback is a view check and liquidity return deltas are disabled, so no fee can be taken from LP withdrawals.
Contract details
- Verified source
- No
- Bytecode size
- 5,144 bytes
- Upgradeable proxy
- No
- Detected patterns
- fee-sharing, moves-currency, return-delta, self-unlock, tax
Pools using Fee sharing hook
- ETH / STONKSPAD (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today