First, you need to create a Whitelist-Daap folder where the Hardhat project and your Next.js app will later go.
Then, in Whitelist-Daap folder, you will set up Hardhat project.
In the same directory where you installed Hardhat run command
npx hardhat, Create a basic sample project.
Start by creating a new file inside the
To deploy the contract at rinkeby network, Create a new file named
Now create a
.envfile in the
hardhat-tutorialfolder, add your (NETWORK URL) AND (PRIVATE KEY) in the env file.
Now we will install
dotenvpackage to be able to import the env file and use it in our config. Open up a terminal pointing at
hardhat-tutorialdirectory and execute this command
npm install dotenv
Compile the contract, open up a terminal pointing at
hardhat-tutorialdirectory and execute the
npx hardhat compilecommand.
To deploy, open up a terminal pointing at
hardhat-tutorialdirectory and execute this
npx hardhat run scripts/deploy.js --network rinkebycommand.