Dynamic fee hook on Ink
Uniswap v4 Hook Contract 0xa8bab3e9b164a22fa693cf050f59bd38c05380cc on Ink · Dynamic fee
- Volume (24h)
- $3.88
- Value locked (TVL)
- <$0.01
- All-time volume
- $3.88
- Pools using this hook
- 1
- Swaps (24h)
- 2 (1 traders)
- Total swaps
- 2
What it does
Charges a configurable buy or sell tax on swaps in this pool, accrues the tax in the hook, and lets a fixed tax recipient claim it.
How it works step by step
- Applies a buy tax and a sell tax in basis points on swaps, read from buyTaxBps and sellTaxBps
- Caps tax rates with MAX_TAX_BPS
- Collects the tax through beforeSwapReturnDelta and afterSwapReturnDelta
- Accumulates collected tax, readable via accruedFees
- Transfers accrued fees to taxRecipient through claim
- Uses unlockCallback to settle balances with the PoolManager
- Swap behaviour
- beforeSwap and afterSwap run on every swap; the hook takes a buy or sell tax through return deltas and records it as accrued fees.
- Liquidity behaviour
- No liquidity callbacks are enabled, so liquidity additions and removals are not modified by the hook.
- Fee behaviour
- Charges a buy tax and a sell tax expressed in basis points (buyTaxBps, sellTaxBps, capped by MAX_TAX_BPS). The tax is taken from swaps via return deltas and accrued, with the accrued amount readable through accruedFees and claimable by taxRecipient through claim.
- Owner & admin controls
- No admin controls found. No owner, pause or upgrade selectors were dispatched; tax parameters (buyTaxBps, sellTaxBps, MAX_TAX_BPS) and taxRecipient are exposed as views, and no setter selector was decoded, so parameters appear immutable or set at deployment.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeSwap: runs before each swap to compute the tax. afterSwap: finalises tax accounting after each swap. beforeSwapReturnDelta: lets the hook take a share of the swap input or output, which is how the tax is collected. afterSwapReturnDelta: lets the hook take an additional delta after the swap, also used for tax collection.
Security & trust assessment
Risk level: low (decoded bytecode, medium confidence).
Who controls it: A taxRecipient address receives accrued tax. Tax rates are view-only in the decoded selectors, so no key was found that can change them, but the recipient address is fixed in state and can claim all accrued fees.
Risk to user funds: The hook can hold accrued tax tokens and move them to taxRecipient via claim. It takes a portion of each swap's delta, so traders pay the buy or sell tax. It does not appear to block swaps or hold LP principal, and no pause or blocking selector was found.
Security findings
- [info] Hook takes swap deltas: The hook uses beforeSwapReturnDelta and afterSwapReturnDelta, so it takes tokens from swaps and holds accrued fees in its own balance until claim is called.
- [low] Claim flow access unclear: claim() is a public nonpayable function that transfers accrued fees to taxRecipient. Its access control could not be confirmed from bytecode alone, so it may be callable by anyone, which is benign as the destination is fixed.
- [low] Self-unlock accounting path: The hook calls unlock and take on the PoolManager through unlockCallback (self-unlock), which is a standard pattern but means the hook's accounting path is complex.
Contract details
- Verified source
- No
- Bytecode size
- 5,018 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, return-delta, self-unlock
Pools using Dynamic fee hook
- ETH / NIGGERJEFF (0.30% fee) — 24h volume $3.88, TVL <$0.01, 2 swaps today