Welcome to another episode of Hashgraph Hub's Hedera Smart Contract Basics. In this episode, we're going to guide you through deploying smart contracts using Hardhat and Ethers.
This guide is divided into six steps:
We'll start by setting up a new Hardhat project. Use the command npx hardhat
to start a new project and follow the prompts.
We'll then install the necessary npm modules for our project. Use npm install
along with the name of the modules needed for this project.
Before we can interact with a contract, we need a wallet. We'll walk you through setting up an Hedera wallet and connecting it to the Hardhat network.
Next, we'll write a script that deploys our contract. This script will import our wallet and contract, connect to the network, and then deploy the contract.
We'll then run the script using Hardhat's task runner. By running npx hardhat test
, Hardhat will execute our script and deploy our contract to the network.
Finally, after deployment, we will verify the contract's existence on the network using Hashscan.
Stay tuned to the Hashgraph Hub YouTube channel for more episodes in our Hedera Smart Contract Basics series. Happy coding!