8000 GitHub - Layer-Edge/edgen-swap: 🦄 🦄 Core smart contracts of Uniswap V2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Layer-Edge/edgen-swap

 
 

Repository files navigation

Uniswap V2

Actions Status Version

In-depth documentation on Uniswap V2 is available at uniswap.org.

The built contract artifacts can be browsed via unpkg.com.

Local Development

The following assumes the use of node@>=10.

Install Dependencies

yarn

Compile Contracts

yarn compile

Run Tests

yarn test

EdgenSwap

A Uniswap V2 fork for the Base network.

Deployment Instructions

EdgenSwap uses a unified deployment process that works across all networks defined in your hardhat.config.js. The deployment script handles network-specific safety checks and provides options for contract verification.

Prerequisites

  1. Create a .env file in the project root with the following variables:

    PRIVATE_KEY=your_wallet_private_key
    BASESCAN_API_KEY=your_basescan_api_key
    BASE_MAINNET_RPC_URL=https://mainnet.base.org
    BASE_SEPOLIA_RPC_URL=https://sepolia.base.org
    FEE_SETTER_ADDRESS=address_for_fee_control (required for mainnet)
    
  2. Install dependencies:

    npm install
    

Deployment Commands

The unified deployment script supports the following networks already configured in hardhat.config.js:

  • Base Sepolia (testnet)
  • Base Mainnet

Deploy to Base Sepolia (Testnet)

npx hardhat run scripts/deploy.js --network baseSepolia

To deploy AND verify contracts:

npx hardhat run scripts/deploy.js --network baseSepolia --verify

Deploy to Base Mainnet

For mainnet deployments, you MUST set the FEE_SETTER_ADDRESS in your .env file:

npx hardhat run scripts/deploy.js --network baseMainnet

To deploy AND verify contracts:

npx hardhat run scripts/deploy.js --network baseMainnet --verify

Verification Only

If you need to verify previously deployed contracts:

npx hardhat verify --network baseSepolia CONTRACT_ADDRESS CONSTRUCTOR_ARGS

Example:

npx hardhat verify --network baseSepolia 0xYourFactoryAddress "0xFeeSetter"

Deployment Safety Features

The deployment script includes several safety features:

  • Mainnet confirmation prompts to prevent accidental deployments
  • Gas price checks before mainnet deployment
  • Required fee setter address for mainnet deployments
  • Deployment records saved to deployments/{network}/*.json
  • Verification with retry logic

Adding New Networks

To add support for additional networks:

  1. Add the network configuration to hardhat.config.js
  2. Add the appropriate API key for verification
  3. Use the existing deployment command with your new network name

Contract Addresses

Deployed contract addresses can be found in the deployments/{network}/ directory after running the deployment script.

About

🦄 🦄 Core smart contracts of Uniswap V2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 53.7%
  • TypeScript 24.5%
  • Solidity 21.8%
0