Package Exports
- @nomicfoundation/hardhat-toolbox
- @nomicfoundation/hardhat-toolbox/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nomicfoundation/hardhat-toolbox) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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:
- Deploy and interact with your contracts using ethers.js and the
hardhat-ethersplugin. - Test your contracts with Mocha, Chai and our own Hardhat Chai Matchers plugin.
- Interact with Hardhat Network with our Hardhat Network Helpers.
- Verify the source code of your contracts with the hardhat-etherscan plugin.
- Get metrics on the gas used by your contracts with the hardhat-gas-reporter plugin.
- Measure your tests coverage with solidity-coverage.
- And, if you are using TypeScript, get type bindings for your contracts with Typechain.
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-toolboxIf 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/providersThat'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/providersMigrating to Hardhat Toolbox
Migrating an existing project to the Toolbox is easy:
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.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.Uninstall
@nomiclabs/hardhat-waffleandethereum-waffle, and remove the@nomiclabs/hardhat-waffleimport from your Hardhat config.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-etherscanhardhat-gas-reportersolidity-coverage@typechain/hardhat