Skip to content

Pump.fun-style smart contracts for EVM chains. Launch, trade, and migrate meme tokens with built-in AMM, bonding curves, liquidity management, and Uniswap V2 integration. Built with Solidity, Hardhat, and OpenZeppelin.

Notifications You must be signed in to change notification settings

Vectorpackengine/PumpFun-EVM-Smart-Contract

 
 

Repository files navigation

Pump.fun EVM Smart Contracts

🌟 Overview

This project is a comprehensive smart contract implementation that replicates the core functionality of Pump.fun on EVM-compatible blockchains. It enables users to create, launch, and trade meme tokens with automated market making, liquidity management, and seamless Uniswap integration.

🎯 Key Features

  • ** Token Creation & Launch**: Deploy ERC20 tokens with customizable parameters
  • ** Automated Liquidity Management**: Built-in AMM with virtual liquidity pools
  • ** Token Trading**: Swap tokens for ETH with automated pricing
  • ** Uniswap Integration**: Seamless migration to Uniswap V2 when market cap targets are reached
  • ** Real-time Market Data**: Track price, market cap, volume, and liquidity metrics
  • ** User Profiles**: Manage token portfolios and trading history
  • ** Fee Management**: Configurable launch fees and referral rewards
  • ** Security**: Built with OpenZeppelin contracts and reentrancy protection

Architecture

The system consists of several interconnected smart contracts:

Core Contracts

Contract Description Purpose
PumpFun.sol Main contract Token launching, trading, and lifecycle management
TokenFactory.sol Token deployment Automated ERC20 token creation
Router.sol Trading engine Handles swaps and liquidity operations
Pair.sol Liquidity pools Manages token-ETH pairs and reserves
Token.sol ERC20 implementation Standard token with additional features

Token Lifecycle

  1. Launch Phase: Users create tokens with initial liquidity
  2. Trading Phase: Tokens trade on the internal AMM
  3. Migration Phase: Successful tokens migrate to Uniswap
  4. Uniswap Phase: Full decentralized trading on Uniswap V2

Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm or yarn
  • Git

Installation

# Clone the repository
git clone https://github.com/AlphaFox000/PumpFun-EVM-Smart-Contract.git
cd pumpdotfun_evm_smart_contract

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

Environment Setup

Create a .env file with the following variables:

PRIVATE_KEY=your_private_key_here
PRIVATE__KEY=your_private_key_here
SEPOLIA_API_URL=https://sepolia.infura.io/v3/your_project_id
MAINNET_API_URL=https://mainnet.infura.io/v3/your_project_id
ETHERSCAN_API_KEY=your_etherscan_api_key
BASE_API_KEY=your_basescan_api_key

Compilation & Testing

# Compile contracts
npx hardhat compile

# Run tests
npx hardhat test

# Deploy to testnet
npx hardhat run scripts/deploy.js --network base_sepolia

Deployment

Supported Networks

  • Ethereum Mainnet - Full production deployment
  • Base Mainnet - Optimized for low fees
  • Base Sepolia - Testnet deployment
  • Sepolia - Ethereum testnet

Deployed Contracts (Base Mainnet)

Contract Address
Factory 0x6C4390E6c7b9668DC4BBf0049aC346622c9ACB0f
Router 0xc1A2116b647e9952FB743460EEFFc2B11a2bED33
PumpFun 0x99C8BC651f7bEF8320b7a985a0d869E2cc2B7E5b

🔧 Usage

Creating a Token

// Launch a new token
function launch(
    string memory _name,
    string memory _ticker,
    string memory desc,
    string memory img,
    string[4] memory urls, // [twitter, telegram, youtube, website]
    uint256 _supply,
    uint maxTx
) public payable returns (address, address, uint)

Trading Tokens

// Buy tokens with ETH
function swapETHForTokens(
    address tk,
    address to,
    address referree
) public payable returns (bool)

// Sell tokens for ETH
function swapTokensForETH(
    uint256 amountIn,
    address tk,
    address to,
    address referree
) public returns (bool)

Security Features

  • Reentrancy Protection: All external calls protected with OpenZeppelin's ReentrancyGuard
  • Access Control: Owner-only functions for critical operations
  • Input Validation: Comprehensive zero-address and parameter checks
  • Safe Math: Built-in overflow protection with Solidity 0.8.24
  • Audit Ready: Clean, well-documented code following best practices

Market Mechanics

Pricing Algorithm

  • Bonding Curve: Automated price discovery based on supply and demand
  • Virtual Liquidity: Initial liquidity provided by the protocol
  • Market Cap Threshold: 100,000 ETH market cap triggers Uniswap migration

Fee Structure

  • Launch Fee: Configurable fee for token creation
  • Trading Fee: Small percentage on each trade
  • Referral Rewards: Up to 5% referral bonuses
  • Liquidity Fee: 5% of launch fee goes to initial liquidity

⚠️ Disclaimer

This software is provided "as is" without warranty. Use at your own risk. Always conduct thorough testing before deploying to mainnet. Some implementation details may be omitted for security reasons.

🚀 Support

For more detailed information, advanced configuration, or collaboration inquiries, please reach out to me directly. https://github.com/AlphaFox000/

⭐ Star this repository

If you find it useful! Your support helps us continue developing and improving this tool.

About

Pump.fun-style smart contracts for EVM chains. Launch, trade, and migrate meme tokens with built-in AMM, bonding curves, liquidity management, and Uniswap V2 integration. Built with Solidity, Hardhat, and OpenZeppelin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 68.4%
  • TypeScript 17.1%
  • JavaScript 14.5%