Each public function on Kairo's contracts: who can call it, what it checks, how it reverts, the structs it returns and the maths behind the figures the app displays.
ABIs are generated by the contracts build into web/src/contracts/abis.ts (see Integration guide). Types in the tables are ABI types: pools are bytes32 ids, enums are uint8, and structs are tuples whose fields are listed under Stage codes and structs. All reverts use custom errors, listed next to each contract. For events, see Indexing events.
Units and encodings
Quantity
Encoding
Notes
Fees in pips
1,000,000
= 100%. Always applied to the quote side of a trade.
Supply
1e9 · 1e10 · 1e11 · 1e12
Whole tokens; any integer from 1e9 to 1e15 is allowed. 18 decimals. The full supply is minted to the hook and seeded at launch.
Prices
sqrtPriceX96 · tick
Standard Uniswap v4. spotPriceX96(poolId) and the TWAP are Q96 values: quote units per token unit.
Pools
bytes32 poolId
keccak256 of the PoolKey: currency0, currency1, fee 0x800000, tickSpacing 200, hook.
Native HYPE
address(0)
Used anywhere a quote or asset address is expected.
One wallet owns Kairo's contracts: the Kairo Owner wallet (0xd3BC96a1A0Bec772893698CC9de4cf5c1B5c39ab). It has accepted ownership (Ownable2Step) of the v4 factory, the fee vault, the quote registry and the airdrop, and it is also the guardian of each. There is no multisig or timelock today, so an owner call takes effect as soon as its transaction lands. The rows marked “Owner” or “Guardian” in the tables below are everything it can do. Ownership moves in two steps: transferOwnership(next) nominates, acceptOwnership() (calldata 0x79ba5097) completes, and pendingOwner() shows the nominee. The hook, router, lens, tokens, splitters and buyback adapters have no owner at all.
New launches only. Lines on the tick spacing, 13,800–69,000 ticks (graduation may be 0), LP line above graduation, hold 600 s – 1 day; launch fee ≤ maxLaunchFee.
A single hook is attached to every Kairo pool and rejects any pool the factory didn't register. It owns each seed position, charges the fee inside the swap through return deltas (so all quoters agree), records who is owed what, tracks each pool's stage, and keeps its price history.
Fee maths (h = current rate − current LP fee)
exact-in buy fee = ceil(in · h / 1e6) taken off the quote paid in
exact-in sell fee = ceil(gross · h / 1e6) taken off the quote paid out
exact-out buy fee = ceil(net · h / (1e6 − h)) added to the quote paid in
exact-out sell fee = ceil(out · h / (1e6 − h)) added to what the pool pays out
protocol = floor(leg · protocolPips / 1e6) creator side = fee − protocol
all-in = h + lp − h·lp/1e6 (lens effectiveTotalFee)
Progress to each line in bps: the share of the quote needed to reach it that the seed has already taken in (10,000 once crossed); and seconds held out of 600.
Each launch is a clone of the token master: an ordinary ERC-20 without an owner, later minting, transfer tax or pause. The hook receives the entire supply at launch. Holder rewards are tracked by a ledger inside the token, and the PoolManager and hook never earn from it.
KairoV4Token functions
Function
Caller
Effect
transfer · transferFrom · approve · burn(uint256)
Holders
Standard ERC-20; anyone may burn their own.
distribute() returns (uint256)
Anyone
Pulls what the hook owes a holders-route token and starts it streaming over 60 minutes.
claimRewards() · claimRewards(address to)
A holder
Takes what it has earned. to can't be 0, 0x…0001, 0x…dEaD, the token, the hook or the PoolManager (RefusedTarget).
Scanner getters, never a transfer tax: what a buy pays now (anti-snipe included) and the pool's fee, in bps rounded up; taxBps equals sellTaxRate; taxRatePips is the fee in pips. A transfer between wallets pays nothing.
Every pool’s protocol share reaches the vault through the hook’s sweep(poolId) and collectProtocol(currency). Native coin and KAIRO are split into a buyback lane and a treasury lane while the buyback is on (wholly treasury while it’s off); every other ERC-20 goes wholly to treasury, for the owner to convert by hand. The vault never swaps anything but HYPE for KAIRO. What it buys is burned at 0x…dEaD unless the owner sets a list of buyback wallets; then the wallets are filled in order, each up to recipientCapBps (2%) of KAIRO’s total supply by balance, and a buy they can’t take whole reverts with RecipientsFull. The owner (the Kairo Owner wallet, which is also the guardian) switches the buyback on and off; it can only be switched on once KAIRO's pool is set.
ProtocolFeeVault functions
Function
Caller
Effect
receiveProtocol() payable
Anyone (the hook, the factory)
Native deposit, split into the lanes at once.
sync(address asset)
Anyone
Attributes an asset that arrived another way (ERC-20 sweeps, donations).
Buys KAIRO in its pool within the guards below and hands it out in the same call: to 0x…dEaD with no wallets set, else into the buyback wallets in order (one BuybackDelivered per wallet). burned is the amount bought either way. RecipientsFull if the wallets can’t take it all.
releasePlatformLane() returns (uint256 amount)
Anyone
Sends the KAIRO buyback lane (KAIRO received as fees) the same way: burned at 0x…dEaD with no wallets, else filled into the buyback wallets in order (one PlatformLaneReleased per wallet).
withdrawTreasury(address to, uint256 amount) · withdrawTreasuryToken(address asset, address to, uint256 amount)
Owner
Treasury lane only, never the buyback lane. InsufficientTreasury past it.
Append a factory; name KAIRO’s pool (on v4, its KairoV4BuybackPool adapter), which that factory must know.
enableBuyback() · disableBuyback()
Guardian or owner
Switch the buyback on or off, instantly, any number of times. Needs a KAIRO pool to switch on. While off, new fees go 100% to treasury; the buyback lane keeps what it holds.
setGuardian(address)
Owner
Who may flip the switch besides the owner (the Kairo Owner wallet itself).
setBuybackRecipients(address[] list)
Owner
Replaces the list of buyback wallets, in fill order. Empty (the default) = burn at 0x…dEaD. At most 50 (MAX_RECIPIENTS); each not 0, not the vault, not 0x…dEaD, no repeats (BadRecipient).
setRecipientCapBps(uint16 bps)
Owner
Most each wallet is filled to, in bps of KAIRO’s total supply: 1 – 10,000, default 200 (2%).
The list; where the next buy goes (0x…dEaD when burning, the first wallet with room, 0 when every wallet is full); KAIRO the wallets can still take (max uint256 with no list or no KAIRO pool); the cap.
Sets a season’s root; claims open rootDelay later (24 h in production, at most 7 days) and run for the window (90–730 days). A root can be replaced only before it opens.
Each pool carries a single stage code in hook.poolConfig(poolId).stage, mirrored in lens.tokenView(token).config.stage. Every transition emits StageChanged.
Stage codes
Code
Name
Meaning
0
Below
Price has not reached the graduation line.
1
Crossed
A swap pushed the price over the graduation line. Any swap in a later transaction makes graduation final; a sale inside that same transaction is the only way back to 0.
2
Graduated
Permanent. Emits Graduated(poolId, timestamp) one time. A launch with graduationTicks = 0 starts at 2 and emits nothing.
3
Past the LP line
The hold clock runs: lpHeldSeconds + (now − lpCrossedAt). Dropping back below returns the pool to 2 without resetting the time already held.
4
LP fee on
Permanent. Emits LpFeeActivated(poolId, lpFee). The swap that completes the hold already pays the LP fee.