@nomicfoundation/hardhat-toolbox
Advanced tools
| # @nomicfoundation/hardhat-toolbox | ||
| ## 7.0.0 | ||
| ### Major Changes | ||
| - 09ae6db: Deprecate the `latest` npm tag and redirect users to migrate to Hardhat 3 or to the `hh2` tag. |
+45
-30
@@ -1,32 +0,47 @@ | ||
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| require("@nomicfoundation/hardhat-chai-matchers"); | ||
| require("@nomicfoundation/hardhat-ethers"); | ||
| require("@nomicfoundation/hardhat-verify"); | ||
| require("@nomicfoundation/hardhat-ignition-ethers"); | ||
| require("@typechain/hardhat"); | ||
| require("hardhat-gas-reporter"); | ||
| require("solidity-coverage"); | ||
| // @ts-check | ||
| const util = require("util"); | ||
| /** | ||
| * If a new official plugin is added, make sure to update: | ||
| * - The tsconfig.json file | ||
| * - The hardhat-toolbox GitHub workflow | ||
| * - The parts of the documentation that install hardhat-toolbox with npm 6 or yarn | ||
| * - The list of dependencies that the sample projects install | ||
| * - The README | ||
| * This is a backwards compatible shim because Hardhat 2 can use older | ||
| * versions of Node. | ||
| * | ||
| * @type (format: import("util").InspectColor | readonly import("util").InspectColor[], text: string) => string | ||
| */ | ||
| const config_1 = require("hardhat/config"); | ||
| (0, config_1.extendConfig)((config, userConfig) => { | ||
| const configAsAny = config; | ||
| if (userConfig.gasReporter?.enabled === undefined) { | ||
| configAsAny.gasReporter.enabled = | ||
| process.env.REPORT_GAS === "true" ? true : false; | ||
| } | ||
| // We don't generate types for js projects | ||
| if (userConfig?.typechain?.dontOverrideCompile === undefined) { | ||
| config.typechain.dontOverrideCompile = | ||
| config.paths.configFile.endsWith(".js") || | ||
| config.paths.configFile.endsWith(".cjs"); | ||
| } | ||
| }); | ||
| //# sourceMappingURL=index.js.map | ||
| const style = (format, text) => { | ||
| if (util.styleText !== undefined) { | ||
| return util.styleText(format, text); | ||
| } | ||
| return text; | ||
| }; | ||
| const packageName = require("./package.json").name; | ||
| console.log(); | ||
| console.log( | ||
| style(["red", "bold"], "Warning:"), | ||
| `You installed the \`latest\` version of ${style( | ||
| "bold", | ||
| packageName, | ||
| )}, which does not work with Hardhat 2 nor 3.`, | ||
| ); | ||
| console.log(); | ||
| console.log(`To learn how to migrate to Hardhat 3, please visit:`); | ||
| console.log(); | ||
| console.log(style("bold", ` https://hardhat.org/migrate-from-hardhat2`)); | ||
| console.log(); | ||
| console.log(); | ||
| console.log( | ||
| `To use ${style( | ||
| "bold", | ||
| packageName, | ||
| )} with Hardhat 2, please install the \`hh2\` tag with npm or your package manager of choice:`, | ||
| ); | ||
| console.log(); | ||
| console.log(style("bold", ` npm install --save-dev "${packageName}@hh2"`)); | ||
| console.log(); | ||
| process.exit(1); |
+1
-1
| MIT License | ||
| Copyright (c) 2023 Nomic Foundation | ||
| Copyright (c) 2026 Nomic Foundation | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
+3
-84
| { | ||
| "name": "@nomicfoundation/hardhat-toolbox", | ||
| "version": "6.1.2", | ||
| "version": "7.0.0", | ||
| "description": "Nomic Foundation's recommended bundle of Hardhat plugins (ethers based)", | ||
| "homepage": "https://github.com/nomicfoundation/hardhat/tree/deprecated-versions/packages/hardhat-toolbox", | ||
| "repository": { | ||
@@ -10,10 +11,5 @@ "type": "git", | ||
| }, | ||
| "homepage": "https://github.com/nomicfoundation/hardhat/tree/main/packages/hardhat-toolbox", | ||
| "author": "Nomic Foundation", | ||
| "contributors": [ | ||
| "Nomic Foundation" | ||
| ], | ||
| "license": "MIT", | ||
| "main": "index.js", | ||
| "types": "index.d.ts", | ||
| "keywords": [ | ||
@@ -25,80 +21,3 @@ "ethereum", | ||
| "hardhat-ethers" | ||
| ], | ||
| "files": [ | ||
| "src/", | ||
| "*.d.ts", | ||
| "*.d.ts.map", | ||
| "*.js", | ||
| "*.js.map", | ||
| "LICENSE", | ||
| "README.md" | ||
| ], | ||
| "devDependencies": { | ||
| "@nomicfoundation/hardhat-chai-matchers": "^2.1.1", | ||
| "@nomicfoundation/hardhat-ethers": "^3.1.3", | ||
| "@nomicfoundation/hardhat-ignition-ethers": "^0.15.15", | ||
| "@nomicfoundation/hardhat-network-helpers": "^1.1.1", | ||
| "@nomicfoundation/hardhat-verify": "^2.1.2", | ||
| "@typechain/ethers-v6": "^0.5.0", | ||
| "@typechain/hardhat": "^9.0.0", | ||
| "@types/chai": "^4.2.0", | ||
| "@types/mocha": ">=9.1.0", | ||
| "@types/node": "^20.0.0", | ||
| "@typescript-eslint/eslint-plugin": "5.61.0", | ||
| "@typescript-eslint/parser": "5.61.0", | ||
| "chai": "^4.4.1", | ||
| "eslint": "^8.44.0", | ||
| "eslint-config-prettier": "8.3.0", | ||
| "eslint-plugin-import": "2.27.5", | ||
| "eslint-plugin-mocha": "10.4.1", | ||
| "eslint-plugin-prettier": "3.4.0", | ||
| "ethers": "^6.14.0", | ||
| "hardhat": "^2.28.0", | ||
| "hardhat-gas-reporter": "^2.3.0", | ||
| "mocha": "^10.0.0", | ||
| "prettier": "2.4.1", | ||
| "rimraf": "^3.0.2", | ||
| "solidity-coverage": "^0.8.17", | ||
| "ts-node": "^10.8.0", | ||
| "typechain": "^8.3.1", | ||
| "typescript": "~5.0.0", | ||
| "@nomicfoundation/eslint-plugin-hardhat-internal-rules": "^1.0.2", | ||
| "@nomicfoundation/eslint-plugin-slow-imports": "^1.0.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "@nomicfoundation/hardhat-chai-matchers": "^2.1.0", | ||
| "@nomicfoundation/hardhat-ethers": "^3.1.3", | ||
| "@nomicfoundation/hardhat-ignition-ethers": "^0.15.14", | ||
| "@nomicfoundation/hardhat-network-helpers": "^1.1.0", | ||
| "@nomicfoundation/hardhat-verify": "^2.1.0", | ||
| "@typechain/ethers-v6": "^0.5.0", | ||
| "@typechain/hardhat": "^9.0.0", | ||
| "@types/chai": "^4.2.0", | ||
| "@types/mocha": ">=9.1.0", | ||
| "@types/node": ">=20.0.0", | ||
| "chai": "^4.2.0", | ||
| "ethers": "^6.14.0", | ||
| "hardhat": "^2.28.0", | ||
| "hardhat-gas-reporter": "^2.3.0", | ||
| "solidity-coverage": "^0.8.17", | ||
| "ts-node": ">=8.0.0", | ||
| "typechain": "^8.3.0", | ||
| "typescript": ">=4.5.0" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/nomicfoundation/hardhat/issues" | ||
| }, | ||
| "directories": { | ||
| "test": "test" | ||
| }, | ||
| "scripts": { | ||
| "lint": "pnpm prettier --check && pnpm eslint", | ||
| "lint:fix": "pnpm prettier --write && pnpm eslint --fix", | ||
| "eslint": "eslint 'src/**/*.ts' 'test/**/*.ts'", | ||
| "prettier": "prettier \"**/*.{js,md,json}\"", | ||
| "pretest": "cd ../.. && pnpm build", | ||
| "test": "mocha --recursive \"test/**/*.ts\" --exit", | ||
| "build": "tsc --build .", | ||
| "clean": "rimraf dist *.{d.ts,js}{,.map} build-test tsconfig.tsbuildinfo" | ||
| } | ||
| ] | ||
| } |
+8
-19
@@ -1,3 +0,1 @@ | ||
| [](https://www.npmjs.com/package/@nomicfoundation/hardhat-toolbox) [](https://hardhat.org) | ||
| # Hardhat Toolbox | ||
@@ -7,25 +5,16 @@ | ||
| When you use this plugin, you'll be able to: | ||
| **Version compatibility warning:** This version of the package does not work with Hardhat 2 nor 3. Please read below to migrate to Hardhat 3 or install a version compatible with Hardhat 2. | ||
| - Interact with your contracts using [ethers.js](https://docs.ethers.org/v6/) and the [`hardhat-ethers`](https://v2.hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-ethers) plugin. | ||
| - Test your contracts with [Mocha](https://mochajs.org/), [Chai](https://chaijs.com/) and our own [Hardhat Chai Matchers](https://v2.hardhat.org/hardhat-chai-matchers) plugin. | ||
| - Deploy your contracts with [Hardhat Ignition](https://v2.hardhat.org/ignition). | ||
| - Interact with Hardhat Network with our [Hardhat Network Helpers](https://v2.hardhat.org/hardhat-network-helpers). | ||
| - Verify the source code of your contracts with the [hardhat-verify](https://v2.hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify) plugin. | ||
| - Get metrics on the gas used by your contracts with the [hardhat-gas-reporter](https://github.com/cgewecke/hardhat-gas-reporter) plugin. | ||
| - Measure your tests coverage with [solidity-coverage](https://github.com/sc-forks/solidity-coverage). | ||
| - And, if you are using TypeScript, get type bindings for your contracts with [Typechain](https://github.com/dethcrypto/TypeChain/). | ||
| ### Installation | ||
| ### Usage | ||
| #### Hardhat 3 | ||
| To create a new project that uses the Toolbox, check our [Setting up a project guide](https://v2.hardhat.org/hardhat-runner/docs/guides/project-setup). | ||
| To learn how to migrate to Hardhat 3, please read the [migration guide](https://hardhat.org/migrate-from-hardhat2). | ||
| If you want to migrate an existing Hardhat project to use the Toolbox, read [our migration guide](https://hv2.ardhat.org/hardhat-runner/docs/guides/migrating-from-hardhat-waffle). | ||
| #### Hardhat 2 | ||
| ### Network Helpers | ||
| To use this package with Hardhat 2, please install the `hh2` tag with npm or your package manager of choice: | ||
| When the Toolbox is installed using npm 7 or later, its peer dependencies are automatically installed. However, these dependencies won't be listed in the `package.json`. As a result, directly importing the Network Helpers can be problematic for certain tools or IDEs. To address this issue, the Toolbox re-exports the Hardhat Network Helpers. You can use them like this: | ||
| ```ts | ||
| import helpers from "@nomicfoundation/hardhat-toolbox/network-helpers"; | ||
| ```bash | ||
| npm install --save-dev "@nomicfoundation/hardhat-toolbox@hh2" | ||
| ``` |
| module.exports = { | ||
| extends: [`${__dirname}/../../config/eslint/eslintrc.js`], | ||
| parserOptions: { | ||
| project: `${__dirname}/src/tsconfig.json`, | ||
| sourceType: "module", | ||
| }, | ||
| }; |
| import "@nomicfoundation/hardhat-chai-matchers"; | ||
| import "@nomicfoundation/hardhat-ethers"; | ||
| import "@nomicfoundation/hardhat-verify"; | ||
| import "@nomicfoundation/hardhat-ignition-ethers"; | ||
| import "@typechain/hardhat"; | ||
| import "hardhat-gas-reporter"; | ||
| import "solidity-coverage"; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wCAAwC,CAAC;AAChD,OAAO,iCAAiC,CAAC;AACzC,OAAO,iCAAiC,CAAC;AACzC,OAAO,0CAA0C,CAAC;AAClD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,mBAAmB,CAAC"} |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;AAAA,kDAAgD;AAChD,2CAAyC;AACzC,2CAAyC;AACzC,oDAAkD;AAClD,8BAA4B;AAC5B,gCAA8B;AAC9B,6BAA2B;AAE3B;;;;;;;GAOG;AAEH,2CAA8C;AAE9C,IAAA,qBAAY,EAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;IAClC,MAAM,WAAW,GAAG,MAAa,CAAC;IAElC,IAAI,UAAU,CAAC,WAAW,EAAE,OAAO,KAAK,SAAS,EAAE;QACjD,WAAW,CAAC,WAAW,CAAC,OAAO;YAC7B,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;KACpD;IAED,0CAA0C;IAC1C,IAAI,UAAU,EAAE,SAAS,EAAE,mBAAmB,KAAK,SAAS,EAAE;QAC5D,MAAM,CAAC,SAAS,CAAC,mBAAmB;YAClC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;gBACvC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KAC5C;AACH,CAAC,CAAC,CAAC"} |
| export * from "@nomicfoundation/hardhat-network-helpers"; | ||
| //# sourceMappingURL=network-helpers.d.ts.map |
| {"version":3,"file":"network-helpers.d.ts","sourceRoot":"","sources":["src/network-helpers.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAC"} |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("@nomicfoundation/hardhat-network-helpers"), exports); | ||
| //# sourceMappingURL=network-helpers.js.map |
| {"version":3,"file":"network-helpers.js","sourceRoot":"","sources":["src/network-helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2EAAyD"} |
-34
| import "@nomicfoundation/hardhat-chai-matchers"; | ||
| import "@nomicfoundation/hardhat-ethers"; | ||
| import "@nomicfoundation/hardhat-verify"; | ||
| import "@nomicfoundation/hardhat-ignition-ethers"; | ||
| import "@typechain/hardhat"; | ||
| import "hardhat-gas-reporter"; | ||
| import "solidity-coverage"; | ||
| /** | ||
| * If a new official plugin is added, make sure to update: | ||
| * - The tsconfig.json file | ||
| * - The hardhat-toolbox GitHub workflow | ||
| * - The parts of the documentation that install hardhat-toolbox with npm 6 or yarn | ||
| * - The list of dependencies that the sample projects install | ||
| * - The README | ||
| */ | ||
| import { extendConfig } from "hardhat/config"; | ||
| extendConfig((config, userConfig) => { | ||
| const configAsAny = config as any; | ||
| if (userConfig.gasReporter?.enabled === undefined) { | ||
| configAsAny.gasReporter.enabled = | ||
| process.env.REPORT_GAS === "true" ? true : false; | ||
| } | ||
| // We don't generate types for js projects | ||
| if (userConfig?.typechain?.dontOverrideCompile === undefined) { | ||
| config.typechain.dontOverrideCompile = | ||
| config.paths.configFile.endsWith(".js") || | ||
| config.paths.configFile.endsWith(".cjs"); | ||
| } | ||
| }); |
| export * from "@nomicfoundation/hardhat-network-helpers"; |
| { | ||
| "extends": "../../../config/typescript/tsconfig.json", | ||
| "compilerOptions": { | ||
| "outDir": "../", | ||
| "rootDirs": ["."], | ||
| "composite": true | ||
| }, | ||
| "include": ["./**/*.ts"], | ||
| "exclude": [], | ||
| "references": [ | ||
| { | ||
| "path": "../../hardhat-core/src" | ||
| }, | ||
| { | ||
| "path": "../../hardhat-chai-matchers" | ||
| }, | ||
| { | ||
| "path": "../../hardhat-network-helpers" | ||
| }, | ||
| { | ||
| "path": "../../hardhat-ethers/src" | ||
| }, | ||
| { | ||
| "path": "../../hardhat-verify/src" | ||
| } | ||
| ] | ||
| } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
-100%0
-100%0
-100%1
-50%3710
-69.93%5
-66.67%39
-67.5%1
Infinity%20
-35.48%1
Infinity%