Setting up Environment for Hardhat
This is a quick start guide for deploying and understanding a confidential ERC20 using the Hardhat template.
Prerequisites
We recommend installing nvm (Node Version Manager) first and then install Node.js with nvm.
- For Linux: The official Linux version can be found here or follow this tutorial.
- For Windows, follow the Readme guide.
- For Mac, you can follow this tutorial.
Install Node.js:
Install pnpm:
Setting up your environment
- Clone the template project:
- Install dependencies:
- Set up
.env
file. You can use the values below, taken from the README:
If you don’t have a mnemonic, you can generate one using this website or use our default test accounts. We recommend using RPC providers instead of public endpoints for better log access.
- Compile contracts:
- Run a local Node
The current instructions will run a local node and a local covalidator. If you are using this template against another network, e.g. Base Sepolia, skip this step.
- Run tests:
Deploying on Base Sepolia
After setting the PRIVATE_KEY_BASE_SEPOLIA
and BASE_SEPOLIA_RPC_URL
fields in the .env
file, run the following command:
Then, you can make sure tests still pass with:
Next Step
Now that you have deployed and tested the contract, let’s understand how it works.