Skip to content

kirilradkov14/launchpad-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4be9b40 ยท Feb 1, 2025

History

54 Commits
Jan 13, 2025
Jan 13, 2025
Jan 14, 2025
Jan 6, 2025
Feb 1, 2025
Feb 1, 2025
Feb 1, 2025
Jan 14, 2025
Jan 19, 2025
Jan 6, 2025
Feb 1, 2025
Jan 14, 2025
Jan 13, 2025
Jan 13, 2025
Jan 13, 2025
Jan 6, 2025
Jan 15, 2025

Repository files navigation

๐Ÿš€ EVM Launchpad Contract - Gas Efficient Token Launchpad Smart Contract

EVM-compatible Launchpad System inspired by pump.fun featuring zero-liquidity launches and automated price discovery through an exponential bonding curve. Designed for secure, transparent, and efficient token distribution.

Solidity Version License: MIT Test Coverage

๐Ÿ“– Table of Contents

๐ŸŒŸ Key Features

๐Ÿ— Proxy-Factory Pattern

  • Gas-Optimized Deployment: reduction in deployment costs through minimalistic clone contracts
  • Upgradeable Logic: Separate storage and logic contracts for future improvements
  • Standardized Launches: Uniform contract structure across all launched tokens

๐Ÿ“ˆ Exponential Bonding Curve

  • Instant Liquidity: No pre-locking required - liquidity forms as users buy
  • Fair Price Discovery: Algorithmic price adjustment based on market activity

๐Ÿ”„ Automated Liquidity Migration

  • Seamless Uniswap Transition: Migrates liquidity to Uniswap V2 at threshold
  • LP Token Distribution: Fair LP allocation to token holders
  • Price Continuity: Smooth transition from bonding curve to AMM

๐Ÿ› Architecture

Loading
graph TD;
    A[Factory Contract] -->|Deploys| B[Proxy Contract];
    B -->|References| C[Logic Contract];
    C -->|Interacts With| D[Bonding Curve];
    D -->|Migrates LP| E[UniswapV2Router];

๐Ÿงฎ Bonding Curve Mathematics

Buy Mechanism

T = e โˆ’ k S โˆ’ e โˆ’ k ( S + E ) k P โ‚€

T: Tokens received

S: Current ETH supply (contract balance)

E: ETH amount sent

k: Curve steepness parameter

Pโ‚€: Initial price per token

Sell Mechanism

S โ€ฒ = โˆ’ ln โก ( 1 โˆ’ k P โ‚€ ( T t o t a l โˆ’ T i n ) ) k E = S โˆ’ S โ€ฒ

S': New ETH supply after sale

T_total: Total token supply

T_in: Tokens being sold

๐Ÿš€ Getting Started

Prerequisites

  • Foundry (latest version)
  • ETH RPC URL (for deployment)
  • ETHERSCAN API KEY (for deployment)

Installation

# Clone repository
git clone https://github.com/kirilradkov14/launchpad-contracts.git
cd launchpad-contracts

# Install dependencies
forge install

# Setup environment
cp .env.example .env

๐Ÿ”ง Configuration

Update .env with your settings:

RPC_URL="https://eth-mainnet.alchemyapi.io/v2/your-key"
PRIVATE_KEY="your_wallet_private_key"
ETHERSCAN_API_KEY="your_etherscan_key"

๐Ÿ› ๏ธ Build & Test

# Compile contracts
forge build

# Run all tests
forge test -vvv

# Run specific test suite
forge test --match-contract LaunchpadTests

๐ŸŒ Deployment

Mainnet

./deploy.sh mainnet

Testnet

./deploy.sh holesky

Local Development

# Start local node
anvil

# In anvil terminal
forge script script/LaunchpadFactory.s.sol:LaunchpadDeployerScript --rpc-url http://localhost:8545 --broadcast

๐Ÿ“Š Test Coverage

forge coverage --report debug

Current Coverage:

  • unit tests: 60%
  • fuzz tests: 25%

๐Ÿ”’ Security

Audit Status

โš ๏ธ Not Audited - This code is experimental. Use at your own risk.

Critical Considerations

  • Thorough Testing: Always test on testnets with equivalent conditions
  • Parameter Validation: Carefully configure curve parameters (k, Pโ‚€)
  • Migration Thresholds: Set appropriate liquidity migration triggers
  • Frontrunning Protection: Consider implementing commit-reveal schemes

๐Ÿค Contributing

If (by any chance) you want to contribute:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“œ License

Distributed under the MIT License. See LICENSE for more information.

โญ๏ธ Support the Project

If you find this useful, please consider:

  • Giving a โญ๏ธ on GitHub
  • Contributing to development
  • Following me for more trending projects

Happy launching! ๐Ÿš€