Skip to content

amends0k/example-deployment

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 78.0%
  • Solidity 22.0%