DirectAnyHook on Ethereum
Uniswap v4 Hook Contract 0xcba49142a75da64a679f32a159f4316f11a7e0cc on Ethereum · Fee sharing · Verified contract
- Volume (24h)
- $17.31K
- Value locked (TVL)
- $37.22K
- All-time volume
- $6.00M
- Pools using this hook
- 234
- Swaps (24h)
- 85 (40 traders)
- Total swaps
- 31,619
What it does
A Uniswap v4 hook for klik.finance tokens paired against any currency that charges a flat 1% fee on every buy and sell of the token, splitting the fee between a protocol share and the token creator or token holders, with a short anti-snipe cap on buys in the first few blocks.
How it works step by step
- Charges a fixed 1% fee (FEE_BPS = 100) on the pair-side amount of every buy with exact input and every sell with exact output, taken via beforeSwap or afterSwap return deltas.
- Mints the fee as ERC-6909 claims held by the hook, which are later redeemed into real pair tokens during a bounded self-call inside a later swap or a permissionless flushFees call.
- Splits accrued fees: a protocol share starting at 35% (protocolFeeBps, capped at 50%) goes to platform balances, and the remainder goes to creatorOwed or, if dividends are enabled for the token, to holder dividends.
- Enables dividends for a token only once, irreversibly, through the factory; after that, sell fees are parked and assigned to holders on the next buy in a later block.
- Applies a global anti-snipe window: buys in the first antiSnipeBlocks (default 3) after pool initialization are capped per tx.origin in USD (default 500 USD), and the launch block itself reverts for non-armed buys.
- Swap behaviour
- Buys (zeroForOne, exact input) take the 1% fee in the pair currency through beforeSwap and mint a claim; sells and exact-output buys are handled in afterSwap with the fee taken from the pair delta. Exact-output sells are rejected in beforeSwap, and non-canonical pools pass through untouched. Each swap also attempts a bounded self-call to redeem claims and forward owed fees.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- A fixed 1% of the pair side on every swap, with no tiers. Zero fee in the pool's deployment block. The protocol share defaults to 35% and can be set by the original protocolFeeController up to 50%. Remaining fee goes to creatorOwed or holder dividends depending on the token's dividendsEnabled flag.
- Owner & admin controls
- owner (initially the constructor controller, transferable) can set the platform treasury, set anti-snipe enabled flag, block count and USD cap, and transfer ownership. setFactory is one-time. setProtocolFeeBps is restricted to protocolFeeController, which is fixed at deployment and set to the same address as the initial owner, and is capped at 50%. Dividend enabling is restricted to the factory. There is no pause function and no upgrade mechanism visible in the ABI.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize checks the initializer is the factory and records the deployment block. beforeSwap takes the fee on buy exact-input swaps and runs anti-snipe logic. afterSwap takes the fee on the pair leg for sells and exact-output buys. beforeSwapReturnDelta and afterSwapReturnDelta let the hook claim the fee amount from the swap delta.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can disable or retune the anti-snipe cap and transfer ownership, and the fixed protocol-fee controller can set the platform split up to 50% for future fees. The factory controls dividend activation and pool identity. No function found lets the owner move user funds directly or pause swaps.
Risk to user funds: The hook holds minted ERC-6909 claims and owed pair balances on behalf of the protocol and creators/holders, and it transfers pair tokens to the treasury, factory, or token contract through pullPlatformFees, pushCreatorFees, pushDividendFees and flushFees. Swaps are taken with a fixed 1% fee on the pair side, and the hook does not hold LP positions.
Security findings
- [info] Hook takes fee through return deltas: beforeSwap and afterSwap return deltas take 1% of the pair side on buys and sells, so traders pay a fixed fee on every swap in the pool.
- [medium] Fee and claims are held by the hook: Fees are minted as ERC-6909 claims and held in the hook until redeemed, with redemption and payout relying on the external factory, pair currency, and token contracts; a malicious or paused pair currency can leave owed balances stuck, although failures are isolated by try/catch.
- [medium] Owner controls anti-snipe and can change the protocol split: The owner can change antiSnipeEnabled, antiSnipeBlocks and maxSnipeUsdE8 at any time, and the controller can raise protocolFeeBps up to 50%, which shifts how fees are split between platform and creator or holders for future fees.
- [medium] Dependency on factory for pricing and token identity: The snipe cap uses pairPrice from the factory via staticcall, and pool validity depends on factory.isKlikToken and poolCurrencyOf; a compromised or misconfigured factory could mislabel pools or distort anti-snipe limits.
- [low] Dividend mode can revert swaps on gas shortfall: In dividend mode _flushClaims reverts the swap if gasleft is below AUTO_MAINTENANCE_GAS plus SWAP_GAS_RESERVE, so callers with low gas limits can have trades fail when claims are pending.
Contract details
- Verified source
- Yes (DirectAnyHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 14,077 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, mev-protection, moves-currency, ownable, return-delta, rewards, self-unlock
Pools using DirectAnyHook
- WPRL / 🦪 (0.00% fee) — 24h volume $17.03K, TVL $22.33K, 67 swaps today
- ETH / trap (0.00% fee) — 24h volume $104, TVL $318, 1 swaps today
- ETH / GLOSSARY (0.00% fee) — 24h volume $51, TVL $63, 1 swaps today
- ETH / ENTERPRISE (0.00% fee) — 24h volume $48, TVL $0, 2 swaps today
- QNT / QPEPE (0.00% fee) — 24h volume $43, TVL $1.59K, 2 swaps today
- QNT / QCAT (0.00% fee) — 24h volume $29, TVL $420, 2 swaps today
- QNT / QCAT (0.00% fee) — 24h volume $4.83, TVL $1.25K, 2 swaps today
- Neiro / Kumakichi (0.00% fee) — 24h volume $0, TVL $0, 4 swaps today
- KLIK / Asteroid (0.00% fee) — 24h volume $0, TVL $0, 4 swaps today
- QNT / QCAT (0.00% fee) — 24h volume $0, TVL $586, 0 swaps today
- QNT / QCAT (0.00% fee) — 24h volume $0, TVL $748, 0 swaps today
- QNT / OCM (0.00% fee) — 24h volume $0, TVL $186, 0 swaps today
- QNT / Quamfy (0.00% fee) — 24h volume $0, TVL $1.78K, 0 swaps today
- QNT / OCM (0.00% fee) — 24h volume $0, TVL $545, 0 swaps today
- QNT / 1 (0.00% fee) — 24h volume $0, TVL $611, 0 swaps today
- QNT / QI (0.00% fee) — 24h volume $0, TVL $74, 0 swaps today
- SHFL / ALLINU (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- UNI / PAWSINU (0.00% fee) — 24h volume $0, TVL $1.30K, 0 swaps today
- QNT / Dinger (0.00% fee) — 24h volume $0, TVL $61, 0 swaps today
- UNI / PAWSINU (0.00% fee) — 24h volume $0, TVL $729, 0 swaps today