Hardhat
Hardhat
Hardhat is an Ethereum development environment. Compile your contracts and run them on a development network. Get Solidity stack traces, console.log and more.
You can use Hardhat to edit, compile, debug, and deploy your smart contracts to Mint.
Creating a Hardhat Project
Create a directory for your project:
mkdir hardhat && cd hardhatInitialize the project, which will create a
package.jsonfile
npm init -yInstall Hardhat
npm install hardhatCreate a project
npx hardhatCreate an empty
hardhat.config.jsand install the Ethers plugin to use the Ethers.js library to interact with the network.
npm install @nomiclabs/hardhat-ethers ethersCreating Your Smart Contract
Create a
contractsdirectory
Create
your_contract.solfile incontractsdirectory
Creating Your Configuration File
Modify the Hardhat configuration file and create a secure file to store your private key in.
Create a
secrets.jsonfile to store your private key
Add your private key to
secrets.json
Add the file to your project’s
.gitignore, and never reveal your private key.Modify the
hardhat.config.jsfileImport the Ethers.js plugin
Import the
secrets.jsonfileInside the
module.exportsadd the FlexNet TestNet network configuration
Last updated