ZethHook
EthereumZethHook is a Uniswap v4 hook on Ethereum. Live for 2 days. Busy: 1,154 trades in the last week, and 1 new pool this week.
- Contract name
- ZethHook
How this hook works
Trading taxA trading tax hook. It takes a cut of every trade, only lets approved callers create pools and holds trading back until it is opened.
Takes a cut of every trade
On top of the normal pool fee, it keeps a share of each trade. The fee is paid out in the same trade.
The code that does this (afterSwap):function _afterSwap(address sender, PoolKey calldata key, SwapParams calldata params, BalanceDelta delta, bytes calldata) internal override returns (bytes4, int128) { if (sender == buyback) return (this.afterSwap.selector, 0); bool unspecifiedIs1 = params.amountSpecified < 0 == params.zeroForOne; int128 amt = unspecifiedIs1 ? delta.amount1() : delta.amount0(); if (amt == 0) return (this.afterSwap.selector, 0); if (amt < 0) amt = -amt; uint256 f = feeAt(block.timestamp) - LP_FEE; uint256 fee = params.amountSpecified < 0 ? FullMath.mulDiv(uint128(amt), f, 1_000_000) : FullMath.mulDivRoundingUp(uint128(amt), f, 1_000_000 - f); if (fee == 0) return (this.afterSwap.selector, 0); poolManager.take(unspecifiedIs1 ? key.currency1 : key.currency0, feeTo(), fee); if (unspecifiedIs1) hookFee1 += fee; else hookFee0 += fee; return (this.afterSwap.selector, fee.toInt128()); }Only approved callers create pools
New pools with this hook can only be created by approved callers, for example its own factory or launcher.
The code that does this (beforeInitialize):function _beforeInitialize(address sender, PoolKey calldata key, uint160) internal override returns (bytes4) { if (sender != authorized) revert InvalidInitializer(sender, authorized); if (PoolId.unwrap(key.toId()) != PoolId.unwrap(poolId) || initTime != 0) revert WrongPool(); return this.beforeInitialize.selector; }No trading before the start
Trades are refused until trading has been opened.
The code that does this (beforeSwap):function _beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata hookData) internal override returns (bytes4, BeforeSwapDelta, uint24) { uint256 o = openedAt(); if (o == 0 || block.timestamp < o + 1) revert TooEarly(); _write(); return super._beforeSwap(sender, key, params, hookData); }
Who controls it: Nobody. The hook has no admin functions, and the code cannot be changed.
Based on the hook’s published code.What do these labels mean?
Safety report
Before you build on it. Automated checks, not an auditPaymentSplitter: nothing there can change how trades go.What it can do
Its code executes inside each trade in pools that use it.
It can take or add tokens during a swap. Fees, burns and custom curves work this way, and so do scams.
Pools using it let the hook choose the swap fee instead of a fixed tier.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Started 1 time
Counted from what the hook recorded on-chain across all its pools, for every action in its published code, plus token transfers in and out of it.