Build a Memecoin Launchpad on Solana Using Neon EVM
Neon Dev Bootcamp – Week 2: Build a Memecoin Launchpad on Solana Using Neon EVM
Overview
Welcome to Week 2 of the Neon Dev Bootcamp!
This week, you'll build a fully onchain memecoin launchpad that deploys a Raydium DEX liquidity pool on Solana, all using Solidity and Neon EVM’s composability features. You’ll deepen your understanding of how EVM contracts can interact with Solana’s runtime using precompiles, helper libraries, and atomic transaction bundling.
By the end of this lesson, you’ll have:
- Created and tested a launchpad contract powered by a bonding curve
- Integrated with Raydium’s CPMM pools to lock liquidity
- Learned how to trigger composability requests to Solana from Solidity
- Collected fees from onchain activity using an NFT that represents a locked LP position
Prerequisites
Before diving in, make sure you’ve completed Week 1 of the bootcamp, where you worked with:
- The
ICallSolana
precompile (see docs) - The
ERC20ForSPLFactory
contract (see docs) - Neon EVM project setup (MetaMask Setup, Hardhat Config)
Follow along
To follow along, you can clone the project repository to access the contract and test scripts created during this tutorial.
git clone git@github.com:neonlabsorg/neon-pocs.git
cd neon-pocs
npm install
cp .env.example .env
Set the following environment variables inside .env
:
PRIVATE_KEY_OWNER=your-evm-wallet-private-key
PRIVATE_KEY_SOLANA=your-svm-wallet-private-key
USER1_KEY=random-32-byte-key
- Get free NEON for devnet: https://neonfaucet.org
- Get free SOL for devnet: https://faucet.solana.com
What We’re Building
We’re developing a memecoin launchpad with the following features:
- Public token sale initialized by any user
- Tokens distributed via a bonding curve
- Liquidity pool created on Raydium DEX once a funding goal is reached
- Locked LP represented by a minted NFT
- Composability requests issued from Solidity to Solana to:
- Create a CPMM pool
- Lock liquidity
- Collect fees after pool activity
Architecture Overview
Here’s how the launchpad works:
1. Bonding Curve
Projects can define a custom bonding curve for token pricing. Users deposit WSOL to receive tokens. A fee is taken on every deposit.
2. Token Sale Lifecycle
- Creation: Anyone can launch a new sale.
- Funding: WSOL deposits accumulate toward a preset funding goal.
- Pool Deployment: Once the funding goal is reached, liquidity is locked on Raydium and the pool is created.
- Trading: Token state changes to
TRADING
, disabling thebuy
function that was active during funding stage.
3. Liquidity Locking
Two composability requests are made:
- Create a CPMM pool on Raydium
- Lock liquidity into it and mint an NFT
Test Flow Breakdown
Run the test script:
npx hardhat test test/MemeLaunchpad/MemeLaunchpad.js --network neondevnet
What happens in the test script step-by-step:
- Deploy Contracts:
- Initialize Token Sale:
- Define token name, symbol, decimals
- Set funding goal: e.g.,
0.1 SOL
- Create ATA Accounts:
- Required for Solana token transfers
- Simulate Token Buys:
- First buy:
0.01 SOL
(below funding goal) - Second buy:
0.15 SOL
(reaches goal)
- First buy:
- Trigger Pool Creation:
- Contract automatically issues composability requests:
- Create Raydium pool
- Lock liquidity and mint NFT
- Contract automatically issues composability requests:
- Generate Traffic & Collect Fees:
- Simulate pool swaps using
raydiumSwapInput()
- Call
collectPoolFees()
to claim pending earnings
- Simulate pool swaps using
Deep Dive: Composability with Neon Libraries
Neon’s onchain libraries abstract Solana’s complexity:
- For example, creating a Raydium pool requires 20 ordered accounts.
- Libraries calculate PDAs, signer roles, and account types for you.
- You stay in Solidity - the library builds and submits Solana-compatible transactions.
Try this: Open one of the library instructions and inspect how accounts are configured for Solana constraints.
Resources
- Neon EVM Docs
- Solana Raydium Docs
- Composability requests to Raydium
- Precompiled contracts
- Project GitHub: neonlabsorg/neon-pocs
Wrap-Up
You’ve now built a launchpad that:
- Creates EVM-compatible tokens on Solana
- Manages a token sale with funding logic
- Connects to Solana-native DEX infrastructure via composability
Practice Exercise
Beginner task: replicate creation of the Memecoin Launchpad on Solana via Neon EVM (feel free to copy all the necessary files from the POC GitHub repo to your own GitHub project)
Advanced task: create a fully-fledged Memecoin Launchpad in which you change the token distribution logic (bonding curve) and/or add a UI