0x4cC8F6d5B7cE150CCC0A9B7664532B1283b96AC4. Use createLaunch for a plain launch. Use createLaunchWithReferral to record a referral code on chain at creation time.
createLaunch
msg.value is the optional creator prebuy. Send 0 for no prebuy. Send any positive amount to prebuy that much ETH at the curve’s starting price in the same transaction.
Returns the new launchId. The launch’s token address is in the LaunchCreated event emitted by the same call.
createLaunchWithReferral
createLaunch, plus a Referral event recording the code:
referralCode is empty, this still works but does not emit the Referral event. Use the plain createLaunch when you do not have a referral code.
CreateLaunchParams
Prebuy
There is noprebuyEth field. To prebuy at launch, send the prebuy amount as msg.value on the createLaunch call. The creator’s prebuy executes in the same transaction as the launch, at the curve’s starting price, and bypasses the anti-snipe captcha gate.
Field constraints
| Field | Constraint | Reverts if violated |
|---|---|---|
targetRaise | Between MIN_RAISE (1 ether) and MAX_RAISE (5 ether) | RaiseOutOfRange |
gainBps | At most MAX_GAIN_BPS (200,000) | GainTooHigh |
creatorFeeSplitBps | At most BPS_DENOMINATOR (10,000) | SplitOutOfRange |
msg.value | 0 (no prebuy) or any positive amount your wallet can cover | none directly |
startTime | Either 0 or in the future | LaunchInPast |
What happens during the call
- The hook deploys a new ERC20 token with the supplied metadata
- It computes the sale supply and liquidity supply for the curve through
SaleSplitCalculator(targetRaise, gainBps) - It records the
LaunchConfigin storage at the newlaunchId - It emits
LaunchCreatedandLaunchMetadata - If
msg.value > 0, it executes the creator prebuy at the curve’s starting price - If called as
createLaunchWithReferralwith a non empty code, it emitsReferral
Events emitted
msg.value > 0, a Trade event also fires for the prebuy.
Example: minimal launch
Common errors
| Revert | Cause |
|---|---|
RaiseOutOfRange | targetRaise is below 1 ether or above 5 ether |
GainTooHigh | gainBps exceeds 200,000 |
| Tx out of funds | Wallet does not have enough ETH for gas plus msg.value prebuy |
LaunchInPast | startTime is in the past and not zero |
SplitOutOfRange | creatorFeeSplitBps is above 10,000 |