This release includes two improvements: a warning is now printed if a plugin is imported in hardhat.config.ts but not included in the plugins array and node:test now more cleanly displays Solidity errors.
Changes
-
#8339
f21390fThanks @alcuadrado! - AddeddefinePlugin, a new helper exported fromhardhat/plugins. Plugin authors should wrap their plugin literal with it so the default export of theirindexmodule becomes:import type { HardhatPlugin } from "hardhat/types/plugins"; import { definePlugin } from "hardhat/plugins"; const hardhatPlugin: HardhatPlugin = definePlugin({ id: "my-plugin", // ... }); export default hardhatPlugin;
definePluginreturns its argument unchanged and, as a side effect, registers the plugin's id in a process-wide registry of loaded plugins. Hardhat's CLI uses that registry to warn when a plugin is imported but missing from the user'spluginsarray. -
#8339
19c6927Thanks @alcuadrado! - Hardhat now warns when a plugin is imported in your Hardhat config file but missing from thepluginsarray. The warning is printed to stderr after the runtime environment is created, listing the offending plugins and pointing the user at the fix.If your Hardhat config file is written in TypeScript, for the warning to be reliable your project's
tsconfig.jsonmust enableverbatimModuleSyntax: true. Without it, TypeScript deletes unused default-value imports, so an unused plugin can't be detected. -
#8336
86bfe66Thanks @Wodann! - - Fixed default gas limit of Solidity test runner when a custom transaction gas cap (EIP-7825) or block gas limit is specified- Fixed process deadlock/hang when dropping a provider with interval mining and logging enabled
- Print more detailed error descriptions for EVM, invariant fuzz, and cheatcode errors
-
#8345
9d5b96cThanks @alcuadrado! - Add.solidityStackproperty to theSolidityErrorexceptions generated by EDR -
#8365
dbb689bThanks @kanej! - Suppress the solc contract size warning for Solidity test files. -
#8368
2e2ba99Thanks @kanej! - Fixed thebuildtask attempting to download a compiler even though apathto a local compiler is configured. -
#8339
25cea9fThanks @alcuadrado! - The sample projects initialized withhardhat --initnow setverbatimModuleSyntax: truein theirtsconfig.json. This ensures that plugin imports inhardhat.config.tsare actually evaluated at runtime, which is required for the new "imported but unused plugin" warning to work reliably. -
Updated dependencies:
- @nomicfoundation/hardhat-errors@3.0.15
💡 The Nomic Foundation is hiring! Check our open positions.