Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1019 Bytes

File metadata and controls

43 lines (31 loc) · 1019 Bytes

Truffle Deployment Example for 0G Testnet V3

This directory contains an example of deploying an ERC20 token (MyToken.sol) to the 0G Testnet V3 (Chain ID: 80087) using Truffle.

Prerequisites

  • Node.js and npm
  • Truffle (npm install -g truffle)

Setup

  1. Install dependencies:
    npm install
  2. Create a .env file in this directory (truffle/.env) by copying the example:
    cp .env.example .env
  3. Edit the .env file and add your private key and the 0G Testnet V3 RPC URL:
    PRIVATE_KEY="YOUR_PRIVATE_KEY_HERE"
    RPC_URL="https://rpc-testnet.0g.ai"
    Important: Ensure the private key corresponds to an account with funds on the 0G Testnet V3.

Compilation

Compile the contracts:

truffle compile

Deployment

Deploy the MyToken contract to the 0G Testnet V3:

truffle migrate --network og_testnet_v3

Truffle will output the transaction hash and the address of the deployed contract.