πAPI Reference
Complete reference for all LiquidLaunch contract functions, events, and constants.
Contract Address
LiquidLaunch:
0xDEC3540f5BA6f2aa3764583A9c29501FeB020030
Functions
Token Creation
createToken
function createToken(
string memory name,
string memory symbol,
string memory image_uri,
string memory description,
string memory website,
string memory twitter,
string memory telegram,
string memory discord,
uint8 dexIndex
) external payable returns (address tokenAddress)
Creates a new token with bonding curve trading. Any HYPE sent with this transaction will be automatically used to purchase tokens for the creator as anti-sniper protection.
Trading Functions
buyTokens
function buyTokens(address token) external payable
Purchase tokens by sending HYPE. 1% fee applies.
sellTokens
function sellTokens(address token, uint256 tokenAmount) external
Sell tokens back to bonding curve. 1% fees applies. An approval is not required to sell tokens to the bonding curve.
Liquidity & Price Functions
getLiquidity
function getLiquidity(address token) public view returns (uint256 hypeReserve, uint256 tokenReserve)
Get current virtual reserves for a token.
estimateBuy
function estimateBuy(address token, uint256 hypeAmount) public view returns (uint256)
Estimate tokens received for HYPE input (includes 1% fee deduction).
estimateSell
function estimateSell(address token, uint256 tokenAmount) public view returns (uint256)
Estimate HYPE received for token input (includes 1% fee deduction).
Token Information
getTokenMetadata
function getTokenMetadata(address token) external view returns (TokenMetadata memory)
Get complete token metadata and state.
getTokenCreator
function getTokenCreator(address tokenAddress) external view returns (address)
Get the creator address for a token.
getTokenCount
function getTokenCount() external view returns (uint256)
Get total number of tokens created.
getPaginatedTokensWithMetadata
function getPaginatedTokensWithMetadata(uint256 start, uint256 limit)
external view returns (address[] memory tokens, TokenMetadata[] memory metadata)
Get tokens and metadata with pagination.
Token State Functions
getTokenFrozenStatus
function getTokenFrozenStatus(address token)
external view returns (address tokenAddress, bool isFrozen, uint256 frozenTimestamp)
Check if token is frozen for bonding.
getTokenBondingStatus
function getTokenBondingStatus(address token)
external view returns (address tokenAddress, bool isBonded, uint256 bondedTimestamp)
Check if token has been bonded to DEX.
Bonding Functions
completeBonding
function completeBonding(address token) external
Graduate token to HyperSwap. Can be called by anyone once bonding curve completes and token is frozen.
Fee Functions
claimFees
function claimFees(address token) external returns (uint256 whypeReceived)
Claim accumulated DEX fees. Only works for bonded tokens.
previewClaimFees
function previewClaimFees(address token) external returns (uint256 whypeAmount, uint256 tokensAmount)
Preview fees available for claiming. Must be called using a static call.
getClaimedFeesAndBurnedTokens
function getClaimedFeesAndBurnedTokens(address token)
external view returns (uint256 claimedFees, uint256 burnedTokens)
Get total fees claimed and tokens burned for a token.
Events
Token Lifecycle
TokenCreated
event TokenCreated(
address indexed token,
address indexed creator,
string name,
string symbol,
string image_uri,
string description,
string website,
string twitter,
string telegram,
string discord,
uint256 creationTimestamp,
uint256 startingLiquidity,
uint256 currentHypeReserves,
uint256 currentTokenReserves,
uint256 totalSupply,
uint256 currentPrice,
uint256 initialPurchaseAmount
);
TokenFrozen
event TokenFrozen(address indexed token);
TokenBonded
event TokenBonded(address indexed token);
Trading Events
TokensPurchased
event TokensPurchased(
address indexed token,
address indexed buyer,
uint256 hypeIn,
uint256 tokensOut,
uint256 price,
uint256 timestamp,
uint256 hypeReserves,
uint256 tokenReserves,
uint256 totalSupply,
string name,
string symbol
);
TokensSold
event TokensSold(
address indexed token,
address indexed seller,
uint256 tokensIn,
uint256 hypeOut,
uint256 price,
uint256 timestamp,
uint256 hypeReserves,
uint256 tokenReserves,
uint256 totalSupply,
string name,
string symbol
);
Fee Events
FeesClaimed
event FeesClaimed(
address indexed token,
uint256 nftTokenId,
address indexed claimer,
uint256 whypeReceived,
uint256 deployerShare,
uint256 protocolShare,
uint256 tokensReceived
);
BondFeeCollected
event BondFeeCollected(
address indexed token,
address indexed recipient,
uint256 feeAmount,
uint256 timestamp
);
Metadata Events
TokenMetadataUpdated
event TokenMetadataUpdated(
address indexed token,
address indexed creator,
string name,
string symbol,
string image_uri,
string description,
string website,
string twitter,
string telegram,
string discord,
uint256 timestamp
);
Data Structures
TokenMetadata
struct TokenMetadata {
string name;
string symbol;
string image_uri;
string description;
string website;
string twitter;
string telegram;
string discord;
address creator;
uint256 creationTimestamp;
uint256 startingLiquidity;
uint8 dexIndex;
}
FrozenToken
struct FrozenToken {
uint256 timestamp;
}
Constants
Token Economics
uint256 public constant VIRTUAL_HYPE_LIQUIDITY = 300 ether;
uint256 public constant TOTAL_SUPPLY = 1_000_000_000 * 10 ** 6;
uint256 public constant TOKENS_FOR_SALE = 649_300_000 * 10 ** 6;
Error Codes
General Errors
ZeroAddress()
: Address cannot be zeroZeroAmount()
: Amount cannot be zeroEthTransferFailed()
: ETH transfer failedTokenTransferFailed()
: Token transfer failedInsufficientBalance()
: Insufficient balance
Token Lifecycle Errors
TokenNotCreatedByFactory()
: Token not created by this factoryTokenCreationFailed()
: Token creation failedTokenFrozen()
: Token is frozenTokenNotFrozen()
: Token is not frozenTokenAlreadyBonded()
: Token already bondedTokenNotFound()
: Token not found
Trading Errors
TokenPurchaseFailed()
: Token purchase failedInsufficientLiquidity()
: Insufficient liquidityCreatorCannotSellYet()
: Creator cannot sell yet (1-hour lock)
Authorization Errors
UnauthorizedMetadataUpdate()
: Unauthorized metadata update
This reference covers all publicly accessible functions and events in the LiquidLaunch contract.
Last updated