UniversalKlikHook on Ethereum

Uniswap v4 Hook Contract 0xba806a6135c5cd93ecce1258c28f57a8d291e0cc on Ethereum · Fee sharing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$5.97K
All-time volume
$3.82M
Pools using this hook
248
Swaps (24h)
0 (0 traders)
Total swaps
18,510

What it does

Charges a tiered ETH-side fee on buys and sells of a token paired with ETH in its pool, then splits the collected ETH between a platform treasury and the token contract (creator), with the fee rate set by the token's market cap read from a configurable factory.

How it works step by step

  • Identifies the ETH/token pool (either currency being address zero) and skips pools that do not pair ETH with one other token.
  • Charges no fee in the pool's initialization block (recorded per pool in beforeInitialize), then applies fees in later blocks.
  • Reads market cap from the configured factory via getMarketCap and maps it to a total fee of 0.35% to 1.25% across 17 tiers. If no factory is set, a fixed 1% fee applies.
  • Taking the fee on buys in beforeSwap and on sells in afterSwap, using poolManager.take to move ETH into the hook, then pays out a platform share (to platformTreasury) and the remainder to the token contract address.
  • Splits the fee by platformBps and totalBps; if no treasury is set or platformBps is zero, the full fee goes to the token contract.
Swap behaviour
On buys (ETH in), beforeSwap computes a fee on the absolute value of amountSpecified, takes that ETH into the hook and returns it as a specified-currency delta. On sells (ETH out), afterSwap computes a fee on the ETH side of the balance delta, takes it and returns it as an unspecified-currency delta. Both directions then distribute the ETH via _distributeFee. Pools without ETH, or with a zero fee at that moment, pass through unchanged.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Total fee is set by getFeeTier from factory-reported market cap (0.35% to 1.25%), or 1% if no factory is set, and 0 in the initialization block. Buys are charged in beforeSwap and sells in afterSwap, both in ETH. The fee is split between platformTreasury (platformBps share) and the token contract (remainder). Platform sends are unchecked, so a failed send leaves ETH in the hook; creator sends revert the swap on failure.
Owner & admin controls
The owner (set to tx.origin at deployment, transferable in one step with transferOwnership) can set platformTreasury, set the factory that determines the fee tier, withdraw the hook's entire ETH balance via rescueETH, and transfer ownership. There is no pause, no upgrade mechanism and no timelock found in the source.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records the pool's deployment block so the launch block is fee-free. beforeSwap takes the buy-side fee and returns it as a specified delta. afterSwap takes the sell-side fee and returns it as an unspecified delta. beforeSwapReturnDelta and afterSwapReturnDelta are required so the hook can take fees through the returned deltas.

Security & trust assessment

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

Who controls it: A single owner key can redirect all platform fee revenue, change the fee tier through the factory address, drain any ETH held by the hook and reassign ownership instantly. Users cannot see or react to these changes before they take effect.

Risk to user funds: The hook takes ETH from swaps in its pool and holds it briefly before distributing it, and it can hold ETH when platform sends fail. Users' swap value is not held by the hook beyond the fee. The owner can withdraw any ETH the hook holds. The token contract can block swaps through a reverting receive.

Security findings

  • [medium] Owner controls fee tier source and fee recipient: setFactory changes which contract supplies market cap, so the owner can move the total fee anywhere between 0.35% and 1.25% (or to the 1% fallback by clearing it). setPlatformTreasury redirects the platform share of every fee to any address immediately, with no delay.
  • [medium] Owner can drain accumulated ETH: rescueETH sends the hook's entire ETH balance to any address the owner chooses. The balance includes fees whose platform transfer failed and any ETH sent through the open receive() function.
  • [medium] Creator transfer can revert swaps: The creator share is sent to the token contract with a require, so a token contract that rejects ETH or reverts on receive will make every buy and sell in that pool revert. The call also forwards all gas to an external contract while the pool manager is unlocked, and there is no reentrancy guard.
  • [medium] Fee amount is computed in ETH but applied to the specified currency: beforeSwap takes the fee from |amountSpecified| and returns it as a specified delta, but the specified currency is only ETH on exact-input buys. On exact-output buys the specified currency is the token, so the delta and the ETH take may not match. This could cause accounting errors or reverts, and this was not tested.
  • [low] Single-step ownership transfer: transferOwnership is effective immediately and no two-step acceptance is used, so a wrong address loses admin control permanently.

Contract details

Verified source
Yes (UniversalKlikHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
5,383 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta, rewards

Pools using UniversalKlikHook