Fee sharing hook on Ink
Uniswap v4 Hook Contract 0x26b86c03bd6576b8661d53a48d70faf8c85b8044 on Ink · Fee sharing
- Volume (24h)
- $689
- Value locked (TVL)
- $254
- All-time volume
- $35.96K
- Pools using this hook
- 8
- Swaps (24h)
- 6,044 (83 traders)
- Total swaps
- 210,942
What it does
A Uniswap v4 hook that runs after each swap and can take a cut of the swap's output token, with the take recorded as a return delta so the pool and hook settle the difference, and that also tracks per-user or per-epoch balances in storage.
How it works step by step
- Runs logic only after a swap completes, using the swap's delta and amounts passed to the callback
- Calls the pool manager's take function to move a currency out of the pool to the hook or a recipient
- Returns a non-zero after-swap delta, which lets the hook adjust the amount the swapper receives
- Updates storage mappings keyed by a uint256 id and by address, consistent with per-user or per-position accounting
- Stores a fee-collector address and a hook fee in basis points, with a BPS denominator constant for calculating the cut
- Has a reentrancy guard and a restriction so only the pool manager can call the callbacks
- Swap behaviour
- After each swap, the hook reads the swap parameters and output amounts, computes a fee in basis points against the output currency, takes that amount from the pool through the pool manager, and returns an after-swap delta so the swapper receives the reduced amount.
- Liquidity behaviour
- Before and after liquidity add and remove calls the hook runs callbacks that are present in the dispatch table, but the decoded logic does not show clear per-liquidity accounting beyond what the storage layout suggests. Treat liquidity handling as uncertain.
- Fee behaviour
- The hook takes a share of swap output as a fee in basis points (TOTAL_HOOK_FEE_BPS), split or forwarded to a liquidity fee collector. The pool's static fee is separate.
- Owner & admin controls
- The decoded functions show a registry() getter, a liquidityFeeCollector() getter, and several nonpayable setter-like selectors (0xb78e8498, 0xd415e901) that write to storage keyed by uint8 and address. Who can call these is not determinable without source, so there may be an owner or registry-based restriction. No explicit owner, pause or upgrade function was identified.
Enabled Uniswap v4 callbacks
afterSwap, afterSwapReturnDelta
afterSwap runs the fee logic and token take after each swap. afterSwapReturnDelta lets the hook change the amount the swapper receives, which is how the fee is taken from the trade.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: A privileged key may be able to change the hook fee rate and the fee collector address through the nonpayable setters. It could then extract a larger share of swap output or redirect collected fees. The exact permission model cannot be confirmed without source.
Risk to user funds: The hook can take a portion of swap output currency out of the pool and can alter the amount swappers receive via the return delta. It does not appear to hold a long-term custody balance, but it moves user-facing value on every swap.
Security findings
- [medium] Return delta takes tokens from swaps: afterSwapReturnDelta lets the hook modify the swapper's received amount and take currency from the pool. The fee rate is set by TOTAL_HOOK_FEE_BPS and any adjustable fee setting, so a privileged setter could raise the take on existing pools.
- [medium] Nonpayable setters with unknown access control: Selectors 0xb78e8498, 0xd415e901 are nonpayable and write storage in slots that the swap path also reads. Without source, it is not confirmed that only an authorized address can call them.
- [low] Fee collector destination is configurable: liquidityFeeCollector() exposes a destination for taken fees. If the setter that controls it is unrestricted or weakly restricted, collected fees could be redirected.
- [info] Unverified source: No verified source is available, so the exact access checks, fee bounds and reentrancy behaviour are inferred from bytecode selectors and storage only.
- [info] Standard v4 guards present: OnlyPoolManager and ReentrancyGuardReentrantCall errors appear in the bytecode, which suggests the callbacks are restricted to the pool manager and protected against reentrancy.
Contract details
- Verified source
- No
- Bytecode size
- 4,991 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, return-delta
Pools using Fee sharing hook
- wAAPLx / USDG (0.00% fee) — 24h volume $90, TVL $32, 739 swaps today
- wMSTRx / USDG (0.00% fee) — 24h volume $86, TVL $32, 744 swaps today
- wPLTRx / USDG (0.00% fee) — 24h volume $86, TVL $33, 761 swaps today
- wTSLAx / USDG (0.00% fee) — 24h volume $86, TVL $32, 780 swaps today
- wSPCXx / USDG (0.00% fee) — 24h volume $86, TVL $31, 773 swaps today
- USDG / wSPYx (0.00% fee) — 24h volume $85, TVL $32, 754 swaps today
- wNFLXx / USDG (0.00% fee) — 24h volume $85, TVL $30, 745 swaps today
- wNVDAx / USDG (0.00% fee) — 24h volume $85, TVL $32, 748 swaps today