Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.87 KB

README.md

File metadata and controls

65 lines (43 loc) · 1.87 KB

Example-deployment

Initial setup

  1. Add a .env file (in the hardhat/truffle folder of the project) that contains the PRIVATE_KEY of the wallet that will be used to deploy the contracts and API_KEY (if you want to verify using hardhat-etherscan)
PRIVATE_KEY = XXXXXXXXXX
API_KEY = XXXXXXX
  1. Install dotenv to allow the config files to read PRIVATE_KEY from .env file
npm i dotenv

Hardhat

  1. Create a deployment script

2

  1. Update the hardhat.config.js file with these networks

3

  1. Run the following command to deploy the contract

Mainnet

npx hardhat run --network mainnet scripts/sample-script.js

Testnet

npx hardhat run --network testnet scripts/sample-script.js
  1. You should see the deployed contract address

4

Truffle

  1. Create a deployment script

2

  1. Update the truffle-config.js file with these networks

3

  1. Run the following command to deploy the contract

Mainnet

truffle migrate --network opera_mainnet

Testnet

truffle migrate --network opera_testnet
  1. You should see the deployed contract address

4