hardhat 3.7.0 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/src/cli.js +4 -1
  3. package/dist/src/cli.js.map +1 -1
  4. package/dist/src/internal/builtin-plugins/artifacts/index.d.ts.map +1 -1
  5. package/dist/src/internal/builtin-plugins/artifacts/index.js +3 -2
  6. package/dist/src/internal/builtin-plugins/artifacts/index.js.map +1 -1
  7. package/dist/src/internal/builtin-plugins/clean/index.d.ts.map +1 -1
  8. package/dist/src/internal/builtin-plugins/clean/index.js +3 -2
  9. package/dist/src/internal/builtin-plugins/clean/index.js.map +1 -1
  10. package/dist/src/internal/builtin-plugins/console/index.d.ts.map +1 -1
  11. package/dist/src/internal/builtin-plugins/console/index.js +3 -2
  12. package/dist/src/internal/builtin-plugins/console/index.js.map +1 -1
  13. package/dist/src/internal/builtin-plugins/coverage/config.d.ts +6 -0
  14. package/dist/src/internal/builtin-plugins/coverage/config.d.ts.map +1 -0
  15. package/dist/src/internal/builtin-plugins/coverage/config.js +18 -0
  16. package/dist/src/internal/builtin-plugins/coverage/config.js.map +1 -0
  17. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/config.d.ts +4 -0
  18. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/config.d.ts.map +1 -0
  19. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/config.js +15 -0
  20. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/config.js.map +1 -0
  21. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.d.ts.map +1 -1
  22. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js +10 -1
  23. package/dist/src/internal/builtin-plugins/coverage/hook-handlers/solidity.js.map +1 -1
  24. package/dist/src/internal/builtin-plugins/coverage/index.d.ts.map +1 -1
  25. package/dist/src/internal/builtin-plugins/coverage/index.js +4 -2
  26. package/dist/src/internal/builtin-plugins/coverage/index.js.map +1 -1
  27. package/dist/src/internal/builtin-plugins/coverage/type-extensions.d.ts +20 -0
  28. package/dist/src/internal/builtin-plugins/coverage/type-extensions.d.ts.map +1 -1
  29. package/dist/src/internal/builtin-plugins/flatten/index.d.ts.map +1 -1
  30. package/dist/src/internal/builtin-plugins/flatten/index.js +3 -2
  31. package/dist/src/internal/builtin-plugins/flatten/index.js.map +1 -1
  32. package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts.map +1 -1
  33. package/dist/src/internal/builtin-plugins/gas-analytics/index.js +3 -2
  34. package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +1 -1
  35. package/dist/src/internal/builtin-plugins/network-manager/edr/genesis-state.d.ts +2 -1
  36. package/dist/src/internal/builtin-plugins/network-manager/edr/genesis-state.d.ts.map +1 -1
  37. package/dist/src/internal/builtin-plugins/network-manager/edr/genesis-state.js +13 -10
  38. package/dist/src/internal/builtin-plugins/network-manager/edr/genesis-state.js.map +1 -1
  39. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.d.ts +1 -0
  40. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.d.ts.map +1 -1
  41. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js +5 -0
  42. package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.js.map +1 -1
  43. package/dist/src/internal/builtin-plugins/network-manager/index.d.ts.map +1 -1
  44. package/dist/src/internal/builtin-plugins/network-manager/index.js +3 -2
  45. package/dist/src/internal/builtin-plugins/network-manager/index.js.map +1 -1
  46. package/dist/src/internal/builtin-plugins/network-manager/provider-errors.d.ts +0 -12
  47. package/dist/src/internal/builtin-plugins/network-manager/provider-errors.d.ts.map +1 -1
  48. package/dist/src/internal/builtin-plugins/network-manager/provider-errors.js +0 -28
  49. package/dist/src/internal/builtin-plugins/network-manager/provider-errors.js.map +1 -1
  50. package/dist/src/internal/builtin-plugins/network-manager/type-validation.d.ts.map +1 -1
  51. package/dist/src/internal/builtin-plugins/network-manager/type-validation.js +10 -1
  52. package/dist/src/internal/builtin-plugins/network-manager/type-validation.js.map +1 -1
  53. package/dist/src/internal/builtin-plugins/node/index.d.ts.map +1 -1
  54. package/dist/src/internal/builtin-plugins/node/index.js +3 -2
  55. package/dist/src/internal/builtin-plugins/node/index.js.map +1 -1
  56. package/dist/src/internal/builtin-plugins/run/index.d.ts.map +1 -1
  57. package/dist/src/internal/builtin-plugins/run/index.js +3 -2
  58. package/dist/src/internal/builtin-plugins/run/index.js.map +1 -1
  59. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts +6 -0
  60. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
  61. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +8 -0
  62. package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
  63. package/dist/src/internal/builtin-plugins/solidity/build-system/warning-suppression.d.ts.map +1 -1
  64. package/dist/src/internal/builtin-plugins/solidity/build-system/warning-suppression.js +4 -0
  65. package/dist/src/internal/builtin-plugins/solidity/build-system/warning-suppression.js.map +1 -1
  66. package/dist/src/internal/builtin-plugins/solidity/config.js +7 -1
  67. package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
  68. package/dist/src/internal/builtin-plugins/solidity/index.d.ts.map +1 -1
  69. package/dist/src/internal/builtin-plugins/solidity/index.js +3 -2
  70. package/dist/src/internal/builtin-plugins/solidity/index.js.map +1 -1
  71. package/dist/src/internal/builtin-plugins/solidity/solidity-hooks.d.ts.map +1 -1
  72. package/dist/src/internal/builtin-plugins/solidity/solidity-hooks.js +5 -2
  73. package/dist/src/internal/builtin-plugins/solidity/solidity-hooks.js.map +1 -1
  74. package/dist/src/internal/builtin-plugins/solidity/source-names.d.ts +12 -0
  75. package/dist/src/internal/builtin-plugins/solidity/source-names.d.ts.map +1 -0
  76. package/dist/src/internal/builtin-plugins/solidity/source-names.js +18 -0
  77. package/dist/src/internal/builtin-plugins/solidity/source-names.js.map +1 -0
  78. package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.d.ts.map +1 -1
  79. package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.js +7 -12
  80. package/dist/src/internal/builtin-plugins/solidity-test/eip712/index.js.map +1 -1
  81. package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
  82. package/dist/src/internal/builtin-plugins/solidity-test/index.js +3 -2
  83. package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
  84. package/dist/src/internal/builtin-plugins/telemetry/index.d.ts.map +1 -1
  85. package/dist/src/internal/builtin-plugins/telemetry/index.js +3 -2
  86. package/dist/src/internal/builtin-plugins/telemetry/index.js.map +1 -1
  87. package/dist/src/internal/builtin-plugins/test/index.d.ts.map +1 -1
  88. package/dist/src/internal/builtin-plugins/test/index.js +3 -2
  89. package/dist/src/internal/builtin-plugins/test/index.js.map +1 -1
  90. package/dist/src/internal/cli/main.d.ts +1 -0
  91. package/dist/src/internal/cli/main.d.ts.map +1 -1
  92. package/dist/src/internal/cli/main.js +4 -0
  93. package/dist/src/internal/cli/main.js.map +1 -1
  94. package/dist/src/internal/core/plugins/loaded-plugins-registry.d.ts +4 -0
  95. package/dist/src/internal/core/plugins/loaded-plugins-registry.d.ts.map +1 -0
  96. package/dist/src/internal/core/plugins/loaded-plugins-registry.js +8 -0
  97. package/dist/src/internal/core/plugins/loaded-plugins-registry.js.map +1 -0
  98. package/dist/src/internal/core/plugins/unused-plugins-warning.d.ts +3 -0
  99. package/dist/src/internal/core/plugins/unused-plugins-warning.d.ts.map +1 -0
  100. package/dist/src/internal/core/plugins/unused-plugins-warning.js +29 -0
  101. package/dist/src/internal/core/plugins/unused-plugins-warning.js.map +1 -0
  102. package/dist/src/internal/edr/context.d.ts.map +1 -1
  103. package/dist/src/internal/edr/context.js +25 -7
  104. package/dist/src/internal/edr/context.js.map +1 -1
  105. package/dist/src/internal/{builtin-plugins/solidity-test/eip712 → utils}/glob.d.ts +4 -0
  106. package/dist/src/internal/utils/glob.d.ts.map +1 -0
  107. package/dist/src/internal/{builtin-plugins/solidity-test/eip712 → utils}/glob.js +3 -3
  108. package/dist/src/internal/utils/glob.js.map +1 -0
  109. package/dist/src/plugins.d.ts +13 -0
  110. package/dist/src/plugins.d.ts.map +1 -1
  111. package/dist/src/plugins.js +16 -0
  112. package/dist/src/plugins.js.map +1 -1
  113. package/package.json +4 -4
  114. package/src/cli.ts +4 -1
  115. package/src/internal/builtin-plugins/artifacts/index.ts +5 -2
  116. package/src/internal/builtin-plugins/clean/index.ts +3 -2
  117. package/src/internal/builtin-plugins/console/index.ts +3 -2
  118. package/src/internal/builtin-plugins/coverage/config.ts +28 -0
  119. package/src/internal/builtin-plugins/coverage/hook-handlers/config.ts +30 -0
  120. package/src/internal/builtin-plugins/coverage/hook-handlers/solidity.ts +15 -2
  121. package/src/internal/builtin-plugins/coverage/index.ts +4 -2
  122. package/src/internal/builtin-plugins/coverage/type-extensions.ts +24 -0
  123. package/src/internal/builtin-plugins/flatten/index.ts +3 -2
  124. package/src/internal/builtin-plugins/gas-analytics/index.ts +3 -2
  125. package/src/internal/builtin-plugins/network-manager/edr/genesis-state.ts +22 -14
  126. package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-solidity-errors.ts +5 -0
  127. package/src/internal/builtin-plugins/network-manager/index.ts +3 -2
  128. package/src/internal/builtin-plugins/network-manager/provider-errors.ts +0 -34
  129. package/src/internal/builtin-plugins/network-manager/type-validation.ts +14 -1
  130. package/src/internal/builtin-plugins/node/index.ts +3 -2
  131. package/src/internal/builtin-plugins/run/index.ts +3 -2
  132. package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +11 -0
  133. package/src/internal/builtin-plugins/solidity/build-system/warning-suppression.ts +4 -0
  134. package/src/internal/builtin-plugins/solidity/config.ts +7 -1
  135. package/src/internal/builtin-plugins/solidity/index.ts +3 -2
  136. package/src/internal/builtin-plugins/solidity/solidity-hooks.ts +8 -2
  137. package/src/internal/builtin-plugins/solidity/source-names.ts +19 -0
  138. package/src/internal/builtin-plugins/solidity-test/eip712/index.ts +8 -16
  139. package/src/internal/builtin-plugins/solidity-test/index.ts +3 -2
  140. package/src/internal/builtin-plugins/telemetry/index.ts +3 -2
  141. package/src/internal/builtin-plugins/test/index.ts +3 -2
  142. package/src/internal/cli/main.ts +6 -0
  143. package/src/internal/core/plugins/loaded-plugins-registry.ts +11 -0
  144. package/src/internal/core/plugins/unused-plugins-warning.ts +47 -0
  145. package/src/internal/edr/context.ts +39 -23
  146. package/src/internal/{builtin-plugins/solidity-test/eip712 → utils}/glob.ts +3 -3
  147. package/src/plugins.ts +19 -0
  148. package/templates/hardhat-3/01-node-test-runner-viem/package.json +11 -11
  149. package/templates/hardhat-3/01-node-test-runner-viem/tsconfig.json +2 -1
  150. package/templates/hardhat-3/02-mocha-ethers/package.json +14 -14
  151. package/templates/hardhat-3/02-mocha-ethers/tsconfig.json +2 -1
  152. package/templates/hardhat-3/03-minimal/package.json +1 -1
  153. package/templates/hardhat-3/03-minimal/tsconfig.json +2 -1
  154. package/dist/src/internal/builtin-plugins/solidity-test/eip712/glob.d.ts.map +0 -1
  155. package/dist/src/internal/builtin-plugins/solidity-test/eip712/glob.js.map +0 -1
@@ -8,6 +8,7 @@ export const SPDX_WARNING = "SPDX license identifier not provided";
8
8
  export const PRAGMA_WARNING =
9
9
  "Source file does not specify required compiler version";
10
10
  const CONTRACT_SIZE_WARNING = "Contract code size is";
11
+ const INIT_CODE_SIZE_WARNING = "Contract initcode size is";
11
12
 
12
13
  // Suppression rules are grouped by scope. Each array has its own match logic
13
14
  // in `shouldSuppressWarning` function; add new entries to the array that fits, or add
@@ -31,6 +32,8 @@ const SPECIFIC_FILE_RULES: ReadonlyArray<{
31
32
  const TEST_FILE_WARNING_MESSAGES: readonly string[] = [
32
33
  SPDX_WARNING,
33
34
  PRAGMA_WARNING,
35
+ CONTRACT_SIZE_WARNING,
36
+ INIT_CODE_SIZE_WARNING,
34
37
  ];
35
38
 
36
39
  // Warnings suppressed only when running with `--coverage`. An entry with no
@@ -43,6 +46,7 @@ const COVERAGE_MODE_RULES: ReadonlyArray<{
43
46
  filePath?: string;
44
47
  }> = [
45
48
  { message: CONTRACT_SIZE_WARNING },
49
+ { message: INIT_CODE_SIZE_WARNING },
46
50
  {
47
51
  message: NATSPEC_MEMORY_SAFE_ASSEMBLY_WARNING,
48
52
  filePath: COVERAGE_LIBRARY_FILE_NAME,
@@ -613,6 +613,7 @@ function copyFromDefault(
613
613
  return {
614
614
  version: defaultSolidityConfig.version,
615
615
  type: defaultSolidityConfig.type,
616
+ path: defaultSolidityConfig.path,
616
617
  };
617
618
  }
618
619
 
@@ -620,12 +621,17 @@ function copyFromDefault(
620
621
  compilers: defaultSolidityConfig.compilers.map((c) => ({
621
622
  version: c.version,
622
623
  type: c.type,
624
+ path: c.path,
623
625
  })),
624
626
  overrides: Object.fromEntries(
625
627
  Object.entries(defaultSolidityConfig.overrides ?? {}).map(
626
628
  ([userSourceName, override]) => [
627
629
  userSourceName,
628
- { version: override.version, type: override.type },
630
+ {
631
+ version: override.version,
632
+ type: override.type,
633
+ path: override.path,
634
+ },
629
635
  ],
630
636
  ),
631
637
  ),
@@ -1,5 +1,6 @@
1
1
  import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
+ import { definePlugin } from "../../../plugins.js";
3
4
  import { ArgumentType } from "../../../types/arguments.js";
4
5
  import { globalOption, task } from "../../core/config.js";
5
6
 
@@ -35,7 +36,7 @@ const buildTask = task("build", "Build project")
35
36
  .setAction(async () => await import("./tasks/build.js"))
36
37
  .build();
37
38
 
38
- const hardhatPlugin: HardhatPlugin = {
39
+ const hardhatPlugin: HardhatPlugin = definePlugin({
39
40
  id: "builtin:solidity",
40
41
  dependencies: () => [import("../artifacts/index.js")],
41
42
  hookHandlers: {
@@ -65,6 +66,6 @@ const hardhatPlugin: HardhatPlugin = {
65
66
  }),
66
67
  ],
67
68
  npmPackage: "hardhat",
68
- };
69
+ });
69
70
 
70
71
  export default hardhatPlugin;
@@ -1,7 +1,10 @@
1
1
  import type { SolidityCompilerConfig } from "../../../types/config.js";
2
2
  import type { Compiler } from "../../../types/solidity.js";
3
3
 
4
- import { isSolcSolidityCompilerConfig } from "./build-system/build-system.js";
4
+ import {
5
+ isSolcSolidityCompilerConfig,
6
+ isSolcSolidityCompilerLocalBinary,
7
+ } from "./build-system/build-system.js";
5
8
  import {
6
9
  downloadSolcCompilers,
7
10
  getCompiler,
@@ -16,7 +19,10 @@ export async function downloadSolcCompilersHandler(
16
19
  quiet: boolean,
17
20
  ): Promise<void> {
18
21
  const solcVersions = new Set(
19
- compilerConfigs.filter(isSolcSolidityCompilerConfig).map((c) => c.version),
22
+ compilerConfigs
23
+ .filter(isSolcSolidityCompilerConfig)
24
+ .filter((c) => !isSolcSolidityCompilerLocalBinary(c))
25
+ .map((c) => c.version),
20
26
  );
21
27
 
22
28
  if (solcVersions.size > 0) {
@@ -0,0 +1,19 @@
1
+ import { HARDHAT_PROJECT_INPUT_SOURCE_NAME_ROOT } from "./constants.js";
2
+
3
+ const PROJECT_INPUT_SOURCE_NAME_PREFIX = `${HARDHAT_PROJECT_INPUT_SOURCE_NAME_ROOT}/`;
4
+
5
+ /**
6
+ * Recovers the user-facing source name from a solc input source name by
7
+ * stripping the Hardhat project prefix.
8
+ *
9
+ * Project files have an input source name like `project/contracts/Foo.sol`,
10
+ * whereas the user writes paths — and config globs — against the
11
+ * project-relative `contracts/Foo.sol`. npm package input source names
12
+ * (`npm/<pkg>@<version>/...`) don't carry the project prefix and are returned
13
+ * unchanged.
14
+ */
15
+ export function toUserSourceName(inputSourceName: string): string {
16
+ return inputSourceName.startsWith(PROJECT_INPUT_SOURCE_NAME_PREFIX)
17
+ ? inputSourceName.slice(PROJECT_INPUT_SOURCE_NAME_PREFIX.length)
18
+ : inputSourceName;
19
+ }
@@ -7,25 +7,20 @@ import {
7
7
  bytesToUtf8String,
8
8
  } from "@nomicfoundation/hardhat-utils/bytes";
9
9
 
10
- import { HARDHAT_PROJECT_INPUT_SOURCE_NAME_ROOT } from "../../solidity/constants.js";
10
+ import { isPathSelected } from "../../../utils/glob.js";
11
+ import { toUserSourceName } from "../../solidity/source-names.js";
11
12
 
12
13
  import {
13
14
  buildUserDefinedValueTypeIndex,
14
15
  extractStructsFromAst,
15
16
  } from "./ast-walker.js";
16
17
  import { canonicalizeStructs } from "./canonicalize.js";
17
- import { isPathSelected } from "./glob.js";
18
18
 
19
19
  export interface Eip712TypesConfig {
20
20
  include: string[];
21
21
  exclude: string[];
22
22
  }
23
23
 
24
- // When a transitive project file doesn't produce an artifact — and so is
25
- // missing from `inputToUserSource` — stripping this prefix recovers the
26
- // user-facing path that the user's include/exclude globs are written against.
27
- const PROJECT_INPUT_SOURCE_NAME_PREFIX = `${HARDHAT_PROJECT_INPUT_SOURCE_NAME_ROOT}/`;
28
-
29
24
  /**
30
25
  * Walks every compiled source's AST, extracts every struct definition, and
31
26
  * returns the flat list of canonical EIP-712 type strings expected by EDR's
@@ -89,15 +84,12 @@ export function collectEip712CanonicalTypes(
89
84
  );
90
85
 
91
86
  for (const [inputSourceName, source] of Object.entries(sources)) {
92
- let userSourceName = inputToUserSource.get(inputSourceName);
93
-
94
- if (userSourceName === undefined) {
95
- userSourceName = inputSourceName.startsWith(
96
- PROJECT_INPUT_SOURCE_NAME_PREFIX,
97
- )
98
- ? inputSourceName.slice(PROJECT_INPUT_SOURCE_NAME_PREFIX.length)
99
- : inputSourceName;
100
- }
87
+ // A transitive project file that doesn't produce an artifact is missing
88
+ // from `inputToUserSource`; recovering the user source name from the
89
+ // input source name covers that case.
90
+ const userSourceName =
91
+ inputToUserSource.get(inputSourceName) ??
92
+ toUserSourceName(inputSourceName);
101
93
 
102
94
  // Collect every source so non-selected files can serve as dep targets;
103
95
  // selection is enforced at emit time via `selectedNames`.
@@ -2,11 +2,12 @@ import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
3
  import { ArgumentType } from "hardhat/types/arguments";
4
4
 
5
+ import { definePlugin } from "../../../plugins.js";
5
6
  import { task } from "../../core/config.js";
6
7
 
7
8
  export type * from "./type-extensions.js";
8
9
 
9
- const hardhatPlugin: HardhatPlugin = {
10
+ const hardhatPlugin: HardhatPlugin = definePlugin({
10
11
  id: "builtin:solidity-tests",
11
12
  hookHandlers: {
12
13
  config: () => import("./hook-handlers/config.js"),
@@ -51,6 +52,6 @@ const hardhatPlugin: HardhatPlugin = {
51
52
  import("../coverage/index.js"),
52
53
  ],
53
54
  npmPackage: "hardhat",
54
- };
55
+ });
55
56
 
56
57
  export default hardhatPlugin;
@@ -1,8 +1,9 @@
1
1
  import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
+ import { definePlugin } from "../../../plugins.js";
3
4
  import { task } from "../../core/config.js";
4
5
 
5
- const hardhatPlugin: HardhatPlugin = {
6
+ const hardhatPlugin: HardhatPlugin = definePlugin({
6
7
  id: "builtin:telemetry",
7
8
  tasks: [
8
9
  task("telemetry", "Display and modify telemetry settings")
@@ -18,6 +19,6 @@ const hardhatPlugin: HardhatPlugin = {
18
19
  .build(),
19
20
  ],
20
21
  npmPackage: "hardhat",
21
- };
22
+ });
22
23
 
23
24
  export default hardhatPlugin;
@@ -1,11 +1,12 @@
1
1
  import type { HardhatPlugin } from "../../../types/plugins.js";
2
2
 
3
+ import { definePlugin } from "../../../plugins.js";
3
4
  import { ArgumentType } from "../../../types/arguments.js";
4
5
  import { task } from "../../core/config.js";
5
6
 
6
7
  export type * from "./type-extensions.js";
7
8
 
8
- const hardhatPlugin: HardhatPlugin = {
9
+ const hardhatPlugin: HardhatPlugin = definePlugin({
9
10
  id: "builtin:test",
10
11
  hookHandlers: {
11
12
  config: () => import("./hook-handlers/config.js"),
@@ -37,6 +38,6 @@ const hardhatPlugin: HardhatPlugin = {
37
38
  ],
38
39
  dependencies: () => [import("../solidity/index.js")],
39
40
  npmPackage: "hardhat",
40
- };
41
+ });
41
42
 
42
43
  export default hardhatPlugin;
@@ -40,6 +40,7 @@ import { parseArgumentValue } from "../core/arguments.js";
40
40
  import { buildGlobalOptionDefinitions } from "../core/global-options.js";
41
41
  import { resolveProjectRoot } from "../core/hre.js";
42
42
  import { resolvePluginList } from "../core/plugins/resolve-plugin-list.js";
43
+ import { warnAboutUnusedLoadedPlugins } from "../core/plugins/unused-plugins-warning.js";
43
44
  import { isArgumentRequired } from "../core/tasks/utils.js";
44
45
  import { setGlobalHardhatRuntimeEnvironment } from "../global-hre-instance.js";
45
46
  import { createHardhatRuntimeEnvironment } from "../hre-initialization.js";
@@ -60,6 +61,7 @@ export interface MainOptions {
60
61
  registerTsx?: boolean;
61
62
  rethrowErrors?: true;
62
63
  allowNonlocalHardhatInstallation?: true;
64
+ warnAboutUnusedPlugins?: true;
63
65
  }
64
66
 
65
67
  export async function main(
@@ -234,6 +236,10 @@ export async function main(
234
236
  { resolvedPlugins, globalOptionDefinitions },
235
237
  );
236
238
 
239
+ if (options.warnAboutUnusedPlugins) {
240
+ warnAboutUnusedLoadedPlugins(hre.config.plugins);
241
+ }
242
+
237
243
  // This must be the first time we set it, otherwise we let it crash
238
244
  setGlobalHardhatRuntimeEnvironment(hre);
239
245
 
@@ -0,0 +1,11 @@
1
+ import type { HardhatPlugin } from "../../../types/plugins.js";
2
+
3
+ const loadedPlugins = new Map<string, HardhatPlugin>();
4
+
5
+ export function registerLoadedPlugin(plugin: HardhatPlugin): void {
6
+ loadedPlugins.set(plugin.id, plugin);
7
+ }
8
+
9
+ export function getLoadedPlugins(): ReadonlyMap<string, HardhatPlugin> {
10
+ return loadedPlugins;
11
+ }
@@ -0,0 +1,47 @@
1
+ import type { HardhatPlugin } from "../../../types/plugins.js";
2
+
3
+ import { styleText } from "node:util";
4
+
5
+ import { getLoadedPlugins } from "./loaded-plugins-registry.js";
6
+
7
+ export function warnAboutUnusedLoadedPlugins(
8
+ resolvedPlugins: HardhatPlugin[],
9
+ printError: (message: string) => void = (message) => console.error(message),
10
+ loadedPlugins: Iterable<HardhatPlugin> = getLoadedPlugins().values(),
11
+ ): void {
12
+ const resolvedIds = new Set(resolvedPlugins.map((p) => p.id));
13
+
14
+ const unused: HardhatPlugin[] = [];
15
+ for (const plugin of loadedPlugins) {
16
+ if (!resolvedIds.has(plugin.id)) {
17
+ unused.push(plugin);
18
+ }
19
+ }
20
+
21
+ if (unused.length === 0) {
22
+ return;
23
+ }
24
+
25
+ const lines: string[] = [
26
+ "",
27
+ styleText(["bold", "yellow"], "Warning:") +
28
+ " the following plugins were imported but are not present in the `plugins` array of your config:",
29
+ "",
30
+ ];
31
+
32
+ for (const plugin of unused) {
33
+ const name =
34
+ plugin.npmPackage !== undefined && plugin.npmPackage !== null
35
+ ? `${plugin.npmPackage} (id: ${plugin.id})`
36
+ : plugin.id;
37
+ lines.push(` - ${name}`);
38
+ }
39
+
40
+ lines.push(
41
+ "",
42
+ " Add them to the `plugins` array, or remove the unused plugin import(s) to silence this warning.",
43
+ "",
44
+ );
45
+
46
+ printError(lines.join("\n"));
47
+ }
@@ -10,32 +10,48 @@ import {
10
10
  opSolidityTestRunnerFactory,
11
11
  } from "@nomicfoundation/edr";
12
12
 
13
- let _globalEdrContext: EdrContext | undefined;
13
+ // We cache the initialization *promise* (assigned synchronously, before any
14
+ // await) rather than the resolved context. This way concurrent callers share a
15
+ // single in-flight initialization and always receive a fully-registered
16
+ // context, instead of racing on a half-initialized one.
17
+ let _globalEdrContext: Promise<EdrContext> | undefined;
14
18
 
15
19
  export async function getGlobalEdrContext(): Promise<EdrContext> {
16
20
  if (_globalEdrContext === undefined) {
17
- _globalEdrContext = new EdrContext();
18
- await _globalEdrContext.registerProviderFactory(
19
- GENERIC_CHAIN_TYPE,
20
- genericChainProviderFactory(),
21
- );
22
- await _globalEdrContext.registerProviderFactory(
23
- L1_CHAIN_TYPE,
24
- l1ProviderFactory(),
25
- );
26
- await _globalEdrContext.registerProviderFactory(
27
- OP_CHAIN_TYPE,
28
- opProviderFactory(),
29
- );
30
- await _globalEdrContext.registerSolidityTestRunnerFactory(
31
- L1_CHAIN_TYPE,
32
- l1SolidityTestRunnerFactory(),
33
- );
34
- await _globalEdrContext.registerSolidityTestRunnerFactory(
35
- OP_CHAIN_TYPE,
36
- opSolidityTestRunnerFactory(),
37
- );
21
+ const context = createGlobalEdrContext();
22
+ _globalEdrContext = context;
23
+
24
+ // If initialization fails, clear the cached promise so a later call can
25
+ // retry instead of permanently returning a rejected promise. The identity
26
+ // guard prevents a stale rejection from wiping a newer promise created by
27
+ // a retry.
28
+ context.catch(() => {
29
+ if (_globalEdrContext === context) {
30
+ _globalEdrContext = undefined;
31
+ }
32
+ });
38
33
  }
39
34
 
40
- return _globalEdrContext;
35
+ return await _globalEdrContext;
36
+ }
37
+
38
+ async function createGlobalEdrContext(): Promise<EdrContext> {
39
+ const context = new EdrContext();
40
+
41
+ await context.registerProviderFactory(
42
+ GENERIC_CHAIN_TYPE,
43
+ genericChainProviderFactory(),
44
+ );
45
+ await context.registerProviderFactory(L1_CHAIN_TYPE, l1ProviderFactory());
46
+ await context.registerProviderFactory(OP_CHAIN_TYPE, opProviderFactory());
47
+ await context.registerSolidityTestRunnerFactory(
48
+ L1_CHAIN_TYPE,
49
+ l1SolidityTestRunnerFactory(),
50
+ );
51
+ await context.registerSolidityTestRunnerFactory(
52
+ OP_CHAIN_TYPE,
53
+ opSolidityTestRunnerFactory(),
54
+ );
55
+
56
+ return context;
41
57
  }
@@ -15,11 +15,11 @@ export function isPathSelected(
15
15
  return false;
16
16
  }
17
17
 
18
- if (!matchesAny(path, include)) {
18
+ if (!matchesAnyGlob(path, include)) {
19
19
  return false;
20
20
  }
21
21
 
22
- if (exclude.length > 0 && matchesAny(path, exclude)) {
22
+ if (exclude.length > 0 && matchesAnyGlob(path, exclude)) {
23
23
  return false;
24
24
  }
25
25
 
@@ -29,7 +29,7 @@ export function isPathSelected(
29
29
  /**
30
30
  * Returns true if `value` matches at least one of the given glob patterns.
31
31
  */
32
- function matchesAny(value: string, patterns: string[]): boolean {
32
+ export function matchesAnyGlob(value: string, patterns: string[]): boolean {
33
33
  for (const pattern of patterns) {
34
34
  if (getCompiledGlob(pattern).test(value)) {
35
35
  return true;
package/src/plugins.ts CHANGED
@@ -1,7 +1,26 @@
1
1
  export { HardhatPluginError } from "@nomicfoundation/hardhat-errors";
2
2
 
3
+ import type { HardhatPlugin } from "./types/plugins.js";
4
+
5
+ import { registerLoadedPlugin } from "./internal/core/plugins/loaded-plugins-registry.js";
3
6
  import { throwUsingHardhat2PluginError } from "./internal/using-hardhat2-plugin-errors.js";
4
7
 
8
+ /**
9
+ * Defines a Hardhat plugin.
10
+ *
11
+ * Plugin authors should use this helper as the default export of their
12
+ * plugin's `index` module. It registers the plugin's `id` in a process-wide
13
+ * registry of loaded plugins, which the Hardhat CLI uses to detect plugins
14
+ * that are imported but not included in the user's `plugins` array.
15
+ *
16
+ * @param plugin The plugin definition.
17
+ * @returns The same plugin definition, unchanged.
18
+ */
19
+ export function definePlugin(plugin: HardhatPlugin): HardhatPlugin {
20
+ registerLoadedPlugin(plugin);
21
+ return plugin;
22
+ }
23
+
5
24
  /**
6
25
  * @deprecated This function is part of the Hardhat 2 plugin API.
7
26
  */
@@ -5,22 +5,22 @@
5
5
  "description": "A TypeScript Hardhat project using Node Test Runner and Viem",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.7.0",
9
- "@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.6",
10
- "@nomicfoundation/hardhat-ignition": "workspace:^3.1.6",
8
+ "hardhat": "workspace:^3.9.0",
9
+ "@nomicfoundation/hardhat-toolbox-viem": "workspace:^5.0.7",
10
+ "@nomicfoundation/hardhat-ignition": "workspace:^3.1.7",
11
11
  "@types/node": "^22.8.5",
12
12
  "forge-std": "foundry-rs/forge-std#v1.9.4",
13
13
  "typescript": "~6.0.3",
14
14
  "viem": "^2.47.6"
15
15
  },
16
16
  "peerDependencies": {
17
- "@nomicfoundation/hardhat-ignition-viem": "workspace:^3.1.5",
18
- "@nomicfoundation/hardhat-keystore": "workspace:^3.0.11",
19
- "@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.9",
20
- "@nomicfoundation/hardhat-node-test-runner": "workspace:^3.0.16",
21
- "@nomicfoundation/hardhat-viem": "workspace:^3.0.8",
22
- "@nomicfoundation/hardhat-viem-assertions": "workspace:^3.1.0",
23
- "@nomicfoundation/hardhat-verify": "workspace:^3.0.18",
24
- "@nomicfoundation/ignition-core": "workspace:^3.1.6"
17
+ "@nomicfoundation/hardhat-ignition-viem": "workspace:^3.1.6",
18
+ "@nomicfoundation/hardhat-keystore": "workspace:^3.0.12",
19
+ "@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.10",
20
+ "@nomicfoundation/hardhat-node-test-runner": "workspace:^3.0.17",
21
+ "@nomicfoundation/hardhat-viem": "workspace:^3.0.9",
22
+ "@nomicfoundation/hardhat-viem-assertions": "workspace:^3.1.1",
23
+ "@nomicfoundation/hardhat-verify": "workspace:^3.0.20",
24
+ "@nomicfoundation/ignition-core": "workspace:^3.1.7"
25
25
  }
26
26
  }
@@ -5,6 +5,7 @@
5
5
  "target": "es2023",
6
6
  "skipLibCheck": true,
7
7
  "outDir": "dist",
8
- "types": ["node"]
8
+ "types": ["node"],
9
+ "verbatimModuleSyntax": true
9
10
  }
10
11
  }
@@ -5,10 +5,10 @@
5
5
  "description": "A TypeScript Hardhat project using Mocha and Ethers.js",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.7.0",
9
- "@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.6",
10
- "@nomicfoundation/hardhat-ethers": "workspace:^4.0.12",
11
- "@nomicfoundation/hardhat-ignition": "workspace:^3.1.6",
8
+ "hardhat": "workspace:^3.9.0",
9
+ "@nomicfoundation/hardhat-toolbox-mocha-ethers": "workspace:^3.0.7",
10
+ "@nomicfoundation/hardhat-ethers": "workspace:^4.0.13",
11
+ "@nomicfoundation/hardhat-ignition": "workspace:^3.1.7",
12
12
  "@types/chai": "^5.2.3",
13
13
  "@types/chai-as-promised": "^8.0.1",
14
14
  "@types/mocha": ">=10.0.10",
@@ -20,15 +20,15 @@
20
20
  "typescript": "~6.0.3"
21
21
  },
22
22
  "peerDependencies": {
23
- "@nomicfoundation/hardhat-ethers": "workspace:^4.0.12",
24
- "@nomicfoundation/hardhat-ethers-chai-matchers": "workspace:^3.0.9",
25
- "@nomicfoundation/hardhat-ignition": "workspace:^3.1.6",
26
- "@nomicfoundation/hardhat-ignition-ethers": "workspace:^3.1.5",
27
- "@nomicfoundation/hardhat-keystore": "workspace:^3.0.11",
28
- "@nomicfoundation/hardhat-mocha": "workspace:^3.0.20",
29
- "@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.9",
30
- "@nomicfoundation/hardhat-typechain": "workspace:^3.1.0",
31
- "@nomicfoundation/hardhat-verify": "workspace:^3.0.18",
32
- "@nomicfoundation/ignition-core": "workspace:^3.1.6"
23
+ "@nomicfoundation/hardhat-ethers": "workspace:^4.0.13",
24
+ "@nomicfoundation/hardhat-ethers-chai-matchers": "workspace:^3.0.10",
25
+ "@nomicfoundation/hardhat-ignition": "workspace:^3.1.7",
26
+ "@nomicfoundation/hardhat-ignition-ethers": "workspace:^3.1.6",
27
+ "@nomicfoundation/hardhat-keystore": "workspace:^3.0.12",
28
+ "@nomicfoundation/hardhat-mocha": "workspace:^3.0.21",
29
+ "@nomicfoundation/hardhat-network-helpers": "workspace:^3.0.10",
30
+ "@nomicfoundation/hardhat-typechain": "workspace:^3.1.1",
31
+ "@nomicfoundation/hardhat-verify": "workspace:^3.0.20",
32
+ "@nomicfoundation/ignition-core": "workspace:^3.1.7"
33
33
  }
34
34
  }
@@ -5,6 +5,7 @@
5
5
  "target": "es2023",
6
6
  "skipLibCheck": true,
7
7
  "outDir": "dist",
8
- "types": ["node", "mocha"]
8
+ "types": ["node", "mocha"],
9
+ "verbatimModuleSyntax": true
9
10
  }
10
11
  }
@@ -5,7 +5,7 @@
5
5
  "description": "A minimal Hardhat project",
6
6
  "type": "module",
7
7
  "devDependencies": {
8
- "hardhat": "workspace:^3.7.0",
8
+ "hardhat": "workspace:^3.9.0",
9
9
  "@types/node": "^22.8.5",
10
10
  "typescript": "~6.0.3"
11
11
  }
@@ -5,6 +5,7 @@
5
5
  "target": "es2023",
6
6
  "skipLibCheck": true,
7
7
  "outDir": "dist",
8
- "types": ["node"]
8
+ "types": ["node"],
9
+ "verbatimModuleSyntax": true
9
10
  }
10
11
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/solidity-test/eip712/glob.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAcT"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"glob.js","sourceRoot":"","sources":["../../../../../../src/internal/builtin-plugins/solidity-test/eip712/glob.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAY,EACZ,OAAiB,EACjB,OAAiB;IAEjB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;QACpD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED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