π Objective:
- Learn Hardhat, the Ethereum development framework thatβs the industry standard for smart contract testing, deployment, and debugging.
- Set up a local Ethereum node for testing contracts and transactions.
- Integrate Ethers.js to interact with smart contracts programmatically.
- Write unit tests to ensure your contract works as expected.
- Deploy smart contracts to the Sepolia testnet using Hardhat.
π§ What is Hardhat?
Hardhat is a development environment designed to help developers build Ethereum smart contracts. It is used for:
- Compiling smart contracts
- Deploying them to local and remote networks
- Testing smart contracts
- Debugging and interacting with contracts using JavaScript or TypeScript
π Core Features of Hardhat:
- Local Ethereum Network:
- Hardhat runs a local Ethereum network for testing purposes that mimics the real Ethereum network.
- You can deploy and test smart contracts here without needing to spend real ETH.
- Solidity Compiler:
- Hardhat has an integrated Solidity compiler that compiles your contracts automatically.
- Testing with Mocha & Chai:
- Hardhat integrates with Mocha (test framework) and Chai (assertion library) to help you write unit tests for your contracts.
- Deployments & Scripts:
- Hardhat supports deployment scripts that allow you to deploy contracts to Ethereum networks (e.g., Sepolia, Mainnet) using Ethers.js.
ποΈ Setting Up Your Hardhat Project