Overview
GeodeFactory handles one-transaction token launches. It deploys a GeodeToken ERC20, mints the full supply to the hook, initializes the v4 pool as an empty shell, configures the hook, and registers the permanent bonding curve — all atomically.
The v4 pool is initialized at sqrtPriceAtTick(0) — a hollow shell. The hook handles all pricing via BEFORE_SWAP_RETURNS_DELTA. There is no graduation.
Immutables
Launch Parameters
Launch Flow
launch()
Validate
totalSupply > 0virtualTokenReserve > 0andvirtualEthReserve > 0deployerRoyaltyBps <= 5000(max 50%)maxBatchSizebetween 1 and 256virtualTokenReserve >= totalSupply(all tokens go to curve)
Determine Currency Ordering
Uniswap v4 requires
address(currency0) < address(currency1). WETH is always currency0 (lower address). If the token address is lower than WETH, the launch reverts with TokenSortOrderViolation.Build Pool Key & Initialize
sqrtPriceAtTick(0) — but as an empty shell with no liquidity. The hook handles all pricing.Configure Hook
Calls
hook.geodeInitializePool(key, config) with the curve parameters. Because config.deployer != address(0), this call is restricted to the factory.Register Launch
Calls
hook.registerLaunch() to set up permanent LaunchState tracking with virtual reserves and token reference.Initialize Price Beacon
Initializes a second v4 pool (same token pair, no hook) at the curve’s starting price. This secondary pool starts with zero liquidity — it serves as a price beacon for external integrators. Community members can add LP organically by buying tokens from the curve and providing two-sided liquidity to this AMM.
Launch Record
mapping(PoolId => LaunchRecord) public launches with a global launchCount.
Events
Source
GeodeFactory.sol
View the full source code on GitHub (~230 lines).