Fee sharing hook on Ink
Uniswap v4 Hook Contract 0x17c97bce789d7028c6680b2a230546dbc7ec20cc on Ink · Fee sharing
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 4
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
The hook takes a fee share from swaps through return deltas and forwards it to a per-pool fee recipient, so swappers pay that fee on the trades it charges while liquidity operations are unaffected.
How it works step by step
- Registers pools through registerPool, storing a fee recipient for each pool id in a per-pool mapping
- Counts buys and charges per pool in beforeSwap/afterSwap, tracked in mappings readable through buyCount and chargeCount
- Takes a fee on swaps via the take call to the pool manager and records accumulated amounts per pool in feesTaken
- Uses return-delta permissions so the hook can adjust the swap's currency deltas and capture a share of the swap
- Routes captured fees to the registered feeRecipient, with FEE_BPS and BPS constants setting the rate
- Owner can set the factory address and transfer ownership
- Swap behaviour
- beforeSwap and afterSwap run on every swap; the hook takes a fee share through return deltas and the pool manager take call, so swappers receive slightly less output or pay slightly more input, with the exact direction per trade depending on which side the hook captures, which cannot be fully confirmed from decoded bytecode.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity exist as selectors but appear to be pass-through; no clear fee or delta logic was identified there.
- Fee behaviour
- A hook-level fee of FEE_BPS basis points (out of BPS) is taken on swaps and forwarded to the pool's feeRecipient; the exact rate and which swaps are charged could not be confirmed without source.
- Owner & admin controls
- An owner (stored in slot 0) can transfer ownership and set the factory address; the owner can also gate privileged functions with NotOwner checks. No pause or upgrade mechanism was identified in the decoded bytecode.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize and afterInitialize register pool state; beforeSwap and afterSwap run fee accounting and counters; beforeSwapReturnDelta and afterSwapReturnDelta let the hook claim a portion of swap deltas; liquidity and donate callbacks are present but do not appear to modify flows.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner key can change ownership and the factory address; any fee or recipient parameter controlled by the owner would let that key redirect captured fees.
Risk to user funds: The hook takes a portion of swap currency via return deltas and the pool manager take call and holds accounting for fees, so users' swap proceeds are exposed to that fee capture.
Security findings
- [medium] Return-delta fee capture: The hook takes currency through return deltas and the take call on every swap, so a change to the fee rate or recipient directly alters user outputs.
- [low] Owner-controlled factory and ownership: setFactory and transferOwnership are callable by the owner, so a compromised owner key could redirect the factory or take over the hook.
- [info] No source verification: Behaviour is inferred from decoded bytecode only, so exact fee math and edge cases are not confirmed.
Contract details
- Verified source
- No
- Bytecode size
- 3,636 bytes
- Upgradeable proxy
- No
- Detected patterns
- fee-sharing, moves-currency, ownable, return-delta
Pools using Fee sharing hook
- ETH / PIRATES (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / INKCATS (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / SPACINK (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ETH / TEST (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today