Skip to content

kalouo/hardhat-deployer

Repository files navigation

hardhat-deployer

A repository for deploying Solidity smart contracts to EVM compatible chains.

Leveraging Hardhat and Open Zeppelin

Requirements

NodeJS v14.16.1

Installation

$ npm install

Contract Deployment

  1. Create a .env file:
DEPLOYER_PRIVATE_KEY=<PRIVATE_KEY_WITHOUT_0X_PREFIX>
INFURA_PROJECT_ID=<INFURA_PROJECT_ID> (Ethereum only)
  1. Fund your account with the corresponding protocol token. Use the following faucets for testnet:
  1. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published