github NomicFoundation/hardhat hardhat@3.8.0
Hardhat v3.8.0

4 hours ago

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 f21390f Thanks @alcuadrado! - Added definePlugin, a new helper exported from hardhat/plugins. Plugin authors should wrap their plugin literal with it so the default export of their index module becomes:

    import type { HardhatPlugin } from "hardhat/types/plugins";
    
    import { definePlugin } from "hardhat/plugins";
    
    const hardhatPlugin: HardhatPlugin = definePlugin({
      id: "my-plugin",
      // ...
    });
    
    export default hardhatPlugin;

    definePlugin returns 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's plugins array.

  • #8339 19c6927 Thanks @alcuadrado! - Hardhat now warns when a plugin is imported in your Hardhat config file but missing from the plugins array. 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.json must enable verbatimModuleSyntax: true. Without it, TypeScript deletes unused default-value imports, so an unused plugin can't be detected.

  • #8336 86bfe66 Thanks @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 9d5b96c Thanks @alcuadrado! - Add .solidityStack property to the SolidityError exceptions generated by EDR

  • #8365 dbb689b Thanks @kanej! - Suppress the solc contract size warning for Solidity test files.

  • #8368 2e2ba99 Thanks @kanej! - Fixed the build task attempting to download a compiler even though a path to a local compiler is configured.

  • #8339 25cea9f Thanks @alcuadrado! - The sample projects initialized with hardhat --init now set verbatimModuleSyntax: true in their tsconfig.json. This ensures that plugin imports in hardhat.config.ts are 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.


Don't miss a new hardhat release

NewReleases is sending notifications on new releases.