Launchpad Architecture
Factory/token/AMM-pair architecture, graduation flow, admin parameters, and event schema for the GIWA token launchpad
The Launchpad is a permissionless, bonding-curve token factory targeting GIWA Sepolia (an OP-Stack EVM testnet, chain ID 91342). It follows a pump.fun-style lifecycle - bonding curve → graduation → AMM - hardened with a three-part anti-sniper defense and accrue-and-claim creator economics. This page covers the on-chain architecture; see Launchpad Math for the bonding-curve and fee formulas, and the Launchpad overview for a plain-language explainer.
Pool Lifecycle
Contracts
| Contract | Responsibility |
|---|---|
LaunchpadFactory | One factory, many pools. Holds every pool's reserves, supply, fee config, and graduation status in a mapping(uint256 => PoolState). All trading (buy/sell), creation, claims, and admin functions live here. |
LaunchpadToken | A minimal ERC-20 deployed fresh per pool. The entire total supply mints to the factory at construction. Transfers are restricted to/from the factory only until the pool graduates - this blocks OTC trades that would bypass bonding-curve price discovery. |
LaunchpadAmmPair | A minimal constant-product AMM pair, deployed once per graduated pool, seeded exactly once by the factory with the pool's remaining tokens and raised ETH. LP shares mint directly to a dead address - nothing to withdraw, ever. |
A single factory (rather than one contract per token) keeps deployment cheap and gives an off-chain indexer one contract address to watch instead of N.
Pre-Graduation Transfer Restriction
LaunchpadToken only allows a transfer if the factory is on one side of it, until graduated == true. This closes the loophole other launchpads have where a creator (or a bot) arranges an off-curve OTC deal at a price the public curve never saw.
Trading Phases
Every pool moves through two fee regimes before graduation, and a third one after:
- Anti-snipe window (first
ANTI_SNIPE_DECAY_BLOCKSblocks after creation) - a steep, rapidly decaying fee plus a hard per-buy cap on how much of the remaining supply a single transaction can claim. See Launchpad Math for the exact formula. - Ongoing curve trading (after the anti-snipe window, before graduation) - a market-cap-scaled dynamic fee: higher on a fresh, thin pool, easing down as the pool proves out real cumulative demand. See Launchpad Math.
- Post-graduation AMM trading - a flat
POST_GRADUATION_AMM_FEE_BPS(0.3%) swap fee, Uniswap-v2-style, the same for every graduated token.
Anti-Sniper Mechanisms
Three composable mechanisms, all pure Solidity - no off-chain infrastructure (private mempools, commit-reveal) required:
- Atomic creator-seed first-buy (optional) -
createToken()accepts an attached ETH value and executes the creator's own first buy in the same transaction, guaranteeing the creator (not a bot) gets the first, cheapest fill. - Block-indexed decaying anti-snipe fee - a high fee at the pool's creation block, linearly decaying to the baseline trading fee over
ANTI_SNIPE_DECAY_BLOCKSblocks. Formula in Launchpad Math. - Per-transaction max-buy cap - no single buy may exceed
MAX_BUY_CAP_BPSof the pool's remaining curve supply while the anti-snipe window is active.
Graduation
When cumulative net ETH raised crosses MAX_RAISE, graduation runs atomically in a single transaction:
- The pool's remaining real token reserve and real ETH reserve are read and zeroed out.
- A fresh
LaunchpadAmmPairis deployed and seeded with exactly those two amounts viaseedAndLock(). - The resulting LP shares are minted directly to
0x000000000000000000000000000000000000dEaD- a permanent, irreversible lock. pool.graduatedis settrueandLaunchpadToken.setGraduated()lifts the pre-graduation transfer restriction.- Further
buy()/sell()calls against the curve revert; all trading moves toLaunchpadAmmPair.swapEthForToken()/swapTokenForEth().
If the curve happens to be fully depleted at the exact moment the raise target is crossed, there's nothing left to seed an AMM with - the pool still graduates (the transfer restriction still lifts), and the raised ETH is swept to the treasury accrual instead of being stranded. PoolGraduated.ammPair is address(0) in that edge case.
The AMM's router/pair logic is a small, self-contained module specifically so that pointing graduation at a real GIWA DEX later - if and when one exists and is stable - is a router swap, not a contract redesign.
Creator Economics
An admin-bounded, accrue-and-claim mechanism - it does not auto-pay per trade, which keeps every buy/sell's gas cost from compounding with the anti-snipe fee math already on the hot path:
- Trading-fee revenue share - a creator-configurable cut (up to
CREATOR_FEE_SHARE_MAX_BPS, 50%) of the baseline trading fee (never the anti-snipe fee, which routes entirely to treasury as a sniper tax) accrues per pool and is pulled viaclaimRevenue(poolId). Formula in Launchpad Math.
Admin-Bound Parameters
Every configurable parameter is hard-capped in the contract itself, so a compromised or malicious admin key cannot rug a pool via a config change alone. Governance is a single Ownable admin key - acceptable for testnet, with multisig/timelock hardening flagged as a required upgrade before any mainnet deployment.
| Constant | Value | What it bounds |
|---|---|---|
TOTAL_SUPPLY_DEFAULT | 1,000,000,000 × 10^18 | Total ERC-20 supply minted per pool at creation |
CREATOR_ALLOCATION_HARD_CAP_BPS | 8,000 (80%) | Max share of total supply a creator can allocate to themselves |
MAX_RAISE | 1 ether | Cumulative net ETH raised at which a pool graduates |
VIRTUAL_ETH_RESERVE | 2 ether | Non-withdrawable virtual ETH reserve seeding every curve (2× MAX_RAISE, so an ordinary sell-free graduation leaves curveSupply/3 of real tokens behind as AMM seed liquidity - see Launchpad Math) |
ANTI_SNIPE_FEE_START_BPS | 8,000 (80%) | Fee charged on a buy landing in the pool's creation block |
ANTI_SNIPE_DECAY_BLOCKS | 15 | Blocks over which the anti-snipe fee decays to baseline |
MAX_BUY_CAP_BPS | 300 (3%) | Max share of remaining curve supply a single buy may claim during the anti-snipe window |
DYNAMIC_FEE_MAX_BPS | 500 (5%) | Baseline trading fee at zero cumulative raise |
DYNAMIC_FEE_MIN_BPS | 100 (1%) | Baseline trading fee once cumulative net raise reaches MAX_RAISE |
POST_GRADUATION_AMM_FEE_BPS (SWAP_FEE_BPS on the pair) | 30 (0.3%) | Flat swap fee on the graduated AMM pair |
CREATOR_FEE_SHARE_MAX_BPS | 5,000 (50%) | Max share of the baseline fee a creator can route to themselves |
ADMIN_TRADING_FEE_HARD_CAP_BPS | 2,000 (20%) | Ceiling the admin cannot raise the dynamic fee bounds past |
BPS_DENOMINATOR | 10,000 | Basis-point denominator used throughout |
dynamicFeeMinBps / dynamicFeeMaxBps are the only fee parameters the admin can adjust post-deployment (setDynamicFeeBounds), and every call is checked against ADMIN_TRADING_FEE_HARD_CAP_BPS - the admin can tune within the corridor, never widen it.
Event Schema
Every state transition emits an event - this is the seam a future GIWA-wallet or third-party integration would index against. There is no on-chain rug/whale-detection logic in these contracts; that's an off-chain consumer's job, watching this event stream plus standard ERC-20 Transfer.
| Event | Fields | Emitted when |
|---|---|---|
PoolCreated | poolId (indexed uint256), token (indexed address), creator (indexed address), curveSupply (uint256), creatorAllocation (uint256) | A new pool and LaunchpadToken are created via createToken() |
Buy | poolId (indexed uint256), buyer (indexed address), ethIn (uint256), tokensOut (uint256), feeAmount (uint256), feeBps (uint256) | Every successful buy() against the curve |
Sell | poolId (indexed uint256), seller (indexed address), tokensIn (uint256), ethOut (uint256), feeAmount (uint256), feeBps (uint256) | Every successful sell() against the curve |
PoolGraduated | poolId (indexed uint256), ammPair (address), tokenAmount (uint256), ethAmount (uint256) | Cumulative net ETH raised crosses MAX_RAISE; ammPair is address(0) in the rare fully-depleted-curve edge case |
CreatorClaimedRevenue | poolId (indexed uint256), creator (indexed address), amount (uint256) | Creator calls claimRevenue() |
FeeParamsUpdated | dynamicFeeMinBps (uint256), dynamicFeeMaxBps (uint256) | Admin calls setDynamicFeeBounds() |
Building against this event stream
Every field above is exactly what's emitted on-chain - this table is the seam a future embedded-wallet or SDK integration would build against for indexing pool state without re-deriving it from raw calldata.
On-Chain Deployment
Deployed contract address
LaunchpadFactory is live and verified on GIWA Sepolia testnet at
0x45A2481BA41DE4C370BbBd756f031D7c13682433.
Source verified on Blockscout (Solidity v0.8.24, optimizer on) - the deployed
bytecode, constructor logic, and every constant match this document exactly.
Why This Anti-Sniper Design
Neither of the two reference launchpad implementations surveyed during design had a working anti-sniper mechanism worth reusing: one had none at all, and the other's gas-price cap only means anything on a chain with a priority-fee auction (Ethereum L1) - meaningless on GIWA's flat-gas OP-Stack sequencer, where gas price isn't a lever bots or defenders can pull. Industry research into currently-operating EVM/Solana launchpads shaped the design instead:
- four.meme (BSC) "X Mode" - a block-indexed decaying fee, 100% at block 0 down to 1% by block 6. Trivial Solidity, zero off-chain infrastructure. This directly informed the anti-snipe decaying fee above.
- Raydium LaunchLab - an atomic creator first-buy in the same transaction as token creation, guaranteeing the creator (not a bot) gets the first fill. This informed the atomic creator-seed buy mechanism.
- Clanker / Doppler (Base) - a Uniswap v4-hook Dutch-auction dynamic curve. Meaningfully stronger, but requires v4 hooks and epoch bookkeeping - judged overkill for a first ship given team size and GIWA's newness as a chain.
- Meteora Alpha Vault - a pre-launch deposit window with locked average pricing. Fully neutralizes ordering-based sniping, but adds a two-phase launch UX and, for the whitelisted variant, off-chain allowlist management.
- The common thread across all of them: a per-wallet/per-transaction max-buy cap (roughly 2-3% of supply) as a cheap, universal backstop - present here as
MAX_BUY_CAP_BPS.
The combination chosen - atomic creator-seed buy, block-indexed decaying fee, and a max-buy cap - matches what four.meme and Raydium LaunchLab actually run in production today. It requires zero off-chain infrastructure and was chosen over the heavier Doppler/Alpha-Vault approaches given team size and GIWA's newness as a chain.
For the plain-language version of these guarantees, see the Launchpad overview.