A EVM token launchpad that uses bonding curve mechanics for price discovery and automatically lists tokens on DEX when they reach a target market cap.
This project implements a factory-based token launchpad where users can create new tokens with a bonding curve pricing mechanism. Tokens automatically graduate to a DEX when they reach a target market capitalization of $70,000 USD.
- Easy Token Creation: Create new tokens with just a name, symbol, and 0.02 ETH fee
- Bonding Curve Pricing: Automated market maker (AMM) style pricing using constant product formula
- Automatic DEX Listing: Tokens automatically list on DEX when reaching $70k USD market cap
- Dynamic Price Discovery: Real-time price updates based on Chainlink ETH/USD oracle
- Security First: Built with OpenZeppelin contracts, reentrancy guards, and access controls
- Multi-Chain Support: Configured for multiple EVM networks
The main factory contract that:
- Creates new token instances
- Manages token registry
- Handles buy/sell operations through bonding curves
- Collects creation fees
Implements the bonding curve mechanism:
- Constant product formula:
x * y = k - Initial virtual reserves: 1 ETH and 1,073,741,824 tokens
- Target market cap: $70,000 USD
- Automatic DEX listing when target is reached
- Trading fee: 1% (configurable)
Standard ERC20 token contract:
- Fixed initial supply: 1 billion tokens
- Mint and burn functionality
- Owned by factory contract
The bonding curve uses a constant product formula where:
Virtual ETH = INITIAL_VIRTUAL_ETH + totalEthIn
Virtual Token = K / Virtual ETH
Price = Virtual ETH / Virtual Token
When buying tokens with ETH:
- Calculate new virtual ETH after adding ETH amount
- Calculate new virtual token amount
- Tokens received = current virtual tokens - new virtual tokens
When selling tokens for ETH:
- Calculate new virtual token amount after adding tokens
- Calculate new virtual ETH amount
- ETH received = current virtual ETH - new virtual ETH
- Node.js (v14 or higher)
- npm or yarn
- Hardhat
- Clone the repository:
git clone <repository-url>
cd EVM-token-launchpad-contract- Install dependencies:
npm install
# or
yarn install- Create a
.envfile in the root directory:
PRIVATEKEY=your_private_key
SEPOLIA_NETWORK=https://sepolia.infura.io/v3/your_key
SEPOLIA_PRIVATEKEY=your_private_key
GOERLI_NETWORK=https://goerli.infura.io/v3/your_key
XLAYER_NETWORK=https://xlayer-rpc.okx.com
XLAYER_PRIVATEKEY=your_private_key
XLAYER_TEST_NETWORK=https://x1testrpc.okx.com
OWNER_PRIVATE=your_private_key
ZIRCUIT_NETWORK=https://zircuit1.p2pify.com
BASE_PRIVATEKEY=your_private_key
Arb_Mainnet=https://arb1.arbitrum.io/rpc
ArbMainnet_PRIVATEKEY=your_private_key
Coinmarketcap=your_coinmarketcap_api_keynpx hardhat compilenpx hardhat testnpx hardhat run scripts/deployMemeCoinFactory.js --network <network-name>npx hardhat run scripts/createToken.js --network <network-name>npx hardhat run scripts/buyToken.js --network <network-name>npx hardhat run scripts/sellToken.js --network <network-name>npx hardhat run scripts/getCurrentProgress.js --network <network-name>The project is configured to support the following networks:
- Sepolia (Testnet) - Chain ID: 11155111
- Goerli (Testnet) - Chain ID: 5
- Monad (Testnet) - Chain ID: 10143
- Monad (Mainnet) - Chain ID: 143
- Base (Mainnet) - Chain ID: 8453
- Arbitrum (Mainnet) - Chain ID: 42161
- XLayer (Mainnet) - Chain ID: 196
- XLayer Testnet - Chain ID: 195
- Zircuit - Chain ID: 48899
- Creation Fee: 0.02 ETH
- Initial Supply: 1,000,000,000 tokens (1 billion)
- Name Length Limit: 32 characters
- Symbol Length Limit: 10 characters
- Symbol Uniqueness: Enforced per creator
- Initial Virtual ETH: 1 ETH
- Initial Virtual Token: 1,073,741,824 tokens
- Constant K: 1,073,741,824 (INITIAL_VIRTUAL_ETH × INITIAL_VIRTUAL_TOKEN)
- Target Market Cap: $70,000 USD
- Trading Fee: 1% (100 basis points, configurable)
- Price Update Interval: 5 minutes
When a token reaches the target market cap:
- Trading on bonding curve is disabled
- Excess ETH is sent to factory owner
- Remaining ETH is converted to WETH
- DODO Vending Machine pool is created
- Token becomes tradeable on DEX
- Reentrancy protection using
ReentrancyGuard - Access control with OpenZeppelin
Ownable - Safe token transfers with
SafeERC20 - Factory-only execution modifiers
- Input validation on all public functions
- Overflow protection (Solidity 0.8.x)
.
├── contracts/
│ ├── BondingCurveV7.sol # Bonding curve implementation
│ ├── MemeCoin.sol # ERC20 token contract
│ ├── MemeCoinFactoryV7.sol # Factory contract
│ ├── interface/ # Contract interfaces
│ └── lib/ # Math library
├── scripts/ # Deployment and interaction scripts
├── test/ # Test files
├── hardhat.config.js # Hardhat configuration
└── package.json # Dependencies
Run the test suite:
npx hardhat testRun tests with gas reporting:
GAS_REPORT=true npx hardhat testNote: This project is in active development. Always test thoroughly on testnets before deploying to mainnet.