>
>
Check out the new hardhat-waffle replacement!
>
>
npm
hardhat

#Hardhat Toolbox

The @nomicfoundation/hardhat-toolbox plugin bundles all the commonly used packages and Hardhat plugins we recommend to start developing with Hardhat.

When you use this plugin, you'll be able to:

#Installation

We recommend using npm 7 or later. If you do that, then you just need to install the plugin itself:

npm install --save-dev @nomicfoundation/hardhat-toolbox

If you are using an older version of npm, you'll also need to install all the packages used by the toolbox.

npm install --save-dev @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-network-helpers @nomicfoundation/hardhat-chai-matchers @nomiclabs/hardhat-ethers @nomiclabs/hardhat-etherscan chai ethers hardhat-gas-reporter solidity-coverage @typechain/hardhat typechain @typechain/ethers-v5 @ethersproject/abi @ethersproject/providers

That's also the case if you are using yarn:

yarn add --dev @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-network-helpers @nomicfoundation/hardhat-chai-matchers @nomiclabs/hardhat-ethers @nomiclabs/hardhat-etherscan chai ethers hardhat-gas-reporter solidity-coverage @typechain/hardhat typechain @typechain/ethers-v5 @ethersproject/abi @ethersproject/providers

#Migrating to Hardhat Toolbox

Migrating an existing project to the Toolbox is easy:

  1. First, if you are using hardhat-waffle, we recommend you migrate to our Hardhat Chai Matchers. They are a drop-in replacement, so this should only take a few minutes. Learn how to do that here.

  2. Install the toolbox and its dependencies. If you are using npm 7 or later, you just need to do npm install --save-dev @nomicfoundation/hardhat-toolbox. If not, check the Installation section above.

  3. Uninstall @nomiclabs/hardhat-waffle and ethereum-waffle, and remove the @nomiclabs/hardhat-waffle import from your Hardhat config.

  4. Import the Toolbox in your Hardhat config. This will make many other imports redundant, so you can remove any of these if you want:

    • @nomiclabs/hardhat-ethers
    • @nomiclabs/hardhat-etherscan
    • hardhat-gas-reporter
    • solidity-coverage
    • @typechain/hardhat