This directory contains an example of deploying an ERC20 token (MyToken.sol) to the 0G Testnet V3 (Chain ID: 80087) using Truffle.
- Node.js and npm
- Truffle (
npm install -g truffle)
- Install dependencies:
npm install
- Create a
.envfile in this directory (truffle/.env) by copying the example:cp .env.example .env
- Edit the
.envfile and add your private key and the 0G Testnet V3 RPC URL:Important: Ensure the private key corresponds to an account with funds on the 0G Testnet V3.PRIVATE_KEY="YOUR_PRIVATE_KEY_HERE" RPC_URL="https://rpc-testnet.0g.ai"
Compile the contracts:
truffle compileDeploy the MyToken contract to the 0G Testnet V3:
truffle migrate --network og_testnet_v3Truffle will output the transaction hash and the address of the deployed contract.