Author: lily.hu
Hardhat is a development environment for Ethereum software. It consists of different components for editing, compiling, debugging and deploying your smart contracts and dApps, all of which work together to create a complete development environment.
Hardhat is used through a local installation in your project. This way your environment will be reproducible, and you will avoid future version conflicts.
npm install --save-dev hardhat
yarn add --dev hardhat
Hardhat Runner is the main component you interact with when using Hardhat. It's a flexible and extensible task runner that helps you manage and automate the recurring tasks inherent to developing smart contracts and dApps.
Hardhat Runner is designed around the concepts of tasks and plugins. Every time you're running Hardhat from the command-line, you're running a task.Plugins are the backbone of Hardhat, and they're built using the same config API that you use in your Hardhat configuration. You can extend Hardhat's functionality with the plugins list here.
- Setting up a Hardhat project
- Compiling contracts
- Testing contracts
- Deploying contracts
- verifying contracts
- Writing tasks and scripts
- Console
- Create own task
- Build own plugins
- Flattening your contracts
Hardhat Network is a local Ethereum network node designed for development. It allows you to deploy your contracts, run your tests and debug your code, all within the confines of your local machine.
- Solidity stack traces
- Automatic error messages
- Print logging messages in Solidity contracts
- Forking other networks
- Mining modes
- Rich logging
- The debug_traceTransaction method
Hardhat for Visual Studio Code is the official Hardhat extension that adds advanced support for Solidity to VSCode.
Hardhat Chai Matchers adds Ethereum-specific capabilities to the Chai assertion library, making your smart contract tests easy to write and read.
Hardhat Network Helpers provides a convenient JavaScript interface to the JSON-RPC functionality of Hardhat Network.
Hardhat helps developers in testing, compiling, deploying, and debugging dApps on the Ethereum blockchain. It serves a crucial role in supporting coders and developers with the management of tasks, which are important for smart contract and dApp development. You can try it follow the official tutorial.