Launchpad Contract
Token launch and bonding curve smart contract
The Launchpad contract manages token creation and bonding curve mechanics for new token launches on MuchFi.
Tip
Launchpad is enabled on Testnet.
| 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 |
| 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
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 | 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 |