KlikHook on Ethereum

Uniswap v4 Hook Contract 0x1d06faa7ff674ccfd8a5736c0c0973cb0a8fa0cc on Ethereum · Dynamic fee · Verified contract

Volume (24h)
$0
Value locked (TVL)
$783
All-time volume
$0
Pools using this hook
81
Swaps (24h)
4 (2 traders)
Total swaps
2,731

What it does

KlikHook is a fee engine for klik.finance token pools paired against a chain's quote currency: it charges tiered, USD-market-cap-based fees on token buys, splits them between the platform and token creators, and adds a time-limited anti-snipe cap on buys right after launch.

How it works step by step

  • Blocks the first (launch) block of each pool from swapping by returning a zero fee, and on that block reverts buys during the launch lock window.
  • Reads the token's USD market cap from the launcher and maps it to a fee tier (1.00% down to 0.10%) with a platform/creator split per tier.
  • On exact-input buys of the token, takes the fee by minting ERC-6909 claims on the pair currency through beforeSwap, then redeems them into real pair on a later swap's beforeSwap.
  • Applies a per-origin (tx.origin) USD spend cap on buys during the first few blocks after pool initialization, unless an admin-armed launcher dev-buy flag is set in transient storage.
  • Accrues platform and creator shares; the platform share is pulled to the treasury and creator shares are pushed to the launcher, each with a best-effort transfer that falls back to recording the amount as owed.
  • Charges a fee on the unspecified side of swaps via afterSwap return delta, so the hook's fee claim is settled against the swap output.
Swap behaviour
Only swaps on pools whose currency1 is a registered klik token are affected. Buys with exact input are charged a tier fee via beforeSwap, and the hook can revert buys during the anti-snipe window. Exact-output sells revert with 'exactOutput sells not supported'. Other swaps pass through with zero deltas. An afterSwap fee is also taken on the unspecified side of the swap for qualifying buys and sells.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
The fee is set by a tiered schedule keyed to the token's USD market cap, with the default schedule running from 1.00% to 0.10% and owner-settable tiers capped at 1.25%. Zero fee applies in the pool's deployment block. Fees are split between platformTreasury and the token creator per tier. Claims are minted, not transferred, at swap time and redeemed later; fees are recorded as platformOwed or creatorOwed if a payout fails.
Owner & admin controls
The owner (set to tx.origin at deployment, transferable) can set the platform treasury, the launcher factory address, the anti-snipe parameters (enabled flag, window in blocks, USD cap), and replace the entire fee tier schedule up to 1.25% per tier. The owner cannot upgrade the contract or move pool funds directly. Anyone can call pullPlatformFees (only to the treasury) and pushCreatorFees (only to the factory). The factory can arm the dev-buy anti-snipe bypass. No pause function or upgrade mechanism is present in the ABI.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records the pool's deployment block, which drives the launch-block fee waiver and the anti-snipe window. beforeSwap mints fee claims, flushes earlier claims into real pair, enforces the anti-snipe cap, and charges the buy fee via a return delta. afterSwap charges the fee on the unspecified side via an afterSwap return delta.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: The owner key can raise all pools' fees by up to 1.25% per tier, redirect platform fee payouts, change the launcher factory that supplies market cap and creator data, and toggle or retune the anti-snipe rules that apply to every pool. Ownership is transferable with no timelock or multisig requirement shown in the source.

Risk to user funds: The hook holds pair and token balances through PoolManager ERC-6909 claims and owed mappings, and it moves funds only to the platform treasury, the launcher factory, or buyers via the swap's own deltas. It cannot block swaps for everyone through a payout failure, but an owner-set treasury or factory and the fee tier setting directly affect how much traders pay and where fees land.

Security findings

  • [medium] Owner can change fee tiers up to 1.25%: setFeeTiers lets the owner replace the schedule with any tiers whose totalBps is at most 125 (1.25%), applied to every token pool, so buyers' fees can be raised by up to 1.25% at the owner's discretion without a timelock. Note that the contract comment and MAX_FEE_BPS constant define this cap.
  • [medium] Owner can set the treasury and factory addresses: setPlatformTreasury and setFactory are owner-only with no timelock, so the owner can redirect platform fee payouts and point the hook at a different launcher, which controls market cap readings used for fee tiers and the armed dev-buy bypass.
  • [medium] Hook takes tokens through return deltas: beforeSwap and afterSwap return non-zero deltas, so the hook takes a share of swap amounts as fees on every qualifying swap. Fee amounts depend on the factory's market cap reading, which is an external dependency; a manipulated or stale factory value changes the fee charged.
  • [low] Anti-snipe cap keyed to tx.origin: The snipe cap tracks spend per tx.origin and is bypassable by using multiple origin addresses, while the cap value depends on the factory's stock price reading, so it is a soft limit rather than a hard guarantee.
  • [info] Fee payouts are best-effort with gas caps: Payouts use a fixed gas cap and fall back to recording amounts as owed on failure, so a blocklisted recipient cannot revert swaps; owed balances must be claimed manually via pullPlatformFees or pushCreatorFees.

Contract details

Verified source
Yes (KlikHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
10,031 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, mev-protection, moves-currency, ownable, return-delta, rewards

Pools using KlikHook