This repository contains a design document only. There is no source code here.
Everything below describes an intended architecture. Any performance figure, benchmark, latency target, throughput number or Sharpe ratio in this document is a design target that has never been measured, not a result. Installation and usage instructions describe files that do not exist in this repository.
It is published as a specification and planning artefact. For systems that are actually built and tested, see web3-infrastructure.
A comprehensive collection of memecoin infrastructure implementations — from fair launch mechanisms and bonding curve launchpads to anti-rug systems, token lock vaults, sniper protection, community governance, meme token analytics, and full-stack launch platforms. Built to understand the engineering behind the most viral sector in crypto.
- Overview
- Why Study Memecoins?
- Memecoin Ecosystem Landscape
- Tech Stack
- Projects
- How Memecoins Work
- Architecture Diagrams
- Repository Structure
- Getting Started
- Development Workflow
- Testing
- Security
- Deployment
- Key Concepts
- Top Memecoins Reference
- Resources
- Contributing
- License
Memecoins are culture tokenized. What started as internet jokes has become a multi-billion dollar sector driving more on-chain activity than most "serious" protocols. Behind the memes lies sophisticated smart contract engineering — bonding curves, anti-snipe mechanisms, liquidity bootstrapping, tokenomics design, and launch platform architecture.
What you'll build:
- Fair launch token contracts with anti-bot and anti-snipe protections
- Pump.fun-style bonding curve launchpads with automatic DEX migration
- Liquidity lock and token vesting vaults (anti-rug infrastructure)
- Token deployer factories — launch a memecoin in one transaction
- Trading bots — sniping, limit orders, copy trading for meme tokens
- Honeypot detectors and rug-pull scanners
- Community governance for meme DAOs
- Tax/reflection tokens with auto-LP and buyback mechanisms
- Token analytics dashboards — holder distribution, whale tracking
- Full-stack launch platforms with real-time charts and social feeds
Regardless of opinions on meme tokens, they are a masterclass in:
| Engineering Skill | What Memecoins Teach You |
|---|---|
| Smart Contract Design | Tax tokens, reflection mechanisms, bonding curves, factories |
| DEX Integration | Uniswap V2/V3 pair creation, liquidity management, routing |
| MEV & Front-Running | Sniper bots, sandwich protection, priority gas auctions |
| Tokenomics | Supply distribution, burn mechanics, inflation/deflation |
| Security | Honeypot patterns, rug vectors, approval exploits |
| Gas Optimization | Batch operations, storage packing, minimal proxy clones |
| Community Bootstrapping | Fair launches, airdrops, social virality mechanics |
| Real-Time Systems | Mempool monitoring, block-by-block trading, websocket feeds |
┌──────────────────────────────────────────────────────────────────────────────┐
│ MEMECOIN ECOSYSTEM │
│ │
│ ┌─────────────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │
│ │ Launch Platforms │ │ DEXs / Trading │ │ Analytics / Tools │ │
│ │ │ │ │ │ │ │
│ │ • Pump.fun │ │ • Uniswap V2/V3 │ │ • DEXScreener │ │
│ │ • Four.meme │ │ • PancakeSwap │ │ • DEXTools │ │
│ │ • GMGN.ai │ │ • Raydium (Solana) │ │ • Birdeye │ │
│ │ • ape.store │ │ • Aerodrome (Base) │ │ • BubbleMaps │ │
│ │ • Moonshot │ │ • SushiSwap │ │ • GoPlus / TokenSniffer│
│ └─────────────────────┘ └──────────────────────┘ └────────────────────┘ │
│ │
│ ┌─────────────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │
│ │ Safety / Anti-Rug │ │ Trading Bots │ │ Social / Community│ │
│ │ │ │ │ │ │ │
│ │ • Team.finance │ │ • Banana Gun │ │ • Telegram groups │ │
│ │ • Unicrypt │ │ • Maestro Bot │ │ • Twitter/X CT │ │
│ │ • PinkSale │ │ • BONKbot │ │ • Farcaster frames │ │
│ │ • GoPlus Security │ │ • Trojan on Solana │ │ • Dexscreener socials│
│ │ • TokenSniffer │ │ • Custom snipers │ │ • Meme communities │ │
│ └─────────────────────┘ └──────────────────────┘ └────────────────────┘ │
│ │
│ ┌─────────────────────┐ ┌──────────────────────┐ ┌────────────────────┐ │
│ │ Token Standards │ │ Liquidity │ │ Chains │ │
│ │ │ │ │ │ │ │
│ │ • Standard ERC-20 │ │ • LP locking │ │ • Ethereum │ │
│ │ • Tax tokens │ │ • LP burning │ │ • Base │ │
│ │ • Reflection tokens │ │ • Bonding curve → │ │ • Solana │ │
│ │ • Rebase tokens │ │ auto DEX migration │ │ • BSC │ │
│ │ • Burn-on-transfer │ │ • Protocol-owned LP │ │ • Arbitrum │ │
│ └─────────────────────┘ └──────────────────────┘ └────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────────┘
| Layer | Technology |
|---|---|
| Smart Contracts | Solidity 0.8.x |
| Frameworks | Foundry, Hardhat |
| Token Standards | ERC-20, ERC-20 + tax, reflection tokens |
| DEX Integration | Uniswap V2 Router/Factory, Uniswap V3, Aerodrome |
| Bonding Curves | Linear, exponential, sigmoid, step curves |
| Anti-MEV | Flashbots Protect, private mempools, commit-reveal |
| Bot Framework | ethers.js, viem, WebSocket mempool listeners |
| Analytics | The Graph, Alchemy, Moralis, custom indexers |
| Frontend | Next.js, React, TradingView Lightweight Charts, wagmi |
| Real-Time | WebSocket, Server-Sent Events, mempool streaming |
| Security Scanning | GoPlus API, TokenSniffer API, custom analysis |
| Networks | Ethereum, Base, BSC, Arbitrum, Polygon |
| # | Project | Description | Key Concepts |
|---|---|---|---|
| 01 | Standard Memecoin (No Tax) | Clean ERC-20 with fixed supply, no owner functions, renounced — the safest | Immutable, renounced, no hidden functions |
| 02 | Tax Token (Buy/Sell Fee) | ERC-20 with configurable buy/sell tax — auto-split to marketing, LP, burn | Transfer hooks, fee routing, tax swap |
| 03 | Reflection Token (Rewards) | Holders earn passive rewards from every transaction — SafeMoon-style | Reflect mechanism, excluded addresses |
| 04 | Burn-on-Transfer (Deflationary) | Percentage of every transfer burned — decreasing supply over time | Burn mechanism, supply tracking |
| 05 | Rebase Token (Elastic Supply) | Supply automatically adjusts — positive rebase on price increase | Rebase math, target price, epoch |
| # | Project | Description | Key Concepts |
|---|---|---|---|
| 06 | Pump.fun Clone (Bonding Curve Launch) | Create token → bonding curve trading → auto-migrate to DEX at market cap | Curve pricing, graduation, DEX migration |
| 07 | Linear Bonding Curve | Price increases linearly with supply — simplest predictable model | y = mx + b, reserve ratio, buy/sell math |
| 08 | Exponential Bonding Curve | Price increases exponentially — early buyers get massive advantage | Exponential pricing, steep curve mechanics |
| 09 | Sigmoid Bonding Curve | S-curve pricing — slow start, rapid middle, plateau at top | Sigmoid math, fair distribution phase |
| 10 | Token Deployer Factory | One-click memecoin deployment — name, symbol, supply, launch in one tx | CREATE2, minimal proxy (EIP-1167), factory |
| # | Project | Description | Key Concepts |
|---|---|---|---|
| 11 | Liquidity Lock Vault | Lock LP tokens for set duration — proves dev can't pull liquidity | Timelock, LP tokens, lock/extend/withdraw |
| 12 | Token Vesting Contract | Team/dev tokens vest over time — prevents immediate dumping | Cliff, linear vesting, revocable/irrevocable |
| 13 | Honeypot Detector | Simulate buy+sell on a token to detect if selling is blocked | eth_call simulation, sell test, gas analysis |
| 14 | Rug Pull Scanner | Analyze token contract for red flags — hidden mints, blacklists, proxies | Bytecode analysis, function signature scan |
| 15 | Multi-Sig Token Owner | Token admin functions behind multi-sig — no single point of rug | Gnosis Safe, threshold, tx queue |
| # | Project | Description | Key Concepts |
|---|---|---|---|
| 16 | Mempool Sniper Bot | Monitor mempool for new pair creation → auto-buy in the same block | Pending tx filter, gas bidding, speed |
| 17 | Anti-Snipe Launch Protection | First N blocks have max buy limit and high tax to deter bot sniping | Block-based limits, decay function |
| 18 | Limit Order Bot (DEX) | Set buy/sell prices — bot executes when target is hit on Uniswap | Price monitoring, order management |
| 19 | Copy Trade Bot (Whale Tracking) | Monitor whale wallets — automatically copy their memecoin buys | Wallet tracking, tx mirroring, filters |
| 20 | Sandwich Attack Detector | Detect and alert when your transaction is being sandwiched | Mempool analysis, price impact, alerting |
| # | Project | Description | Key Concepts |
|---|---|---|---|
| 21 | Meme DAO | Community governance for a memecoin — vote on burns, marketing, partnerships | Token-weighted voting, proposals, execution |
| 22 | Community Airdrop System | Fair airdrop to early holders, social participants, and community members | Merkle tree, snapshot, claim with proof |
| 23 | Holder Reward Distribution | Distribute ETH/token rewards to all holders based on percentage held | Dividend tracker, claim system, snapshots |
| 24 | Meme Contest Platform | Submit memes, community votes, winners get token rewards | Submission, voting period, prize pool |
| 25 | Referral / Invite System | Earn token rewards for bringing new buyers — tracked on-chain | Referral codes, multi-level, reward calc |
| # | Project | Description | Key Concepts |
|---|---|---|---|
| 26 | Memecoin Launchpad (Full Platform) | Create → launch → trade → graduate to DEX — with real-time charts and chat | End-to-end, bonding curve, charting, social |
| 27 | Token Analytics Dashboard | Holder distribution, whale alerts, buy/sell volume, top traders | Indexer, charts, real-time WebSocket feeds |
| 28 | Memecoin Screener | Scan new launches — filter by age, liquidity, holder count, safety score | Multi-source data, scoring algorithm |
| 29 | Social Trading Feed | Twitter/Farcaster-style feed of token launches, buys, and calls | Social feed, on-chain events, aggregation |
| 30 | Mobile Meme Trading App | React Native app — discover, buy, sell memecoins with one-tap actions | Mobile UX, wallet integration, push alerts |
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ CREATE │───►│ LAUNCH │───►│ TRADE │───►│ GRADUATE │───►│ DEX │
│ │ │ │ │ │ │ (optional) │ │ LISTING │
│ Deploy │ │ Bonding │ │ Buy/sell │ │ │ │ │
│ token │ │ curve OR │ │ on curve │ │ Hit market│ │ Uniswap │
│ contract │ │ direct │ │ or DEX │ │ cap target│ │ pair │
│ │ │ DEX pair │ │ │ │ │ │ created │
│ Set │ │ │ │ Price │ │ Auto- │ │ │
│ params │ │ Initial │ │ discovery │ │ migrate │ │ LP locked │
│ │ │ liquidity │ │ │ │ liquidity │ │ or burned │
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
┌──────────────────────────────────────────────────────────────────────────┐
│ PUMP.FUN-STYLE LAUNCH │
│ │
│ PHASE 1: BONDING CURVE │
│ │
│ Price │
│ │ ╱── $69K market cap │
│ │ ╱───╱ (graduation target) │
│ │ ╱───╱ │
│ │ ╱───╱ │
│ │ ╱───╱ │
│ │ ╱───╱ │
│ │╱───╱ │
│ └───────────────────────────────────────► Supply Sold │
│ 0 800M tokens (~80% of supply) │
│ │
│ Rules: │
│ • Total supply: 1 billion tokens │
│ • 800M available on bonding curve │
│ • 200M reserved for DEX liquidity │
│ • No presale, no team allocation, no insider access │
│ • Anyone can buy/sell at any time on the curve │
│ │
│ PHASE 2: GRADUATION (market cap hits target) │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 1. Bonding curve trading STOPS │ │
│ │ 2. ETH collected (~$69K) sent to create Uniswap V2 pair │ │
│ │ 3. 200M reserved tokens paired with ETH as initial liquidity │ │
│ │ 4. LP tokens BURNED (liquidity permanently locked) │ │
│ │ 5. Trading continues on Uniswap (open market) │ │
│ │ │ │
│ │ Bonding Curve ════════════════════════► Uniswap V2 Pool │ │
│ │ (controlled pricing) (free market pricing) │ │
│ │ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ Fee Structure: │
│ ├── 1% on every bonding curve trade → Protocol treasury │
│ └── After graduation → standard DEX fees (0.3% LP fee) │
└──────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────┐
│ TAX TOKEN MECHANICS │
│ │
│ Alice sends 1000 $MEME to Bob │
│ │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Transfer: 1000 $MEME │ │
│ │ │ │
│ │ Buy Tax: 5% Sell Tax: 5% │ │
│ │ (on buys from DEX) (on sells to DEX) │ │
│ │ │ │
│ │ Tax Distribution (50 tokens = 5% of 1000): │ │
│ │ ┌────────────────────────────────────────────────────────────┐ │ │
│ │ │ Marketing Wallet: 40% of tax = 20 tokens │ │ │
│ │ │ Auto-LP: 30% of tax = 15 tokens │ │ │
│ │ │ Burn: 20% of tax = 10 tokens → 🔥 forever │ │ │
│ │ │ Dev Wallet: 10% of tax = 5 tokens │ │ │
│ │ └────────────────────────────────────────────────────────────┘ │ │
│ │ │ │
│ │ Bob receives: 950 $MEME (1000 - 50 tax) │ │
│ │ │ │
│ │ Auto-LP mechanism: │ │
│ │ When contract accumulates enough tax tokens: │ │
│ │ 1. Swap half for ETH on Uniswap │ │
│ │ 2. Pair remaining tokens + ETH │ │
│ │ 3. Add liquidity to Uniswap pool │ │
│ │ 4. LP tokens sent to dead address (burned) │ │
│ │ → Continuously growing, permanent liquidity floor │ │
│ └──────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────┐
│ SNIPER BOT vs ANTI-SNIPE PROTECTION │
│ │
│ WITHOUT Protection: │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Block N: Dev adds liquidity to Uniswap │ │
│ │ Block N: Sniper bot detects addLiquidity in mempool │ │
│ │ Block N: Bot sends buy tx with higher gas (front-runs) │ │
│ │ Block N+1: Bot owns 30% of supply at launch price │ │
│ │ Block N+5: Regular users buy → price pumps │ │
│ │ Block N+10: Bot dumps → regular users left holding bags │ │
│ └──────────────────────────────────────────────────────────────────┘ │
│ │
│ WITH Anti-Snipe Protection: │
│ ┌──────────────────────────────────────────────────────────────────┐ │
│ │ Block N: Dev adds liquidity + enables trading │ │
│ │ │ │
│ │ Blocks N to N+5 (first 5 blocks): │ │
│ │ ├── Max buy: 1% of supply per wallet │ │
│ │ ├── Buy tax: 30% (high deterrent) │ │
│ │ ├── Sell blocked (must hold minimum 2 blocks) │ │
│ │ └── Transfer to other wallets blocked │ │
│ │ │ │
│ │ Blocks N+6 to N+20 (cooldown): │ │
│ │ ├── Max buy: 2% of supply per wallet │ │
│ │ ├── Buy tax: 15% (decreasing) │ │
│ │ └── Sell allowed (normal tax) │ │
│ │ │ │
│ │ Block N+20+ (normal trading): │ │
│ │ ├── Max buy: 3% of supply per wallet │ │
│ │ ├── Buy/sell tax: 5% (normal) │ │
│ │ └── All restrictions lifted │ │
│ └──────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────┐
│ LAUNCHPAD FRONTEND │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Create Token │ │ Trading View │ │ Token Page │ │ Portfolio │ │
│ │ (name, ticker │ │ (real-time │ │ (holders, │ │ (my tokens, │ │
│ │ image, desc) │ │ chart, book)│ │ txs, socials│ │ PnL, history│ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
└─────────┼─────────────────┼─────────────────┼─────────────────┼─────────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ SMART CONTRACTS │
│ │
│ ┌──────────────┐ ┌──────────────────┐ ┌──────────────────────────────┐ │
│ │ Token Factory │ │ Bonding Curve │ │ DEX Migration Module │ │
│ │ │ │ (per token) │ │ │ │
│ │ • createToken │ │ │ │ • checkGraduation() │ │
│ │ (name, │ │ • buy() │ │ • createUniswapPair() │ │
│ │ symbol, │ │ • sell() │ │ • addLiquidity() │ │
│ │ image) │ │ • getPrice() │ │ • burnLPTokens() │ │
│ │ │ │ • marketCap() │ │ • lockTrading(curve) │ │
│ │ Deploys: │ │ • graduated? │ │ │ │
│ │ ERC-20 + │ │ │ │ Triggered automatically │ │
│ │ BondingCurve │ │ Reserve: ETH │ │ when marketCap >= target │ │
│ └──────────────┘ └──────────────────┘ └──────────────────────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────────┐ ┌──────────────────────────────┐ │
│ │ Fee Collector │ │ LP Lock Vault │ │ Comment/Social Module │ │
│ │ │ │ │ │ │ │
│ │ 1% trade fee │ │ Lock LP tokens │ │ • comment(tokenAddr, msg) │ │
│ │ → treasury │ │ for graduated │ │ • like(tokenAddr) │ │
│ │ │ │ tokens │ │ • reply(commentId, msg) │ │
│ └──────────────┘ └──────────────────┘ └──────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────┐
│ RUG PULL DETECTION PIPELINE │
│ │
│ New Token Detected │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ STATIC ANALYSIS (contract bytecode) │ │
│ │ │ │
│ │ ✓ Check: owner can mint unlimited tokens? → RED FLAG │ │
│ │ ✓ Check: hidden transfer restrictions (honeypot)? → RED FLAG │ │
│ │ ✓ Check: proxy contract (upgradeable)? → WARNING │ │
│ │ ✓ Check: blacklist function exists? → WARNING │ │
│ │ ✓ Check: max wallet/tx limits reasonable? → INFO │ │
│ │ ✓ Check: ownership renounced? → SAFE │ │
│ └──────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ DYNAMIC ANALYSIS (simulate transactions) │ │
│ │ │ │
│ │ ✓ Simulate: buy → does it succeed? │ │
│ │ ✓ Simulate: buy → sell → does sell succeed? → HONEYPOT? │ │
│ │ ✓ Simulate: buy → sell → check received amount → HIGH TAX? │ │
│ │ ✓ Simulate: buy 5% supply → is it blocked? → MAX LIMIT? │ │
│ └──────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ LIQUIDITY ANALYSIS │ │
│ │ │ │
│ │ ✓ LP tokens locked? (Team.finance, Unicrypt) → SAFE │ │
│ │ ✓ LP tokens burned? (sent to dead address) → SAFEST │ │
│ │ ✓ LP tokens in dev wallet? (can rug anytime) → RED FLAG │ │
│ │ ✓ Lock duration: > 6 months? → SAFE │ │
│ │ ✓ Lock duration: < 30 days? → WARNING │ │
│ └──────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ HOLDER ANALYSIS │ │
│ │ │ │
│ │ ✓ Top 10 holders own < 30% supply? → OK │ │
│ │ ✓ Top holder is not the deployer? → OK │ │
│ │ ✓ Holder count > 100? → DISTRIBUTED │ │
│ │ ✓ Deployer holds < 5%? → SAFE │ │
│ │ ✓ Cluster analysis: connected wallets? → SYBIL CHECK │ │
│ └──────────────────────────────┬─────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ SAFETY SCORE: 0-100 │ │
│ │ │ │
│ │ 0-30: 🔴 HIGH RISK (likely rug / honeypot) │ │
│ │ 31-60: 🟡 MEDIUM RISK (some red flags) │ │
│ │ 61-80: 🟢 LOW RISK (reasonable safety) │ │
│ │ 81-100: ✅ SAFE (LP locked, renounced, clean code) │ │
│ └────────────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────┐
│ REFLECTION TOKEN (SAFEMOON-STYLE) │
│ │
│ How it works: │
│ Every transaction distributes a portion to ALL holders automatically │
│ │
│ Transaction: Alice sells 10,000 $REFLECT │
│ │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ 5% tax on sell = 500 tokens │ │
│ │ │ │
│ │ 500 tokens distributed: │ │
│ │ ┌──────────────────────────────────────────────────────────────┐ │ │
│ │ │ │ │ │
│ │ │ Bob (holds 10% of supply) → receives 50 tokens │ │ │
│ │ │ Carol (holds 5% of supply) → receives 25 tokens │ │ │
│ │ │ Dave (holds 1% of supply) → receives 5 tokens │ │ │
│ │ │ ... every other holder gets proportional share │ │ │
│ │ │ │ │ │
│ │ │ No claiming needed — balance increases automatically │ │ │
│ │ │ Uses rOwned/tOwned ratio (reflection math) │ │ │
│ │ │ │ │ │
│ │ └──────────────────────────────────────────────────────────────┘ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ Key insight: no loops over holders needed! │
│ Uses a "reflection rate" that adjusts globally: │
│ • rTotal / tTotal = current rate │
│ • balanceOf(user) = rOwned[user] / currentRate │
│ • When tax is taken: rTotal decreases, rate changes │
│ • Every holder's balanceOf() increases automatically │
└──────────────────────────────────────────────────────────────────────────┘
memecoin-projects/
├── 01-standard-memecoin/
│ ├── src/
│ │ └── Memecoin.sol
│ ├── test/
│ │ └── Memecoin.t.sol
│ ├── foundry.toml
│ └── README.md
├── 02-tax-token/
│ ├── src/
│ │ ├── TaxToken.sol
│ │ ├── FeeRouter.sol
│ │ └── interfaces/
│ │ └── IUniswapV2Router.sol
│ ├── test/
│ │ └── fork/
│ └── README.md
├── 06-pumpfun-clone/
│ ├── src/
│ │ ├── TokenFactory.sol
│ │ ├── BondingCurve.sol
│ │ ├── DEXMigrator.sol
│ │ └── libraries/
│ │ └── CurveLib.sol
│ ├── test/
│ │ ├── BondingCurve.t.sol
│ │ ├── Migration.t.sol
│ │ └── invariant/
│ ├── frontend/
│ │ ├── src/
│ │ │ ├── components/
│ │ │ │ ├── CreateToken.tsx
│ │ │ │ ├── TradingChart.tsx
│ │ │ │ ├── TokenCard.tsx
│ │ │ │ └── TradePanel.tsx
│ │ │ ├── hooks/
│ │ │ └── pages/
│ │ └── package.json
│ └── README.md
├── 11-liquidity-lock/
│ ├── src/
│ │ └── LPLocker.sol
│ ├── test/
│ └── README.md
├── 13-honeypot-detector/
│ ├── src/
│ │ ├── HoneypotDetector.sol
│ │ └── SimulationEngine.ts
│ ├── test/
│ └── README.md
├── 16-sniper-bot/
│ ├── src/
│ │ ├── sniper.ts
│ │ ├── mempool.ts
│ │ ├── executor.ts
│ │ └── config.ts
│ ├── test/
│ └── README.md
├── 26-launchpad-platform/
│ ├── contracts/
│ ├── frontend/
│ ├── indexer/
│ ├── bot/
│ └── README.md
├── lib/ # Shared Solidity dependencies
│ ├── forge-std/
│ ├── openzeppelin-contracts/
│ ├── v2-periphery/ # Uniswap V2 Router
│ ├── v2-core/ # Uniswap V2 Factory
│ └── solmate/
├── interfaces/ # Common interfaces
│ ├── IUniswapV2Router02.sol
│ ├── IUniswapV2Factory.sol
│ ├── IUniswapV2Pair.sol
│ ├── IBondingCurve.sol
│ └── ILPLocker.sol
├── libraries/ # Shared utilities
│ ├── BondingCurveLib.sol
│ ├── TaxLib.sol
│ ├── ReflectionLib.sol
│ └── AntiSnipeLib.sol
└── README.md
- Foundry —
curl -L https://foundry.paradigm.xyz | bash && foundryup - Node.js >= 18.x (for bots, frontends, and tooling)
- Git
- MetaMask or any EVM wallet
- An RPC provider (Alchemy or Infura)
# Clone the repository
git clone https://github.com/pranay123-stack/memecoin-projects.git
cd memecoin-projects
# Navigate to a project
cd 06-pumpfun-clone
# Install dependencies
forge install
# Build
forge build
# Run tests
forge test -vvv
# Start frontend
cd frontend && pnpm install && pnpm devcp .env.example .env# RPC Endpoints
MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
BASE_RPC_URL=https://base-mainnet.g.alchemy.com/v2/YOUR_KEY
BSC_RPC_URL=https://bsc-mainnet.g.alchemy.com/v2/YOUR_KEY
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/YOUR_KEY
# WebSocket (for mempool monitoring)
MAINNET_WSS_URL=wss://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
BASE_WSS_URL=wss://base-mainnet.g.alchemy.com/v2/YOUR_KEY
# Deployment
PRIVATE_KEY=your_deployer_private_key
ETHERSCAN_API_KEY=your_etherscan_api_key
# DEX
UNISWAP_V2_ROUTER=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
UNISWAP_V2_FACTORY=0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
# Safety APIs
GOPLUS_API_KEY=your_goplus_keyNever commit private keys. All projects include
.gitignorewith.envexcluded.
# Compile
forge build
# Run all tests
forge test
# Fork test against live Uniswap
forge test --fork-url $MAINNET_RPC_URL --match-path "test/fork/*" -vvv
# Gas report (critical for tax token efficiency)
forge test --gas-report
# Deploy
forge script script/Deploy.s.sol --rpc-url $BASE_RPC_URL --broadcast --verify
# Create a Uniswap pair
cast send $UNISWAP_FACTORY "createPair(address,address)" $TOKEN $WETH \
--rpc-url $BASE_RPC_URL --private-key $PRIVATE_KEYcd 16-sniper-bot
# Install
pnpm install
# Run in simulation mode (no real trades)
pnpm start --simulate
# Run live (caution: uses real funds)
pnpm start --live --chain base# Unit Tests — token mechanics (tax, reflection, burn)
forge test --match-path "test/unit/*"
# Integration Tests — full launch → trade → graduate lifecycle
forge test --match-path "test/integration/*"
# Fuzz Tests — random amounts, edge case discovery
forge test --match-path "test/fuzz/*"
# Invariant Tests — properties that must always hold
forge test --match-path "test/invariant/*"
# Fork Tests — test against live Uniswap V2
forge test --match-path "test/fork/*" --fork-url $MAINNET_RPC_URL// Total supply must be conserved (including burned tokens)
function invariant_supplyConservation() public {
uint256 circulating = token.totalSupply();
uint256 burned = token.balanceOf(address(0xdead));
assertEq(circulating + burned, INITIAL_SUPPLY);
}
// Tax must never exceed configured maximum
function invariant_taxBounded() public {
assertLe(token.buyTax(), token.MAX_TAX());
assertLe(token.sellTax(), token.MAX_TAX());
}
// Bonding curve reserve must always cover all possible sells
function invariant_curveReserveSolvent() public {
uint256 totalSellValue;
for (uint i = 0; i < buyers.length; i++) {
totalSellValue += curve.getSellPrice(token.balanceOf(buyers[i]));
}
assertGe(address(curve).balance, totalSellValue);
}
// Bonding curve: buy price must always > sell price (no arbitrage)
function invariant_noInstantArbitrage() public {
uint256 buyPrice = curve.getBuyPrice(1e18);
uint256 sellPrice = curve.getSellPrice(1e18);
assertGt(buyPrice, sellPrice);
}
// LP lock: locked LP cannot be withdrawn before expiry
function invariant_lpLockEnforced() public {
if (block.timestamp < locker.lockExpiry(lockId)) {
vm.prank(deployer);
vm.expectRevert("Lock not expired");
locker.withdraw(lockId);
}
}
// Anti-snipe: first-block buys must respect max limit
function invariant_antiSnipeLimits() public {
if (block.number <= token.launchBlock() + token.sniperBlocks()) {
// Any buy exceeding limit should revert
vm.prank(buyer);
vm.expectRevert();
token.transfer(buyer, token.maxBuyFirstBlocks() + 1);
}
}
// Reflection: total reflected must equal total tax taken minus burns
function invariant_reflectionAccounting() public {
assertEq(
token.totalReflected(),
token.totalTaxCollected() - token.totalBurned() - token.totalToLP()
);
}
// Graduation: once graduated, bonding curve must be permanently locked
function invariant_graduationIrreversible() public {
if (curve.graduated()) {
vm.expectRevert("Curve graduated");
curve.buy{value: 1 ether}();
}
}| Attack | Description | Mitigation |
|---|---|---|
| Rug Pull (LP removal) | Dev removes liquidity, leaving token with zero backing | LP lock/burn, bonding curve auto-migration |
| Honeypot | Token allows buys but blocks sells via hidden logic | Sell simulation, bytecode analysis |
| Hidden Mint | Owner can mint unlimited tokens and dump on holders | No mint function, or renounced ownership |
| Blacklist Function | Owner blacklists addresses from selling | No blacklist, or renounced ownership |
| Proxy Upgrade Rug | Upgradeable proxy — owner swaps logic to drain or honeypot | No proxy, or multi-sig + timelock on upgrades |
| Tax Change Rug | Owner raises tax to 99% after community invests | Max tax cap in contract (e.g., MAX_TAX = 10%) |
| Sniper Bot Front-Run | Bot buys in same block as LP creation, dumps on community | Anti-snipe: max buy in first N blocks, high tax |
| Sandwich Attack | MEV bot wraps user trades to extract value | Slippage protection, private mempool, MEV blocker |
| Flash Loan Governance Attack | Borrow tokens to vote, then return them | Snapshot-based voting, holding period |
| Fake Renounce | Owner "renounces" but retains control via hidden function/proxy | Verify bytecode, check for delegatecall |
| Team Wallet Dump | Large team allocation dumped on market | Vesting contracts, transparent allocation |
| Wash Trading | Fake volume to attract real buyers | Minimum hold periods, volume analysis |
- Ownership renounced OR behind multi-sig with timelock
- No hidden mint, pause, or blacklist functions
- Tax has immutable maximum cap (e.g., MAX_TAX = 10%)
- LP tokens locked for 6+ months or permanently burned
- Not an upgradeable proxy (or proxy with transparent governance)
- Anti-snipe protection for first N blocks post-launch
- Max wallet and max transaction limits
- Sell simulation passes (not a honeypot)
- Contract verified and source code matches deployment
- No external calls to untrusted contracts
- Reentrancy guards on swap and tax distribution functions
- Team tokens vested with on-chain schedule
| Network | Chain ID | Gas Cost | Why |
|---|---|---|---|
| Base | 8453 | ~$0.01 | Pump.fun competitor ecosystem, Aerodrome DEX, low fees |
| Ethereum | 1 | $5-50 | Uniswap home, highest liquidity, OG meme culture |
| BSC | 56 | ~$0.10 | PancakeSwap, massive retail user base |
| Arbitrum | 42161 | ~$0.05 | Growing meme ecosystem, Camelot DEX |
| Polygon | 137 | ~$0.01 | Low fees, QuickSwap |
| Sepolia | 11155111 | Free | Testing |
# 1. Deploy token contract
forge script script/DeployMemecoin.s.sol \
--rpc-url $BASE_RPC_URL --broadcast --verify
# 2. Create Uniswap V2 pair
cast send $UNISWAP_FACTORY "createPair(address,address)" $TOKEN $WETH \
--rpc-url $BASE_RPC_URL --private-key $PRIVATE_KEY
# 3. Add initial liquidity
cast send $UNISWAP_ROUTER "addLiquidityETH(address,uint256,uint256,uint256,address,uint256)" \
$TOKEN $SUPPLY_FOR_LP 0 0 $DEPLOYER $DEADLINE \
--value 1ether --rpc-url $BASE_RPC_URL --private-key $PRIVATE_KEY
# 4. Lock LP tokens
cast send $LP_LOCKER "lock(address,uint256,uint256)" \
$LP_TOKEN $LP_AMOUNT $LOCK_UNTIL \
--rpc-url $BASE_RPC_URL --private-key $PRIVATE_KEY
# 5. Renounce ownership (irreversible!)
cast send $TOKEN "renounceOwnership()" \
--rpc-url $BASE_RPC_URL --private-key $PRIVATE_KEY
# 6. Verify contract
forge verify-contract $TOKEN src/Memecoin.sol:Memecoin --chain base| Concept | Description |
|---|---|
| Memecoin | Cryptocurrency inspired by internet memes/culture — value driven by community |
| Fair Launch | No presale, no team allocation — everyone buys on the open market equally |
| Bonding Curve | Mathematical function that determines price based on token supply |
| Graduation | Bonding curve reaches target → liquidity auto-migrates to Uniswap |
| Tax Token | ERC-20 with buy/sell fees routed to marketing, LP, burn, or rewards |
| Reflection Token | Holders earn passive rewards from every transaction (SafeMoon-style) |
| Deflationary Token | Supply decreases over time through burn-on-transfer mechanics |
| Rebase Token | Supply adjusts automatically based on target price or schedule |
| Liquidity Pool (LP) | Paired tokens on a DEX (e.g., MEME/ETH) enabling trading |
| LP Lock | LP tokens locked in a timelock vault — proves dev can't pull liquidity |
| LP Burn | LP tokens sent to dead address — liquidity permanently locked |
| Rug Pull | Developer removes liquidity or exploits hidden function to steal funds |
| Honeypot | Token that allows buying but blocks selling — trap for traders |
| Sniper Bot | Automated bot that buys tokens in the first block of liquidity addition |
| Anti-Snipe | Protection against bots — max buy limits, high tax in first blocks |
| MEV (Maximal Extractable Value) | Value extracted by reordering/inserting transactions (front-run, sandwich) |
| Sandwich Attack | MEV bot places buy before and sell after your trade to extract value |
| Max Wallet | Maximum percentage of supply any single wallet can hold |
| Max Transaction | Maximum tokens transferable in a single transaction |
| Renounce Ownership | Permanently give up admin control over the token contract |
| Dead Address (0xdead) | Address where tokens are sent to be burned permanently |
| DYOR | "Do Your Own Research" — essential mantra in memecoin trading |
A snapshot of the memecoin sector:
| Token | Chain | What Made It Notable |
|---|---|---|
| DOGE | Dogecoin (own) | Original memecoin (2013), Elon Musk influence, Dogecoin blockchain |
| SHIB | Ethereum | "Dogecoin killer", massive community, ShibaSwap ecosystem |
| PEPE | Ethereum | Pepe the Frog meme, no tax, pure community, 2023 breakout |
| WIF | Solana | "Dogwifhat" — Solana memecoin culture, bonk-era |
| BONK | Solana | Solana community airdrop, revived Solana ecosystem |
| FLOKI | ETH + BSC | Named after Elon's dog, cross-chain, utility expansion |
| BRETT | Base | Leading Base chain memecoin, blue character meme |
| TURBO | Ethereum | First ChatGPT-created memecoin, AI × meme culture |
| MOG | Ethereum | "Mogging" culture coin, strong CT community |
| SPX | Ethereum | SPX6900 — anti-establishment satire memecoin |
| TRUMP | Solana | Political meme token, massive cultural moment |
| FARTCOIN | Solana | Pure absurdity, viral community |
| Platform | Chain | Model |
|---|---|---|
| Pump.fun | Solana | Bonding curve → Raydium migration at $69K mcap |
| Four.meme | BSC | PancakeSwap-based launcher with bonding curves |
| ape.store | Multi-chain | Cross-chain meme token deployer |
| GMGN.ai | Multi-chain | AI-powered memecoin trading and analytics |
| Moonshot | Solana | Mobile-first meme token trading app |
- Foundry Book
- OpenZeppelin ERC-20
- Uniswap V2 Docs
- Uniswap V2 Core (GitHub)
- Solmate — Gas-optimized contracts
- GoPlus Security API — Token security analysis
- TokenSniffer — Automated rug detection
- DEXScreener — Real-time DEX charts and analytics
- BubbleMaps — Token holder visualization
- Honeypot.is — Honeypot detection tool
- Flashbots — MEV protection and research
- MEV Blocker — Transaction protection RPC
- EigenPhi — MEV analytics and research
- Pump.fun Docs — Bonding curve launchpad reference
- Bonding Curve Theory (a16z) — Mathematical foundations
- Continuous Token Models — Bonding curve deep dive
- Trail of Bits
- Slither — Static analysis
- Echidna — Fuzzer
Contributions are welcome! Whether it's a new token mechanism, safety tool, or trading bot:
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-memecoin-feature) - Follow the existing project structure
- Include comprehensive tests (unit + fuzz + invariant + fork)
- Add a
README.mdwith mechanics explanation and security analysis - Submit a pull request
High-impact contribution ideas:
- Bonding curve with configurable curve shapes (linear, exponential, custom)
- On-chain token reputation score (automated safety rating)
- Batch token deployer with anti-rug defaults
- MEV-protected trading router
- Real-time whale alert notification system
- Cross-chain memecoin bridge
This repository is licensed under the MIT License.
Memes are the language of the internet. Memecoins are the language of on-chain culture. Understand the engineering — whether you're building, trading, or protecting yourself.