HukHook
EthereumHukHook is a Uniswap v4 hook on Ethereum. Live for 2 days. Still in use: 61 trades in the last week, and 1 new pool this week.
- Contract name
- HukHook
How this hook works
Buyback and burnA buyback and burn hook. It takes a tax on trades, manages its own liquidity and buys back the token.
Takes a tax on trades
On top of the normal pool fee, it keeps part of each trade as a tax. It can never be above 10%. The tax builds up in the hook until it is collected.
The code that does this (beforeSwap):function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata) external override onlyPoolManager returns (bytes4, BeforeSwapDelta, uint24) { if (sender == address(this)) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); bool specifiedIsEth = (params.amountSpecified < 0) == params.zeroForOne; if (!specifiedIsEth) return (IHooks.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0); uint256 base = params.amountSpecified < 0 ? uint256(-params.amountSpecified) : uint256(params.amountSpecified); (uint256 fee,) = _split(base, Currency.unwrap(key.currency1)); if (fee != 0) poolManager.mint(address(this), CurrencyLibrary.ADDRESS_ZERO.toId(), fee); return (IHooks.beforeSwap.selector, toBeforeSwapDelta(int128(uint128(fee)), 0), 0); }Manages its own liquidity
It adds and removes liquidity itself, so it can own part or all of the pool.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (Op op, bytes memory args) = abi.decode(data, (Op, bytes)); uint256 id = CurrencyLibrary.ADDRESS_ZERO.toId(); if (op == Op.Pay) { (address to, uint256 amount) = abi.decode(args, (address, uint256)); poolManager.burn(address(this), id, amount); poolManager.take(CurrencyLibrary.ADDRESS_ZERO, to, amount); return ""; } (address token, uint256 eth) = abi.decode(args, (address, uint256)); PoolKey memory key = IFactoryKeys(factory).poolKey(token); if (op == Op.Floor) { (, int24 tick,,) = poolManager.getSlot0(key.toId()); int24 lower = _ceil(tick + 1, key.tickSpacing); int24 upper = lower + FLOOR_BAND * key.tickSpacing; int24 maxTick = TickMath.maxUsableTick(key.tickSpacing); if (upper > maxTick) upper = maxTick; if (lower >= upper) revert Nothing(); uint128 liq = LiquidityAmounts.getLiquidityForAmount0( TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), eth ); if (liq == 0) revert Nothing(); (BalanceDelta d,) = poolManager.modifyLiquidity( key, ModifyLiquidityParams({tickLower: lower, tickUpper: upper, liquidityDelta: int256(uint256(liq)), salt: bytes32(0)}), "" ); uint256 owed = uint256(uint128(-d.amount0())); poolManager.burn(address(this), id, owed); // …Buys back the token
It uses what it collects to buy the token back.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (Op op, bytes memory args) = abi.decode(data, (Op, bytes)); uint256 id = CurrencyLibrary.ADDRESS_ZERO.toId(); if (op == Op.Pay) { (address to, uint256 amount) = abi.decode(args, (address, uint256)); poolManager.burn(address(this), id, amount); poolManager.take(CurrencyLibrary.ADDRESS_ZERO, to, amount); return ""; } (address token, uint256 eth) = abi.decode(args, (address, uint256)); PoolKey memory key = IFactoryKeys(factory).poolKey(token); if (op == Op.Floor) { (, int24 tick,,) = poolManager.getSlot0(key.toId()); int24 lower = _ceil(tick + 1, key.tickSpacing); int24 upper = lower + FLOOR_BAND * key.tickSpacing; int24 maxTick = TickMath.maxUsableTick(key.tickSpacing); if (upper > maxTick) upper = maxTick; if (lower >= upper) revert Nothing(); uint128 liq = LiquidityAmounts.getLiquidityForAmount0( TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), eth ); if (liq == 0) revert Nothing(); (BalanceDelta d,) = poolManager.modifyLiquidity( key, ModifyLiquidityParams({tickLower: lower, tickUpper: upper, liquidityDelta: int256(uint256(liq)), salt: bytes32(0)}), "" ); uint256 owed = uint256(uint128(-d.amount0())); poolManager.burn(address(this), id, owed); // …Burns tokens
It destroys some tokens (or sends them to an address nobody controls), so there are fewer of them.
The code that does this (unlockCallback):function unlockCallback(bytes calldata data) external onlyPoolManager returns (bytes memory) { (Op op, bytes memory args) = abi.decode(data, (Op, bytes)); uint256 id = CurrencyLibrary.ADDRESS_ZERO.toId(); if (op == Op.Pay) { (address to, uint256 amount) = abi.decode(args, (address, uint256)); poolManager.burn(address(this), id, amount); poolManager.take(CurrencyLibrary.ADDRESS_ZERO, to, amount); return ""; } (address token, uint256 eth) = abi.decode(args, (address, uint256)); PoolKey memory key = IFactoryKeys(factory).poolKey(token); if (op == Op.Floor) { (, int24 tick,,) = poolManager.getSlot0(key.toId()); int24 lower = _ceil(tick + 1, key.tickSpacing); int24 upper = lower + FLOOR_BAND * key.tickSpacing; int24 maxTick = TickMath.maxUsableTick(key.tickSpacing); if (upper > maxTick) upper = maxTick; if (lower >= upper) revert Nothing(); uint128 liq = LiquidityAmounts.getLiquidityForAmount0( TickMath.getSqrtPriceAtTick(lower), TickMath.getSqrtPriceAtTick(upper), eth ); if (liq == 0) revert Nothing(); (BalanceDelta d,) = poolManager.modifyLiquidity( key, ModifyLiquidityParams({tickLower: lower, tickUpper: upper, liquidityDelta: int256(uint256(liq)), salt: bytes32(0)}), "" ); uint256 owed = uint256(uint128(-d.amount0())); poolManager.burn(address(this), id, owed); // …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, uint160) external view override onlyPoolManager returns (bytes4) { if (sender != factory) revert NotFactory(); return IHooks.beforeInitialize.selector; }Anyone can trigger payouts
Anyone can trigger a buyback, so nobody has to wait on the hook developer.
The code that does this (buyback):function buyback(address token) external { uint256 eth = IRulesFee(rules).takeBuybackBudget(token); if (eth < BUYBACK_MIN) revert Nothing(); poolManager.unlock(abi.encode(Op.Buyback, abi.encode(token, eth))); }
Who controls it: The hook developer can change which launcher it works with. The hook developer can withdraw funds held by the hook. Control can be passed on or given up. 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 auditWhat 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.
It runs when a pool is created, often to lock in that pool’s settings.
Hook history
- Handled a trade 61 times
Latest transactions
- 0x7818ff01…562ae2 block 26,465,542 · 0.0000300 HUK
- 0x16b0b436…f30901 block 26,465,184 · 0.000591 HUK
- 0x7d9b7456…862e53 block 26,465,180 · 0.0000646 HUK
- 0x4597067c…7bd1b3 block 26,465,176 · 0.00198 HUK
- 0xf9e15c3b…7bd921 block 26,465,170 · 0.0000693 HUK
- 0x58fc7a45…2bc7be block 26,465,166 · 0.0000118 HUK
- 0x92d16384…97923d block 26,465,159 · 0.0000990 HUK
- 0x0d4887ab…f4e08a block 26,465,158 · 0.0000296 HUK
- 0x3001aa37…20f049 block 26,465,155 · 0.00000419 HUK
- 0x209ebdda…608c6b block 26,465,151 · 0.00000506 HUK
- Sent on a treasury 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.