CONTRACTS / ARCHITECTURE
Contract map
Fourteen contracts across two independent deployments. Nothing is shared between them and nothing is upgradeable.
Model V1 — contracts/launchpad-v1/src
| Contract | Role |
|---|---|
AgiLaunchFactory | Deploys the token, creates and seeds the Uniswap V3 pool, hands the position to the locker, optionally executes the creator's opening buy. Holds the launch configs and the DEX configs. |
AgiLaunchLocker | Holds every position NFT forever. Collects and splits LP fees, keeps the protocol fee recipient and the per-token fee share, indexes launches by deployer and by fee recipient. |
AgiLauncherToken | Fixed-supply ERC-20 with on-chain metadata and a temporary max-wallet / max-tx window. No owner, no mint, no pause. |
AgiTickMath, AgiLiquidityMath | Hand-carried tick and liquidity math, so V1 compiles no Uniswap code at all. |
Model V2 — contracts/launchpad-v2/src/v2
| Contract | Role |
|---|---|
AgiV2LaunchFactory | The entry point and the coordinator: launch configs, approved quote assets, the launch record, both graduation phases, the creator-recipient timelock and the rescue paths. Creates AgiV2GraduationGuard inside its own constructor. |
AgiV2LaunchDeployer | Performs the two CREATE2 deployments (token and curve) and predicts their addresses. Split out because the factory alone did not fit in 24 KB. |
AgiV2BondingCurve | One per launch. Holds the supply, prices buys and sells, charges the fee, tax and snipe tax, and hands its reserves to the factory at graduation. |
AgiV2LauncherToken | Fixed-supply ERC-20 minted entirely to its curve, with on-chain metadata and socials. |
AgiV2GraduationGuard | Stateless seed preflight. Not deployed separately — the factory constructs it. |
AgiV2GraduationExecutor | Encodes the Permit2 approvals and the PositionManager mint for the graduated position. Exists for bytecode size. |
AgiV2MemeHook | The singleton Uniswap V4 hook for every graduated pool. Permissions: beforeInitialize (restricted to the factory) and afterSwap with a return delta. Charges the fee, books the creator tax separately, converts and distributes on sweep. Also the protocol's fee policy oracle. |
AgiV2FeeEscrow | Pull-claim ledger for native ETH and ERC-20 payouts. Only msg.sender can claim. |
AgiV2BuybackVault | Deployed because the factory requires it, but idle: the AGI Launchpad does not enable buyback for any launch. |
AgiV2LaunchLocker | Holds the graduated V4 position NFT and the permanently locked token remainder. No collectFees here: V4 fees accrue inside the PoolManager, so the hook and the escrow own that job. |
AgiV2LaunchAndBuy | Optional router that launches and buys in one transaction, calling launchTokenFor as the trusted forwarder. |
Two wiring facts that shape the deployment
The guard is created by the factory's constructor, so it is never deployed or passed in.
The executor and the launch deployer are set after deployment, with
setGraduationExecutor() and setLaunchDeployer(), because each of their
constructors needs the factory's address. Both setters are one-shot. And the hook's address must carry the
correct V4 permission bits, so it has to be mined and deployed through a deterministic CREATE2 deployer.