Launchpad Contract
The Launchpad contract manages token creation and bonding curve mechanics for new token launches on Realtime Exchange.
Contract Addresses
| Contract | Address |
|---|
| Launchpad | 0x0b21332C1a248A2A65EecFebE6F1be3a44d4D0f6 |
| Referral Router | 0x2E2aC955fcFD940424b3143c495ad38Aab7D1f61 |
| Referral Handler V2 | 0x1412c9404a34a573a11cb7073c7861a3F089012d |
| Access Registry | 0x900d94C22972C930923fb0B06C0258F026F607ae |
| Contract | Address |
|---|
| Launchpad | 0x75934d752ffa7bd8faEAdF1e429C718a83447902 |
| Referral Router | 0x606D5b47E72988B60Ab1E2B900D2c15C5e847790 |
| Referral Handler V2 | 0xA4E07b21701E5a38fA2a22fe94F2612b06d4C9Fe |
| Access Registry | 0xC23F40Af183FFA30b1554E0d18CB8063583c03B2 |
Launchpad is enabled on both Mainnet and Testnet.
Constructor Parameters
| Parameter | Type | Description |
|---|
_tokenImplementation | address | Token implementation contract |
_accessRegistry | address | Access registry contract |
_curve | address | Bonding curve contract |
_treasury | address | Treasury address for fees |
_lpReceiver | address | LP token receiver address |
_creationCost | uint64 | Cost to create a new token |
_boosterFraction | uint64 | Booster fraction parameter |
Core Functions
Token Creation
| Function | Description |
|---|
createLaunchpadToken(tokenConfig, metadataConfig, snipeConfig, curveParameters) | Create a new launchpad token with configuration |
TokenConfig struct:
name - Token name
symbol - Token symbol
initialSupply - Initial token supply
MetadataConfig struct:
ipfsHash - IPFS hash for token image
website - Project website URL
twitter - Twitter handle
telegram - Telegram group
description - Token description
metadata - Additional metadata
Trading Operations
| Function | Description |
|---|
buyExactEth(token, minAmountOut) | Buy tokens with exact ETH amount (payable) |
buyExactTokens(token, amountOut) | Buy exact amount of tokens (payable) |
sellExactTokens(token, amountIn, minAmountOut) | Sell exact amount of tokens |
sellExactEth(token, amountOut, maxInput) | Sell tokens for exact ETH amount |
Price Calculations
| Function | Returns | Description |
|---|
quote(token, amount, quoteType) | Quote | Get comprehensive quote for trade |
quoteBuyExactEth(token, amount) | (uint256, uint256) | Quote for buying with exact ETH |
quoteBuyExactTokens(token, amount) | (uint256, uint256) | Quote for buying exact tokens |
quoteSellExactTokens(token, amount) | (uint256, uint256) | Quote for selling exact tokens |
quoteSellExactEth(token, amount) | (uint256, uint256) | Quote for selling to get exact ETH |
| Function | Returns | Description |
|---|
getTokenInfo(token) | TokenInfo | Get detailed info for a token |
getAllTokens() | address[] | Get all launched token addresses |
getAllTokensInfo() | TokenInfo[] | Get info for all tokens |
getTokens(start, end) | address[] | Get tokens in range |
getTokensInfo(start, end) | TokenInfo[] | Get token info in range |
getMostRecentTokens(num) | address[] | Get most recent tokens |
getMostRecentTokensInfo(num) | TokenInfo[] | Get most recent token info |
getTokensCount() | uint256 | Total number of launched tokens |
getTokensByCreator(creator) | address[] | Get tokens by creator address |
getTokensInfoByCreator(creator) | TokenInfo[] | Get token info by creator |
getTokensCountByCreator(creator) | uint256 | Count of tokens by creator |
tokenToGauge(token) | address | Get gauge address for token |
tokenToCreator(token) | address | Get creator address for token |
Admin Functions
| Function | Description |
|---|
setAccessRegistry(address) | Update access registry |
setBondingCurveFraction(uint64) | Set bonding curve fraction |
setBoosterFraction(uint64) | Set booster fraction |
setCreationCost(uint64) | Set token creation cost |
setCurve(address) | Set bonding curve contract |
setGaugeFees(feeParams) | Set gauge buy/sell fees |
setGaugeImplementation(address) | Set gauge implementation |
setLpReceiver(address) | Set LP receiver address |
setTokenImplementation(address) | Set token implementation |
setTreasury(address) | Set treasury address |
State Variables
| Variable | Type | Description |
|---|
accessRegistry | address | Access registry contract |
bondingCurveFraction | uint64 | Bonding curve fraction |
boosterFraction | uint64 | Booster fraction |
creationCost | uint64 | Cost to create token |
curve | address | Bonding curve contract |
gaugeFees | (uint128, uint128) | Buy and sell fees |
gaugeImplementation | address | Gauge implementation |
lpReceiver | address | LP receiver address |
tokenImplementation | address | Token implementation |
treasury | address | Treasury address |
Constants
| Constant | Description |
|---|
FRACTION_DENOMINATOR | Denominator for fraction calculations |
MAX_BONDING_FRACTION | Maximum bonding fraction |
MAX_BOOSTER_FRACTION | Maximum booster fraction |
MAX_CREATION_COST | Maximum creation cost |
MAX_GAUGE_FEE | Maximum gauge fee |
MIN_INITIAL_SUPPLY | Minimum initial supply |
Events
| Event | Description |
|---|
NewToken(creator, token, gauge, curve) | Emitted when new token is created |
AccessRegistrySet(newRegistry, oldRegistry) | Access registry updated |
BondingCurveFractionSet(newFraction, oldFraction) | Bonding fraction updated |
BoosterFractionSet(newFraction, oldFraction) | Booster fraction updated |
CreationCostSet(newAmount, oldAmount) | Creation cost updated |
CurveSet(newCurve, oldCurve) | Bonding curve updated |
GaugeFeesSet(newBuyFee, oldBuyFee, newSellFee, oldSellFee) | Gauge fees updated |
GaugeImplementationSet(newImpl, oldImpl) | Gauge implementation updated |
LpReceiverSet(newReceiver, oldReceiver) | LP receiver updated |
TokenImplementationSet(newImpl, oldImpl) | Token implementation updated |
TreasurySet(newTreasury, oldTreasury) | Treasury updated |
Error Types
| Error | Description |
|---|
Launchpad__ExcessiveBondingFraction | Bonding fraction too high |
Launchpad__ExcessiveBoosterFraction | Booster fraction too high |
Launchpad__ExcessiveCreationCost | Creation cost too high |
Launchpad__ExcessiveGaugeFee | Gauge fee too high |
Launchpad__InsufficientValue | Insufficient ETH sent |
Launchpad__InvalidIndex | Invalid token index |
Launchpad__InvalidToken | Invalid token address |
Launchpad__InvalidTotalSupply | Invalid total supply |
Launchpad__TransferFailure | Token transfer failed |
Launchpad__Unauthorized | Caller not authorized |
Launchpad__ZeroAddress | Zero address provided |