Smart contracts for a meme coin launch system with bonding-curve trading and a competitive fighting arena with USDC betting.
This repository contains:
- A factory that deploys meme coins, manages buy/sell flow on a bonding curve, and migrates liquidity to a Uniswap V2-compatible router when a market-cap threshold is reached.
- A fighting arena where migrated meme coins register for weekly/custom tournaments and users place USDC bets on round outcomes.
- Supporting libraries, mocks, tests, and Hardhat Ignition deployment modules.
contracts/MemeCoinFactory.sol- Deploys
MemeCointokens with metadata. - Enforces minimum initial buy in POLY (derived from Chainlink price feed).
- Supports token creation fees in POLY or USDC.
- Handles buy/sell using a linear pricing model.
- Migrates token liquidity to a Uniswap V2 router when market-cap goal is reached.
- Optionally auto-registers migrated tokens in the fighting arena.
- Deploys
contracts/MemeCoin.sol- ERC-20 token used for each launched meme coin.
- Stores social/metadata fields provided at creation.
contracts/MemeCoinFightingArena.sol- Weekly and custom tournaments (monthly, quarterly, annual championship).
- Level progression for winning tokens.
- Overflow queue for registrations above participant cap.
- USDC round betting with fee collection and daily limits.
- Wildcard logic based on post-elimination market-cap performance.
contracts/MemeCoinFightingArenaView.sol- Additional read-focused view helpers for arena data.
contracts/libraries/TournamentLibrary.solcontracts/libraries/TournamentManagementLibrary.solcontracts/libraries/BettingLibrary.solcontracts/libraries/ViewFunctionsLibrary.solcontracts/libraries/AdminFunctionsLibrary.sol
- Solidity
0.8.28(plus compatibility compilers for imported contracts) - Hardhat + TypeScript
- OpenZeppelin contracts
- Chainlink price feed integration
- Uniswap V2-style router/factory interfaces
- Node.js 18+
- npm (or yarn)
npm installCopy .env.example to .env and fill required values:
INFURA_API_KEY=...
PRIVATE_KEY=...
ETHERSCAN_API_KEY=...
USDC_ADDRESS=...
UNISWAP_ROUTER=...
WPOLY=...
PRICE_FEED=...npx hardhat compilenpx hardhat testRun a specific suite:
npx hardhat test test/MemeCoinFactory.test.ts
npx hardhat test test/FightingSystem.test.tsOptional gas report:
REPORT_GAS=true npx hardhat testAvailable modules:
ignition/modules/MemeCoinFactory.tsignition/modules/MemeCoinFightingArena.tsignition/modules/MockERC20.tsignition/modules/ProxyWalletFactory.ts
Example:
npx hardhat ignition deploy ./ignition/modules/MemeCoinFactory.ts --network sepoliaThen deploy arena with factory address parameter:
npx hardhat ignition deploy ./ignition/modules/MemeCoinFightingArena.ts --network sepoliaNote: verify deployment module constructor parameters match current contract constructors before production deployment.
- Initial supply:
54,321,777,100tokens (18 decimals) - Minimum initial buy:
1 USDequivalent in POLY - Market-cap migration goal:
54,321 USD
- Max weekly participants:
128 - Round duration:
24h - Betting window:
18h - Buffer time:
6h - Min/Max bet:
1to100USDC - Betting fee:
2%
contracts/Solidity contracts and librariestest/Hardhat test suitesignition/modules/deployment modulesignition/deployments/saved deployment artifactsFIGHTING_SYSTEM.mddeeper arena behavior notes
MIT