2. Configure hardhat.config.js
Last updated
Last updated
⚠️ Important Security WarningDo Not Commit Sensitive Information
Accidentally committing sensitive information such as seed phrases can lead to the loss of funds. Always double-check your code and configurations before committing. Use
.gitignore
files and environment variables to protect sensitive data.
After successfully setting up your Hardhat project, the next step is to configure the hardhat.config.js file. This will be the essential configuration file where you can customize the networks, plugins, compiler settings, and more.
Open the hardhat.config.js
file
⚠️Note: Avoid using import "@openzeppelin/hardhat-upgrades";
because this library calls getStorageAt
, which will not work if storage is disabled.
For the scope of this tutorial, we will only configure the networks, leaving the solidity compiler at its default version 0.8.19.
Set a variable with your private key
To set the variable, use the following command:
After running the command, you will be prompted to enter your private key.
You can read more about setting the configuration variables here.
Setup the Swisstronik's network
Make sure you have enough funds in this wallet to deploy/interact with the smart contract. otherwise, you can get SWTR test tokens here