This program implements an ICO (Initial Coin Offering) launchpad. It allows a project authority to create a new token where the price is determined by a linear bonding curve. It is the mint authority for the token it creates and is responsible for processing purchases and CPI-calling the affiliate program to handle commissions.
LaunchState["launch_state", authority_pubkey, token_mint_pubkey]authority: Pubkey - The wallet authorized to withdraw SOL.token_mint: Pubkey - The mint address of the token being sold.sol_vault_bump: u8 - The bump seed for the SOL vault PDA.initial_price: u64 - The starting price of the token in lamports per token.slope: u64 - The value by which the price increases for each token sold.tokens_sold: u64 - The total number of tokens sold to date.create_launchLaunchState account and the token_mint.initial_price: u64slope: u64buy_tokenssol_amount: u64affiliate_key: Option<Pubkey>withdraw_solInvalidAmount: Input amount is zero or invalid.Overflow: A mathematical calculation resulted in an overflow.InsufficientFunds: The SOL amount is too small to purchase any tokens at the current price.AuthorityMismatch: The signer of withdraw_sol is not the launch authority.AffiliateMismatch: The provided affiliate_key does not match the public key in the affiliate_info account.