This article is about configuration of your hardhat.config.js file . This file is normally located in the root of your project and is needed for Hardhat to work. Everything about your Hardhat setup (i.e. your config, plugins and custom tasks) are contained in this file.

An object is exported from hardhat.config.js to set up your project. This object can have entities like defaultNetwork, networks, solidity, paths and mocha.

A sample config file is shown below:

A sample hardhat.config.js file

Network Configuration:

There are two kinds of networks in Hardhat: JSON-RPC based networks, and built-in Hardhat Network.

The default network is “hardhat” but you can…

This tutorial is about how to setup Hardhat and how to compile, test and deploy smart contract using this.

Firstly, Hardhat is basically a development environment to compile, deploy, test and debug Ethereum smart contracts. It serves as an alternative to truffle. However, it is a lot better than the latter. Hardhat had a built-in Hardhat Network (like Ganache, your local blockchain) designed for development. Its main functionality focuses around Solidity, debugging, featuring stack traces, console.log() and explicit error messages when transactions fail.

Hardhat is used through local installation in your project.

To install it, create an npm project by…

Dheeraj Kumar

Blockchain Developer at Rapid Innovation

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store