A repository for deploying Solidity smart contracts to EVM compatible chains.
Leveraging Hardhat and Open Zeppelin
NodeJS v14.16.1
$ npm install
- Create a
.env
file:
DEPLOYER_PRIVATE_KEY=<PRIVATE_KEY_WITHOUT_0X_PREFIX>
INFURA_PROJECT_ID=<INFURA_PROJECT_ID> (Ethereum only)
- Fund your account with the corresponding protocol token. Use the following faucets for testnet:
- Deploy your contract
npx hardhat deploy --network <NETWORK> --tags <SOLIDITY_CONTRACT>
The NETWORK
must be defined in hardhat.config.ts
.
To add a network to the configuration file, add an object key under networks
with:
- The JSON-RPC URL.
- The corresponding chain ID (listed here)
For example, to deploy ERC20.sol
to the Kovan
testnet:
npx hardhat deploy --network kovan --tags ERC20
A deployment will be recorded in the deployments/
folder under the relevant network with the contract address and EVM bytecode.
Adding the --reset
option to the above command resets the deployments from scratch – ignoring
previous deployments and deleting them from the disk.