API reference
Every function, struct, event and error on the hook, with who may call what.
The complete external surface of IGlueHook — every function with who may call it, the structs, the events and the errors. The interface source is IGlueHook.sol.
Launch & pot configuration
The whole launch in one transaction: initializes the pool (the caller becomes the pot admin), declares the roles and creates the seeded LP program — same validation, events and funding rules as the standalone entries. (0,0) ticks = full range; ERC20 sides settle from the caller's allowance, a native side (if the pool has one) via msg.value with excess refunded.
Declares the roles; the key's other currency becomes secondary automatically. Until this runs the hook is passive on the pool. A native main rejects burn intent (address(0) recipient).
Moves the delivery target. address(0) = burn (ERC20 main only); anything else is a literal target.
Funds the pot in its SECONDARY currency. Native: amount == msg.value. ERC20: approve first; the credit is the measured balance delta (fee-on-transfer safe). Irreversible.
Retries a delivery the pot's live recipient refused; pays the pot's current recipient. Reverts if nothing is parked, the pot moved to burn intent, or the recipient refuses again (the park stays intact).
LP program — liquidity
Creates the program with everything off: zero shares, recipients defaulting to the owner, auto-harvest disarmed. The owner must be live here (the defaults point at it). Tick range fixed forever; (0,0) = full range.
Creates the program with full rules at creation. owner == address(0) ships it surrendered at birth: frozen rules, locked liquidity, public harvest.
Grows the position. Harvests pending fees first, then settles pure principal from the caller.
Shrinks the position; principal goes to to. Harvests first. A live owner can always withdraw; an ownerless program is locked forever.
LP program — rules & harvest
Replaces the split rules — the LP fee shares AND the buyback split; validated like the advanced entry. Shapes future harvests and buybacks only — the standing carry keeps retrying under the new rules.
Moves the settings role. address(0) freezes the rules forever without touching the owner's property. No way back.
Moves the property; the operator role does not travel with it. address(0) locks the liquidity forever and forces the manual harvest public.
Collects the program's fees and runs the split with the caller's full gas — the same path the auto-harvest runs. The natural entry for heavy tokens.
Pulls everything booked to the caller in asset after refused pushes. Full-gas, reverting delivery.
Views
Structs
Events
Errors
| error | meaning |
|---|---|
NotAllowed() | the caller may not perform this action |
Reentrancy() | a reentrant call was blocked |
PotNotReady() | initPot has not run yet |
PotAlreadyReady() | the pot or the program already exists — both are one-shot |
BadRoles() | main is not one of the pool's currencies, or the recipient is unusable |
BadDonation() | attached value doesn't match the declared donation |
QuoteMismatch() | a quote and its execution disagreed; the operation was abandoned |
BadConfig() | share sums above 100%, burn share on a native main, a payable leg without a live recipient, or a malformed liquidity request |
FAQ
Which functions mutate and which are free views?+
Mutating: launchPool, initPot, addLiquidity(+Advanced), addProgramLiquidity, removeLiquidity, harvest, donate, claim, flushDirect and the setters. Views: potOf, programOf, quotePump, quoteShield, owedOf, parkedOf, heldOf, obligationOf and friends.
Who may call what?+
Trading paths and donations: anyone. harvest: owner (public after surrender). Liquidity: owner. setProgramConfig: operator. setRecipient: pot admin. claim: the booked recipient. flushDirect: anyone.
What units do the shares use?+
WAD — 1e18 = 100%. All amounts elsewhere are raw token units in each token's own decimals; nothing is normalized behind your back.
What are the main custom errors?+
BadConfig for write-time validation, PotAlreadyReady for a second program attempt, plus auth errors on the role-gated calls. Trade-path failures never surface as reverts to the swapper.
Where is the exact struct layout?+
This page lists ProgramConfig and Program field by field; the verified source on any explorer and the repository's interface file are the canonical machine-readable versions.