Skip to content

Uniswap V4 pools ​

A graduated launch trades as an ordinary Uniswap V4 pool holding the token and ETH. Any V4-aware router or aggregator can trade it without integrating Hanok.

Pool key ​

Everything needed to build the key is on the launch record, or call HanokHook.poolKeyOf(token):

ts
const key = {
  currency0: "0x0000000000000000000000000000000000000000", // ETH is always currency0
  currency1: token,
  fee: 0,                 // the hook charges the fee, not the pool
  tickSpacing: 60,        // from the launch config
  hooks: hanokHook,
};

poolId = keccak256(abi.encode(key)), also stored as launchOf(token).poolId.

What the hook does ​

HanokHook implements beforeInitialize, beforeSwap and afterSwap:

  • Initialization is only accepted from the Hanok locker, so no foreign pool can attach itself to Hanok's fee accounting.
  • Every swap pays the platform fee and the creator tax on the ETH side, at the same rates the curve charged. When ETH is the specified currency (exact-in buy, exact-out sell) the charge is taken in beforeSwap; otherwise in afterSwap. Charges are held as ERC-6909 claims on the PoolManager and never move tokens during a swap.
  • Pass abi.encode(referrer) as hookData to attribute a referral.

The hook does not gate trading, restrict swappers, or tax token transfers.

Sweeping pool fees ​

solidity
function sweep(bytes32 poolId, uint256 minBuybackTokens) external;
function flushReferral(address referrer, address asset) external returns (uint256);
function accrued(bytes32 poolId) external view returns (uint128 protocol, uint128 creator, uint128 buyback);

sweep is permissionless for the protocol and creator legs. The buyback leg executes only when the fee operator calls with a non-zero minBuybackTokens, bounded by the launch's price-impact limit; a buyback that cannot execute within the limit pays its ETH to the creator instead.

The position ​

The locker mints one full-range position through PoolManager.modifyLiquidity and keeps it. Read it with HanokLiquidityLocker.positions(token).

Hanok is unaudited testnet software. Tokens can lose all value.