Deploy using Hardhat
If you wish to deploy a smart contract using Hardhat, the first step would be to set up your environment.
Setting up your environment for Hardhat
To create, write and compile a contract in Hardhat, please refer to the following tutorials:
To deploy to the HPB network, you'll need to modify the Hardhat configuration file and create a secure file to store your private key in.
You can create a secrets.json
file to store your private key by running:
Then add your private key to it:
Make sure to add the file to your project's .gitignore
, and to never reveal your private key.
Please always manage your private keys with a designated secret manager or similar service. Never save or commit your private keys inside your repositories.
Next you can take the following steps to modify the hardhat.config.js
file and add HPB as a network:
Import the Ethers plugin
Import the
secrets.json
fileInside the
module.exports
, you need to provide the Solidity version (0.8.1
according to our contract file)Add the HPB network configuration
Last updated