A Solana smart contract for launching SPL tokens via a bonding curve mechanism, built with native Rust and SPL.
Belactokenlauncher provides the on-chain foundation for creating and trading new SPL tokens using a constant-product bonding curve. Users can deploy this contract to enable:
- Fair Launch: Tokens are minted and made available for purchase directly through the curve.
- Automated Liquidity: The curve itself acts as the initial market maker.
- Configurable Trading: Buy/sell actions are mediated by the contract, with an optional, updateable trade fee.
- Path to DEX: Includes functionality designed to facilitate migrating liquidity to a standard Serum/OpenBook market and Raydium AMM pool.
This contract is developed using native Rust and the Solana Program Library (SPL), offering granular control but requiring careful implementation and client-side handling.
- 🚀 SPL Token Creation: Generates a new Token Mint and associated Metaplex Metadata.
- 📈 Constant-Product Bonding Curve: Manages SOL deposits and token distribution based on virtual reserves.
- 💸 Dynamic Trade Fees: A designated authority can update the
trade_fee_basis_points
after deployment. - 🔒 Migration Mechanism: Supports locking the curve and transferring locked SOL/Token liquidity (intended for backend orchestration).
- 🦀 Native Rust & SPL: No Anchor framework dependency.
- Rust: Latest stable version recommended. Install via rustup.rs.
- Solana Tool Suite: Latest version recommended. Installation Guide.
- (Windows) WSL: Strongly recommended for building Solana programs on Windows.
-
Clone the repository (if you haven't already).
-
Navigate to the contract directory:
cd tokenlaunchcontract
-
Build the BPF bytecode:
cargo build-sbf
Note: If on Windows, run the build command within your WSL environment.
The compiled program artifact will be located at
target/deploy/tokenlaunchcontract.so
.
- Prepare Deployer Wallet: Ensure you have a Solana keypair funded with SOL on your target network (Devnet, Testnet, or Mainnet).
- Generate:
solana-keygen new
- Airdrop (Devnet/Testnet):
solana airdrop 2 <YOUR_WALLET_ADDRESS> --url <NETWORK_URL>
- Generate:
- Deploy:
solana program deploy target/deploy/tokenlaunchcontract.so \ --keypair <PATH_TO_YOUR_KEYPAIR.json> \ --url <NETWORK_URL>
- Replace
<PATH_TO_YOUR_KEYPAIR.json>
with the path to your funded deployer wallet. - Set
<NETWORK_URL>
:- Devnet:
d
orhttps://api.devnet.solana.com
- Testnet:
t
orhttps://api.testnet.solana.com
- Mainnet:
m
orhttps://api.mainnet-beta.solana.com
- Devnet:
- Replace
- Record Program ID: The CLI will output the deployed Program ID. Save this ID – it's essential for interacting with your contract.
This smart contract is provided "as is" without warranty of any kind. It has not undergone a formal security audit. Deploying and interacting with this contract involves significant risk, especially on Mainnet with real assets.
Always conduct thorough testing and consider a professional security audit before production use.
This project is licensed under the [OBELISK PROTOCOL] License.