hardhat 2.13.0-dev.1 → 2.13.0-dev.2

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 (179) hide show
  1. package/builtin-tasks/compile.js +1 -1
  2. package/builtin-tasks/compile.js.map +1 -1
  3. package/builtin-tasks/flatten.js +9 -3
  4. package/builtin-tasks/flatten.js.map +1 -1
  5. package/internal/artifacts/caching.d.ts +2 -1
  6. package/internal/artifacts/caching.d.ts.map +1 -1
  7. package/internal/artifacts/caching.js +12 -1
  8. package/internal/artifacts/caching.js.map +1 -1
  9. package/internal/artifacts/index.d.ts +1 -0
  10. package/internal/artifacts/index.d.ts.map +1 -1
  11. package/internal/artifacts/index.js +14 -10
  12. package/internal/artifacts/index.js.map +1 -1
  13. package/internal/artifacts/readonly.d.ts +6 -0
  14. package/internal/artifacts/readonly.d.ts.map +1 -1
  15. package/internal/artifacts/readonly.js +19 -0
  16. package/internal/artifacts/readonly.js.map +1 -1
  17. package/internal/artifacts.d.ts +5 -0
  18. package/internal/artifacts.d.ts.map +1 -1
  19. package/internal/artifacts.js +29 -10
  20. package/internal/artifacts.js.map +1 -1
  21. package/internal/cli/cli.js +10 -1
  22. package/internal/cli/cli.js.map +1 -1
  23. package/internal/cli/project-creation.d.ts +1 -0
  24. package/internal/cli/project-creation.d.ts.map +1 -1
  25. package/internal/cli/project-creation.js +13 -2
  26. package/internal/cli/project-creation.js.map +1 -1
  27. package/internal/core/config/config-resolution.d.ts.map +1 -1
  28. package/internal/core/config/config-resolution.js +2 -1
  29. package/internal/core/config/config-resolution.js.map +1 -1
  30. package/internal/core/errors-list.d.ts +7 -0
  31. package/internal/core/errors-list.d.ts.map +1 -1
  32. package/internal/core/errors-list.js +84 -75
  33. package/internal/core/errors-list.js.map +1 -1
  34. package/internal/core/flamegraph.js +10 -10
  35. package/internal/core/jsonrpc/types/input/blockTag.d.ts +3 -3
  36. package/internal/core/jsonrpc/types/input/blockTag.d.ts.map +1 -1
  37. package/internal/core/jsonrpc/types/output/metadata.d.ts +13 -0
  38. package/internal/core/jsonrpc/types/output/metadata.d.ts.map +1 -0
  39. package/internal/{hardhat-network/provider/vm/vm-adapter.js → core/jsonrpc/types/output/metadata.js} +1 -1
  40. package/internal/core/jsonrpc/types/output/metadata.js.map +1 -0
  41. package/internal/core/providers/accounts.d.ts.map +1 -1
  42. package/internal/core/providers/accounts.js +4 -1
  43. package/internal/core/providers/accounts.js.map +1 -1
  44. package/internal/core/providers/backwards-compatibility.d.ts.map +1 -1
  45. package/internal/core/providers/backwards-compatibility.js +3 -0
  46. package/internal/core/providers/backwards-compatibility.js.map +1 -1
  47. package/internal/core/providers/gas-providers.d.ts +1 -1
  48. package/internal/core/providers/gas-providers.d.ts.map +1 -1
  49. package/internal/core/providers/gas-providers.js +1 -1
  50. package/internal/core/providers/gas-providers.js.map +1 -1
  51. package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
  52. package/internal/hardhat-network/jsonrpc/client.js +5 -3
  53. package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
  54. package/internal/hardhat-network/provider/modules/eth.js +4 -4
  55. package/internal/hardhat-network/provider/modules/hardhat.d.ts +2 -0
  56. package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -1
  57. package/internal/hardhat-network/provider/modules/hardhat.js +9 -0
  58. package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
  59. package/internal/hardhat-network/provider/modules/web3.d.ts +3 -0
  60. package/internal/hardhat-network/provider/modules/web3.d.ts.map +1 -1
  61. package/internal/hardhat-network/provider/modules/web3.js +4 -4
  62. package/internal/hardhat-network/provider/modules/web3.js.map +1 -1
  63. package/internal/hardhat-network/provider/node.d.ts +5 -0
  64. package/internal/hardhat-network/provider/node.d.ts.map +1 -1
  65. package/internal/hardhat-network/provider/node.js +40 -3
  66. package/internal/hardhat-network/provider/node.js.map +1 -1
  67. package/internal/hardhat-network/provider/output.d.ts +1 -1
  68. package/internal/hardhat-network/provider/output.d.ts.map +1 -1
  69. package/internal/hardhat-network/provider/output.js +1 -1
  70. package/internal/hardhat-network/provider/output.js.map +1 -1
  71. package/internal/hardhat-network/provider/provider.js +1 -1
  72. package/internal/hardhat-network/provider/provider.js.map +1 -1
  73. package/internal/hardhat-network/provider/utils/makeForkClient.d.ts +1 -0
  74. package/internal/hardhat-network/provider/utils/makeForkClient.d.ts.map +1 -1
  75. package/internal/hardhat-network/provider/utils/makeForkClient.js +4 -1
  76. package/internal/hardhat-network/provider/utils/makeForkClient.js.map +1 -1
  77. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +1 -1
  78. package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -5
  79. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
  80. package/internal/hardhat-network/stack-traces/solidity-errors.d.ts.map +1 -1
  81. package/internal/hardhat-network/stack-traces/solidity-errors.js +2 -1
  82. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  83. package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -1
  84. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +2 -1
  85. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
  86. package/internal/solidity/compiler/index.d.ts.map +1 -1
  87. package/internal/solidity/compiler/index.js +6 -0
  88. package/internal/solidity/compiler/index.js.map +1 -1
  89. package/internal/solidity/dependencyGraph.d.ts.map +1 -1
  90. package/internal/solidity/dependencyGraph.js +2 -0
  91. package/internal/solidity/dependencyGraph.js.map +1 -1
  92. package/internal/solidity/resolver.d.ts.map +1 -1
  93. package/internal/solidity/resolver.js +8 -0
  94. package/internal/solidity/resolver.js.map +1 -1
  95. package/internal/util/console.d.ts.map +1 -1
  96. package/internal/util/console.js +1 -1
  97. package/internal/util/console.js.map +1 -1
  98. package/internal/util/download.d.ts +3 -1
  99. package/internal/util/download.d.ts.map +1 -1
  100. package/internal/util/download.js +2 -1
  101. package/internal/util/download.js.map +1 -1
  102. package/internal/util/keys-derivation.d.ts.map +1 -1
  103. package/internal/util/keys-derivation.js +4 -1
  104. package/internal/util/keys-derivation.js.map +1 -1
  105. package/internal/util/packageInfo.d.ts +1 -0
  106. package/internal/util/packageInfo.d.ts.map +1 -1
  107. package/internal/util/packageInfo.js +10 -1
  108. package/internal/util/packageInfo.js.map +1 -1
  109. package/package.json +1 -1
  110. package/recommended-gitignore.txt +1 -1
  111. package/src/builtin-tasks/compile.ts +2 -4
  112. package/src/builtin-tasks/flatten.ts +14 -3
  113. package/src/internal/artifacts/caching.ts +21 -1
  114. package/src/internal/artifacts/index.ts +21 -15
  115. package/src/internal/artifacts/readonly.ts +32 -0
  116. package/src/internal/cli/cli.ts +16 -2
  117. package/src/internal/cli/project-creation.ts +17 -1
  118. package/src/internal/core/config/config-resolution.ts +4 -3
  119. package/src/internal/core/errors-list.ts +85 -75
  120. package/src/internal/core/flamegraph.ts +10 -10
  121. package/src/internal/core/jsonrpc/types/output/metadata.ts +32 -0
  122. package/src/internal/core/providers/accounts.ts +5 -2
  123. package/src/internal/core/providers/backwards-compatibility.ts +3 -0
  124. package/src/internal/core/providers/gas-providers.ts +1 -1
  125. package/src/internal/hardhat-network/jsonrpc/client.ts +7 -4
  126. package/src/internal/hardhat-network/provider/modules/eth.ts +4 -4
  127. package/src/internal/hardhat-network/provider/modules/hardhat.ts +14 -0
  128. package/src/internal/hardhat-network/provider/modules/web3.ts +4 -4
  129. package/src/internal/hardhat-network/provider/node.ts +58 -0
  130. package/src/internal/hardhat-network/provider/output.ts +2 -2
  131. package/src/internal/hardhat-network/provider/provider.ts +1 -1
  132. package/src/internal/hardhat-network/provider/utils/makeForkClient.ts +10 -1
  133. package/src/internal/hardhat-network/stack-traces/compiler-to-model.ts +2 -2
  134. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +2 -6
  135. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +3 -1
  136. package/src/internal/hardhat-network/stack-traces/vm-debug-tracer.ts +4 -1
  137. package/src/internal/solidity/compiler/downloader.ts +1 -1
  138. package/src/internal/solidity/compiler/index.ts +8 -0
  139. package/src/internal/solidity/dependencyGraph.ts +2 -0
  140. package/src/internal/solidity/resolver.ts +10 -0
  141. package/src/internal/util/console.ts +4 -2
  142. package/src/internal/util/download.ts +3 -1
  143. package/src/internal/util/keys-derivation.ts +4 -1
  144. package/src/internal/util/packageInfo.ts +9 -0
  145. package/src/types/artifacts.ts +12 -0
  146. package/src/utils/source-names.ts +15 -0
  147. package/types/artifacts.d.ts +10 -0
  148. package/types/artifacts.d.ts.map +1 -1
  149. package/utils/source-names.d.ts +5 -0
  150. package/utils/source-names.d.ts.map +1 -1
  151. package/utils/source-names.js +14 -1
  152. package/utils/source-names.js.map +1 -1
  153. package/internal/hardhat-network/provider/utils/bloom.d.ts +0 -28
  154. package/internal/hardhat-network/provider/utils/bloom.d.ts.map +0 -1
  155. package/internal/hardhat-network/provider/utils/bloom.js +0 -73
  156. package/internal/hardhat-network/provider/utils/bloom.js.map +0 -1
  157. package/internal/hardhat-network/provider/utils/convertToRethnet.d.ts +0 -29
  158. package/internal/hardhat-network/provider/utils/convertToRethnet.d.ts.map +0 -1
  159. package/internal/hardhat-network/provider/utils/convertToRethnet.js +0 -214
  160. package/internal/hardhat-network/provider/utils/convertToRethnet.js.map +0 -1
  161. package/internal/hardhat-network/provider/vm/block-builder.d.ts +0 -30
  162. package/internal/hardhat-network/provider/vm/block-builder.d.ts.map +0 -1
  163. package/internal/hardhat-network/provider/vm/block-builder.js +0 -147
  164. package/internal/hardhat-network/provider/vm/block-builder.js.map +0 -1
  165. package/internal/hardhat-network/provider/vm/dual.d.ts +0 -43
  166. package/internal/hardhat-network/provider/vm/dual.d.ts.map +0 -1
  167. package/internal/hardhat-network/provider/vm/dual.js +0 -120
  168. package/internal/hardhat-network/provider/vm/dual.js.map +0 -1
  169. package/internal/hardhat-network/provider/vm/ethereumjs.d.ts +0 -55
  170. package/internal/hardhat-network/provider/vm/ethereumjs.d.ts.map +0 -1
  171. package/internal/hardhat-network/provider/vm/ethereumjs.js +0 -272
  172. package/internal/hardhat-network/provider/vm/ethereumjs.js.map +0 -1
  173. package/internal/hardhat-network/provider/vm/rethnet.d.ts +0 -111
  174. package/internal/hardhat-network/provider/vm/rethnet.d.ts.map +0 -1
  175. package/internal/hardhat-network/provider/vm/rethnet.js +0 -171
  176. package/internal/hardhat-network/provider/vm/rethnet.js.map +0 -1
  177. package/internal/hardhat-network/provider/vm/vm-adapter.d.ts +0 -36
  178. package/internal/hardhat-network/provider/vm/vm-adapter.d.ts.map +0 -1
  179. package/internal/hardhat-network/provider/vm/vm-adapter.js.map +0 -1
@@ -59,7 +59,7 @@ You can learn how to use Hardhat by reading the [Getting Started guide](/hardhat
59
59
  message:
60
60
  "Hardhat doesn't support your Node.js version. It should be %requirement%.",
61
61
  title: "Unsupported Node.js",
62
- description: `Hardhat doesn't support your Node.js version.
62
+ description: `Hardhat doesn't support your Node.js version.
63
63
 
64
64
  Please upgrade your version of Node.js and try again.`,
65
65
  shouldBeReported: false,
@@ -68,9 +68,9 @@ Please upgrade your version of Node.js and try again.`,
68
68
  number: 3,
69
69
  message: "%operation% is not supported in Hardhat.",
70
70
  title: "Unsupported operation",
71
- description: `You are trying to perform an unsupported operation.
71
+ description: `You are trying to perform an unsupported operation.
72
72
 
73
- Unless you are creating a task or plugin, this is probably a bug.
73
+ Unless you are creating a task or plugin, this is probably a bug.
74
74
 
75
75
  Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us improve Hardhat.`,
76
76
  shouldBeReported: true,
@@ -118,24 +118,24 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
118
118
  message: `There's one or more errors in your config file:
119
119
 
120
120
  %errors%
121
-
121
+
122
122
  To learn more about Hardhat's configuration, please go to https://hardhat.org/config/`,
123
123
  title: "Invalid Hardhat config",
124
- description: `You have one or more errors in your config file.
125
-
124
+ description: `You have one or more errors in your config file.
125
+
126
126
  Check the error message for details, or go to the [documentation](https://hardhat.org/config/) to learn more.`,
127
127
  shouldBeReported: false,
128
128
  },
129
129
  LIB_IMPORTED_FROM_THE_CONFIG: {
130
130
  number: 9,
131
131
  message: `Error while loading Hardhat's configuration.
132
-
132
+
133
133
  You probably tried to import the "hardhat" module from your config or a file imported from it.
134
134
  This is not possible, as Hardhat can't be initialized while its config is being defined.
135
135
 
136
136
  To learn more about how to access the Hardhat Runtime Environment from different contexts go to https://hardhat.org/hre`,
137
137
  title: "Failed to load config file",
138
- description: `There was an error while loading your config file.
138
+ description: `There was an error while loading your config file.
139
139
 
140
140
  The most common source of errors is trying to import the Hardhat Runtime Environment from your config or a file imported from it.
141
141
  This is not possible, as Hardhat can't be initialized while its config is being defined.
@@ -182,7 +182,7 @@ Please install Hardhat locally using npm or Yarn, and try again.`,
182
182
  TS_NODE_NOT_INSTALLED: {
183
183
  number: 13,
184
184
  message: `Your Hardhat project uses typescript, but ts-node is not installed.
185
-
185
+
186
186
  Please run: npm install --save-dev ts-node`,
187
187
  title: "ts-node not installed",
188
188
  description: `You are running a Hardhat project that uses typescript, but you haven't installed ts-node.
@@ -193,7 +193,7 @@ Please run this and try again: \`npm install --save-dev ts-node\``,
193
193
  TYPESCRIPT_NOT_INSTALLED: {
194
194
  number: 14,
195
195
  message: `Your Hardhat project uses typescript, but it's not installed.
196
-
196
+
197
197
  Please run: npm install --save-dev typescript`,
198
198
  title: "typescript not installed",
199
199
  description: `You are running a Hardhat project that uses typescript, but it's not installed.
@@ -287,8 +287,8 @@ Please check that you are sending a \`data\` parameter.`,
287
287
  message:
288
288
  "Account %account% is not managed by the node you are connected to.",
289
289
  title: "Unrecognized account",
290
- description: `You are trying to send a transaction or sign some data with an
291
- account not managed by your Ethereum node nor Hardhat.
290
+ description: `You are trying to send a transaction or sign some data with an
291
+ account not managed by your Ethereum node nor Hardhat.
292
292
 
293
293
  Please double check your accounts and the \`from\` parameter in your RPC calls.`,
294
294
  shouldBeReported: false,
@@ -297,8 +297,8 @@ Please double check your accounts and the \`from\` parameter in your RPC calls.`
297
297
  number: 104,
298
298
  message: "Missing param %param% from a tx being signed locally.",
299
299
  title: "Missing transaction parameter",
300
- description: `You are trying to send a transaction with a locally managed
301
- account, and some parameters are missing.
300
+ description: `You are trying to send a transaction with a locally managed
301
+ account, and some parameters are missing.
302
302
 
303
303
  Please double check your transactions' parameters.`,
304
304
  shouldBeReported: false,
@@ -308,7 +308,7 @@ Please double check your transactions' parameters.`,
308
308
  message:
309
309
  "No local account was set and there are accounts in the remote node.",
310
310
  title: "No remote accounts available",
311
- description: `No local account was set and there are accounts in the remote node.
311
+ description: `No local account was set and there are accounts in the remote node.
312
312
 
313
313
  Please make sure that your Ethereum node has unlocked accounts.`,
314
314
  shouldBeReported: false,
@@ -318,8 +318,8 @@ Please make sure that your Ethereum node has unlocked accounts.`,
318
318
  message:
319
319
  "HD path %path% is invalid. Read about BIP32 to know about the valid forms.",
320
320
  title: "Invalid HD path",
321
- description: `An invalid HD/BIP32 derivation path was provided in your config.
322
-
321
+ description: `An invalid HD/BIP32 derivation path was provided in your config.
322
+
323
323
  Read the [documentation](https://hardhat.org/hardhat-runner/docs/config#hd-wallet-config) to learn how to define HD accounts correctly.`,
324
324
  shouldBeReported: false,
325
325
  },
@@ -328,7 +328,7 @@ Read the [documentation](https://hardhat.org/hardhat-runner/docs/config#hd-walle
328
328
  message:
329
329
  "Received invalid value `%value%` from/to the node's JSON-RPC, but a Quantity was expected.",
330
330
  title: "Invalid JSON-RPC value",
331
- description: `One of your transactions sent or received an invalid JSON-RPC QUANTITY value.
331
+ description: `One of your transactions sent or received an invalid JSON-RPC QUANTITY value.
332
332
 
333
333
  Please double check your calls' parameters and keep your Ethereum node up to date.`,
334
334
  shouldBeReported: false,
@@ -357,7 +357,7 @@ Please make sure your node is running, and check your internet connection and ne
357
357
  number: 110,
358
358
  message: "Invalid JSON-RPC response received: %response%",
359
359
  title: "Invalid JSON-RPC response",
360
- description: `One of your JSON-RPC requests received an invalid response.
360
+ description: `One of your JSON-RPC requests received an invalid response.
361
361
 
362
362
  Please make sure your node is running, and check your internet connection and networks config.`,
363
363
  shouldBeReported: false,
@@ -367,7 +367,7 @@ Please make sure your node is running, and check your internet connection and ne
367
367
  message:
368
368
  "Cannot derive key %path% from mnemonic '%mnemonic%.\nTry using another mnemonic or deriving fewer keys.",
369
369
  title: "Could not derive an HD key",
370
- description: `One of your HD keys could not be derived.
370
+ description: `One of your HD keys could not be derived.
371
371
 
372
372
  Try using another mnemonic or deriving less keys.`,
373
373
  shouldBeReported: false,
@@ -377,7 +377,7 @@ Try using another mnemonic or deriving less keys.`,
377
377
  message:
378
378
  "Received invalid value `%value%` from/to the node's JSON-RPC, but a Data was expected.",
379
379
  title: "Invalid JSON-RPC value",
380
- description: `One of your calls sent or received an invalid JSON-RPC DATA value.
380
+ description: `One of your calls sent or received an invalid JSON-RPC DATA value.
381
381
 
382
382
  Please double check your calls' parameters and keep your Ethereum node up to date.`,
383
383
  shouldBeReported: false,
@@ -395,8 +395,8 @@ Please check that you are sending a \`data\` parameter with a JSON string or obj
395
395
  message:
396
396
  "An incompatible transaction with gasPrice and EIP-1559 fee price fields.",
397
397
  title: "Incompatible fee price parameters",
398
- description: `You are trying to send a transaction with a locally managed
399
- account, and its parameters are incompatible. You sent both gasPrice, and maxFeePerGas or maxPriorityFeePerGas.
398
+ description: `You are trying to send a transaction with a locally managed
399
+ account, and its parameters are incompatible. You sent both gasPrice, and maxFeePerGas or maxPriorityFeePerGas.
400
400
 
401
401
  Please double check your transactions' parameters.`,
402
402
  shouldBeReported: false,
@@ -406,7 +406,7 @@ Please double check your transactions' parameters.`,
406
406
  message:
407
407
  "Tried to sign a transaction locally, but gasPrice, maxFeePerGas, and maxPriorityFeePerGas were missing.",
408
408
  title: "Missing fee price parameters",
409
- description: `You are trying to send a transaction with a locally managed account, and no fee price parameters were provided. You need to send gasPrice, or maxFeePerGas and maxPriorityFeePerGas.
409
+ description: `You are trying to send a transaction with a locally managed account, and no fee price parameters were provided. You need to send gasPrice, or maxFeePerGas and maxPriorityFeePerGas.
410
410
 
411
411
  Please double check your transactions' parameters.`,
412
412
  shouldBeReported: false,
@@ -427,8 +427,8 @@ Please check that you are sending an \`address\` parameter.`,
427
427
  message:
428
428
  "Could not set positional param %paramName% for task %taskName% because there is already a variadic positional param and it has to be the last positional one.",
429
429
  title: "Could not add positional param",
430
- description: `Could add a positional param to your task because
431
- there is already a variadic positional param and it has to be the last
430
+ description: `Could add a positional param to your task because
431
+ there is already a variadic positional param and it has to be the last
432
432
  positional one.
433
433
 
434
434
  Please double check your task definitions.`,
@@ -440,7 +440,7 @@ Please double check your task definitions.`,
440
440
  "Could not set param %paramName% for task %taskName% because its name is already used.",
441
441
  title: "Repeated param name",
442
442
  description: `Could not add a param to your task because its name is already used.
443
-
443
+
444
444
  Please double check your task definitions.`,
445
445
  shouldBeReported: false,
446
446
  },
@@ -450,7 +450,7 @@ Please double check your task definitions.`,
450
450
  "Could not set param %paramName% for task %taskName% because its name is used as a param for Hardhat.",
451
451
  title: "Hardhat and task param names clash",
452
452
  description: `Could not add a param to your task because its name is used as a param for Hardhat.
453
-
453
+
454
454
  Please double check your task definitions.`,
455
455
  shouldBeReported: false,
456
456
  },
@@ -460,7 +460,7 @@ Please double check your task definitions.`,
460
460
  "Could not set param %paramName% for task %taskName% because it is mandatory and it was added after an optional positional param.",
461
461
  title: "Optional param followed by a required one",
462
462
  description: `Could not add param to your task because it is required and it was added after an optional positional param.
463
-
463
+
464
464
  Please double check your task definitions.`,
465
465
  shouldBeReported: false,
466
466
  },
@@ -468,7 +468,7 @@ Please double check your task definitions.`,
468
468
  number: 204,
469
469
  message: "No action set for task %taskName%.",
470
470
  title: "Tried to run task without an action",
471
- description: `A task was run, but it has no action set.
471
+ description: `A task was run, but it has no action set.
472
472
 
473
473
  Please double check your task definitions.`,
474
474
  shouldBeReported: false,
@@ -478,7 +478,7 @@ Please double check your task definitions.`,
478
478
  message:
479
479
  "Tried to call runSuper from a non-overridden definition of task %taskName%",
480
480
  title: "`runSuper` not available",
481
- description: `You tried to call \`runSuper\` from a non-overridden task.
481
+ description: `You tried to call \`runSuper\` from a non-overridden task.
482
482
 
483
483
  Please use \`runSuper.isDefined\` to make sure that you can call it.`,
484
484
  shouldBeReported: false,
@@ -488,7 +488,7 @@ Please use \`runSuper.isDefined\` to make sure that you can call it.`,
488
488
  message:
489
489
  "Default value for param %paramName% of task %taskName% doesn't match the default one, try specifying it.",
490
490
  title: "Default value has incorrect type",
491
- description: `One of your tasks has a parameter whose default value doesn't match the expected type.
491
+ description: `One of your tasks has a parameter whose default value doesn't match the expected type.
492
492
 
493
493
  Please double check your task definitions.`,
494
494
  shouldBeReported: false,
@@ -498,7 +498,7 @@ Please double check your task definitions.`,
498
498
  message:
499
499
  "Default value for param %paramName% of task %taskName% shouldn't be set.",
500
500
  title: "Required parameter has a default value",
501
- description: `One of your tasks has a required parameter with a default value.
501
+ description: `One of your tasks has a required parameter with a default value.
502
502
 
503
503
  Please double check your task definitions.`,
504
504
  shouldBeReported: false,
@@ -508,7 +508,7 @@ Please double check your task definitions.`,
508
508
  message:
509
509
  "Invalid param name %paramName% in task %taskName%. Param names must be camelCase.",
510
510
  title: "Invalid casing in parameter name",
511
- description: `Your parameter names must use camelCase.
511
+ description: `Your parameter names must use camelCase.
512
512
 
513
513
  Please double check your task definitions.`,
514
514
  shouldBeReported: false,
@@ -555,7 +555,7 @@ Please double check your task definitions.`,
555
555
  message:
556
556
  "Task %task% is not a subtask but one of its arguments uses the type %type%, which is not parseable.",
557
557
  description: `Tasks that can be invoked from the command line require CLIArgumentType types for their arguments.
558
-
558
+
559
559
  What makes these types special is that they can be represented as strings, so you can write them down in the terminal.`,
560
560
  shouldBeReported: false,
561
561
  },
@@ -584,7 +584,7 @@ Please double check your arguments.`,
584
584
  message:
585
585
  "Invalid argument %name%: File %value% doesn't exist or is not a readable file.",
586
586
  title: "Invalid file argument",
587
- description: `One of your tasks expected a file as an argument, but you provided a
587
+ description: `One of your tasks expected a file as an argument, but you provided a
588
588
  nonexistent or non-readable file.
589
589
 
590
590
  Please double check your arguments.`,
@@ -605,7 +605,7 @@ Please double check the name of the task you are trying to run.`,
605
605
  "Unrecognised command line argument %argument%.\nNote that task arguments must come after the task name.",
606
606
  title: "Unrecognized command line argument",
607
607
  description: `Hardhat couldn't recognize one of your command line arguments.
608
-
608
+
609
609
  This may be because you are writing it before the task name. It should come after it.
610
610
 
611
611
  Please double check how you invoked Hardhat.`,
@@ -616,7 +616,7 @@ Please double check how you invoked Hardhat.`,
616
616
  message: "Unrecognized param %param%",
617
617
  title: "Unrecognized param",
618
618
  description: `Hardhat couldn't recognize one of your tasks' parameters.
619
-
619
+
620
620
  Please double check how you invoked Hardhat or ran your task.`,
621
621
  shouldBeReported: false,
622
622
  },
@@ -625,7 +625,7 @@ Please double check how you invoked Hardhat or ran your task.`,
625
625
  message:
626
626
  "The '%param%' parameter of task '%task%' expects a value, but none was passed.",
627
627
  title: "Missing task argument",
628
- description: `You tried to run a task, but one of its required arguments was missing.
628
+ description: `You tried to run a task, but one of its required arguments was missing.
629
629
 
630
630
  Please double check how you invoked Hardhat or ran your task.`,
631
631
  shouldBeReported: false,
@@ -634,7 +634,7 @@ Please double check how you invoked Hardhat or ran your task.`,
634
634
  number: 307,
635
635
  message: "Missing positional argument %param%",
636
636
  title: "Missing task positional argument",
637
- description: `You tried to run a task, but one of its required arguments was missing.
637
+ description: `You tried to run a task, but one of its required arguments was missing.
638
638
 
639
639
  Please double check how you invoked Hardhat or ran your task.`,
640
640
  shouldBeReported: false,
@@ -652,7 +652,7 @@ Please double check how you invoked Hardhat or ran your task.`,
652
652
  number: 309,
653
653
  message: "Repeated parameter %param%",
654
654
  title: "Repeated task parameter",
655
- description: `You tried to run a task with a repeated parameter.
655
+ description: `You tried to run a task with a repeated parameter.
656
656
 
657
657
  Please double check how you invoked Hardhat or ran your task.`,
658
658
  shouldBeReported: false,
@@ -661,7 +661,7 @@ Please double check how you invoked Hardhat or ran your task.`,
661
661
  number: 310,
662
662
  message: "Invalid param %param%. Command line params must be lowercase.",
663
663
  title: "Invalid casing in command line parameter",
664
- description: `You tried to run hardhat with a parameter with invalid casing. They must be lowercase.
664
+ description: `You tried to run hardhat with a parameter with invalid casing. They must be lowercase.
665
665
 
666
666
  Please double check how you invoked Hardhat.`,
667
667
  shouldBeReported: false,
@@ -670,7 +670,7 @@ Please double check how you invoked Hardhat.`,
670
670
  number: 311,
671
671
  message: "Error parsing JSON value for argument %param%: %error%",
672
672
  title: "Invalid JSON parameter",
673
- description: `You tried to run a task with an invalid JSON parameter.
673
+ description: `You tried to run a task with an invalid JSON parameter.
674
674
 
675
675
  Please double check how you invoked Hardhat or ran your task.`,
676
676
  shouldBeReported: false,
@@ -680,7 +680,7 @@ Please double check how you invoked Hardhat or ran your task.`,
680
680
  title: "Subtask run from the command line",
681
681
  message: "Trying to run the %name% subtask from the CLI",
682
682
  description: `You tried to run a subtask from the command line.
683
-
683
+
684
684
  This is not supported. Please run the help task to see the available options.`,
685
685
  shouldBeReported: false,
686
686
  },
@@ -716,7 +716,7 @@ Please double check your imports or install the missing dependency.`,
716
716
  number: 402,
717
717
  message: "File %file% doesn't exist.",
718
718
  title: "Missing library file",
719
- description: `One of your libraries' files was imported but doesn't exist.
719
+ description: `One of your libraries' files was imported but doesn't exist.
720
720
 
721
721
  Please double check your imports or update your libraries.`,
722
722
  shouldBeReported: false,
@@ -725,7 +725,7 @@ Please double check your imports or update your libraries.`,
725
725
  number: 403,
726
726
  message: "Illegal import %imported% from %from%",
727
727
  title: "Illegal Solidity import",
728
- description: `One of your libraries tried to use a relative import to import a file outside of its scope.
728
+ description: `One of your libraries tried to use a relative import to import a file outside of its scope.
729
729
 
730
730
  This is disabled for security reasons.`,
731
731
  shouldBeReported: false,
@@ -745,7 +745,7 @@ Please double check your imports.`,
745
745
  "Invalid import %imported% from %from%. Imports must use / instead of \\, even in Windows",
746
746
  title: "Invalid import: use / instead of \\",
747
747
  description: `A Solidity file is trying to import another file via relative path and is using backslashes (\\\\) instead of slashes (/).
748
-
748
+
749
749
  You must always use slashes (/) in Solidity imports.`,
750
750
  shouldBeReported: false,
751
751
  },
@@ -755,7 +755,7 @@ You must always use slashes (/) in Solidity imports.`,
755
755
  "Invalid import %imported% from %from%. Hardhat doesn't support imports via %protocol%.",
756
756
  title: "Invalid import: trying to use an unsupported protocol",
757
757
  description: `A Solidity file is trying to import a file using an unsupported protocol, like http.
758
-
758
+
759
759
  You can only import files that are available locally or installed through npm.`,
760
760
  shouldBeReported: false,
761
761
  },
@@ -765,7 +765,7 @@ You can only import files that are available locally or installed through npm.`,
765
765
  "Invalid import %imported% from %from%. Hardhat doesn't support imports with absolute paths.",
766
766
  title: "Invalid import: absolute paths unsupported",
767
767
  description: `A Solidity file is trying to import a file using its absolute path.
768
-
768
+
769
769
  This is not supported, as it would lead to hard-to-reproduce compilations.`,
770
770
  shouldBeReported: false,
771
771
  },
@@ -775,7 +775,7 @@ This is not supported, as it would lead to hard-to-reproduce compilations.`,
775
775
  "Invalid import %imported% from %from%. The file being imported is outside of the project",
776
776
  title: "Invalid import: file outside of the project",
777
777
  description: `A Solidity file is trying to import a file that is outside of the project.
778
-
778
+
779
779
  This is not supported by Hardhat.`,
780
780
  shouldBeReported: false,
781
781
  },
@@ -785,7 +785,7 @@ This is not supported by Hardhat.`,
785
785
  "Trying to import %imported% from %from%, but it has an incorrect casing.",
786
786
  title: "Invalid import: wrong file casing",
787
787
  description: `A Solidity file is trying to import a file but its source name casing was wrong.
788
-
788
+
789
789
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
790
790
  shouldBeReported: false,
791
791
  },
@@ -795,7 +795,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
795
795
  "Trying to resolve the file %incorrect% but its correct case-sensitive name is %correct%",
796
796
  title: "Incorrect source name casing",
797
797
  description: `You tried to resolve a Solidity file with an incorrect casing.
798
-
798
+
799
799
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
800
800
  shouldBeReported: false,
801
801
  },
@@ -805,19 +805,29 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
805
805
  "The library %library%, imported from %from%, is not installed. Try installing it using npm.",
806
806
  title: "Invalid import: library not installed",
807
807
  description: `A Solidity file is trying to import another which belongs to a library that is not installed.
808
-
808
+
809
809
  Try installing the library using npm.`,
810
810
  shouldBeReported: false,
811
811
  },
812
+ INCLUDES_OWN_PACKAGE_NAME: {
813
+ number: 412,
814
+ message:
815
+ "Invalid import %imported% from %from%. Trying to import file using the own package's name.",
816
+ title: "Invalid import: includes own package's name",
817
+ description: `A Solidity file is trying to import another using its own package name. This is most likely caused by an existing symlink for the package in your node_modules.
818
+
819
+ Use a relative import instead of referencing the package's name.`,
820
+ shouldBeReported: false,
821
+ },
812
822
  },
813
823
  SOLC: {
814
824
  INVALID_VERSION: {
815
825
  number: 500,
816
826
  message: `Solidity version %version% is invalid or hasn't been released yet.
817
-
827
+
818
828
  If you are certain it has been released, run "npx hardhat clean --global" and try again`,
819
829
  title: "Invalid or unreleased `solc` version",
820
- description: `The Solidity version in your config is invalid or hasn't been released yet.
830
+ description: `The Solidity version in your config is invalid or hasn't been released yet.
821
831
 
822
832
  If you are certain it has been released, run \`npx hardhat clean --global\` and try again.`,
823
833
  shouldBeReported: false,
@@ -827,8 +837,8 @@ If you are certain it has been released, run \`npx hardhat clean --global\` and
827
837
  message:
828
838
  "Couldn't download compiler version %remoteVersion%. Please check your internet connection and try again.",
829
839
  title: "`solc` download failed",
830
- description: `Couldn't download \`solc\`.
831
-
840
+ description: `Couldn't download \`solc\`.
841
+
832
842
  Please check your internet connection and try again.`,
833
843
  shouldBeReported: false,
834
844
  },
@@ -837,8 +847,8 @@ Please check your internet connection and try again.`,
837
847
  message:
838
848
  "Couldn't download compiler version list. Please check your internet connection and try again.",
839
849
  title: "Couldn't obtain `solc` version list",
840
- description: `Couldn't download \`solc\`'s version list.
841
-
850
+ description: `Couldn't download \`solc\`'s version list.
851
+
842
852
  Please check your internet connection and try again.`,
843
853
  shouldBeReported: false,
844
854
  },
@@ -851,7 +861,7 @@ Please check your internet connection and try again.
851
861
  If this error persists, run "npx hardhat clean --global".`,
852
862
  title: "Downloaded `solc` checksum verification failed",
853
863
  description: `Hardhat downloaded a version of the Solidity compiler, and its checksum verification failed.
854
-
864
+
855
865
  Please check your internet connection and try again.
856
866
 
857
867
  If this error persists, run \`npx hardhat clean --global\`.`,
@@ -888,7 +898,7 @@ If this error persists, run "npx hardhat clean --global".`,
888
898
  message: "Compilation failed",
889
899
  title: "Compilation failed",
890
900
  description: `Your smart contracts failed to compile.
891
-
901
+
892
902
  Please check Hardhat's output for more details.`,
893
903
  shouldBeReported: false,
894
904
  },
@@ -897,7 +907,7 @@ Please check Hardhat's output for more details.`,
897
907
  message: "Script %script% doesn't exist.",
898
908
  title: "Script doesn't exist",
899
909
  description: `Tried to use \`hardhat run\` to execute a nonexistent script.
900
-
910
+
901
911
  Please double check your script's path.`,
902
912
  shouldBeReported: false,
903
913
  },
@@ -905,7 +915,7 @@ Please double check your script's path.`,
905
915
  number: 602,
906
916
  message: "Error running script {%script%}: %error%",
907
917
  title: "Error running script",
908
- description: `Running a script resulted in an error.
918
+ description: `Running a script resulted in an error.
909
919
 
910
920
  Please check Hardhat's output for more details.`,
911
921
  shouldBeReported: false,
@@ -914,7 +924,7 @@ Please check Hardhat's output for more details.`,
914
924
  number: 603,
915
925
  message: "Hardhat flatten doesn't support cyclic dependencies.",
916
926
  title: "Flatten detected cyclic dependencies",
917
- description: `Hardhat flatten doesn't support cyclic dependencies.
927
+ description: `Hardhat flatten doesn't support cyclic dependencies.
918
928
 
919
929
  We recommend not using this kind of dependency.`,
920
930
  shouldBeReported: false,
@@ -932,7 +942,7 @@ We recommend not using this kind of dependency.`,
932
942
  "Unsupported network for JSON-RPC server. Only hardhat is currently supported.",
933
943
  title: "Unsupported network for JSON-RPC server.",
934
944
  description: `JSON-RPC server can only be started when running the Hardhat Network.
935
-
945
+
936
946
  To start the JSON-RPC server, retry the command without the --network parameter.`,
937
947
  shouldBeReported: false,
938
948
  },
@@ -983,7 +993,7 @@ Please replace %contractName% for one of these options wherever you are trying t
983
993
  %candidates%
984
994
  `,
985
995
  title: "Multiple artifacts found",
986
- description: `There are multiple artifacts that match the given contract name, and Hardhat doesn't know which one to use.
996
+ description: `There are multiple artifacts that match the given contract name, and Hardhat doesn't know which one to use.
987
997
 
988
998
  Please use the fully qualified name of the contract to disambiguate it.`,
989
999
  shouldBeReported: false,
@@ -994,7 +1004,7 @@ Please use the fully qualified name of the contract to disambiguate it.`,
994
1004
  "Invalid artifact path %incorrect%, its correct case-sensitive path is %correct%",
995
1005
  title: "Incorrect artifact path casing",
996
1006
  description: `You tried to get an artifact file with an incorrect casing.
997
-
1007
+
998
1008
  Hardhat's artifact resolution is case sensitive to ensure projects are portable across different operating systems.`,
999
1009
  shouldBeReported: true,
1000
1010
  },
@@ -1078,7 +1088,7 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
1078
1088
  "Invalid source name %name%. Expected source name but found an absolute path.",
1079
1089
  title: "Invalid source name: absolute path",
1080
1090
  description: `A Solidity source name was expected, but an absolute path was given.
1081
-
1091
+
1082
1092
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1083
1093
  shouldBeReported: true,
1084
1094
  },
@@ -1088,7 +1098,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1088
1098
  "Invalid source name %name%. Expected source name but found a relative path.",
1089
1099
  title: "Invalid source name: relative path",
1090
1100
  description: `A Solidity source name was expected, but a relative path was given.
1091
-
1101
+
1092
1102
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1093
1103
  shouldBeReported: true,
1094
1104
  },
@@ -1098,7 +1108,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1098
1108
  "Invalid source %name%. The source name uses backslashes (\\) instead of slashes (/).",
1099
1109
  title: "Invalid source name: backslashes",
1100
1110
  description: `A Solidity source name was invalid because it uses backslashes (\\\\) instead of slashes (/).
1101
-
1111
+
1102
1112
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1103
1113
  shouldBeReported: true,
1104
1114
  },
@@ -1107,7 +1117,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1107
1117
  message: "Invalid source name %name%. Source names must be normalized",
1108
1118
  title: "Invalid source name: not normalized",
1109
1119
  description: `A Solidity source name was invalid because it wasn't normalized. It probably contains some "." or "..".
1110
-
1120
+
1111
1121
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1112
1122
  shouldBeReported: true,
1113
1123
  },
@@ -1117,7 +1127,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1117
1127
  "Invalid source map %incorrect%, its correct case-sensitive source name is %correct%",
1118
1128
  title: "Incorrect source name casing",
1119
1129
  description: `You tried to resolve a Solidity file with an incorrect casing.
1120
-
1130
+
1121
1131
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1122
1132
  shouldBeReported: true,
1123
1133
  },
@@ -1126,7 +1136,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1126
1136
  message: "Solidity source file %name% not found",
1127
1137
  title: "Solidity source file not found",
1128
1138
  description: `A source name should correspond to an existing Solidity file but it doesn't.
1129
-
1139
+
1130
1140
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1131
1141
  shouldBeReported: true,
1132
1142
  },
@@ -1136,7 +1146,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1136
1146
  "The file %path% is treated as local but is inside a node_modules directory",
1137
1147
  title: "File from node_modules treated as local",
1138
1148
  description: `A file was treated as local but is inside a node_modules directory.
1139
-
1149
+
1140
1150
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1141
1151
  shouldBeReported: true,
1142
1152
  },
@@ -1145,7 +1155,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1145
1155
  message: "The file %path% is treated as local but is outside the project",
1146
1156
  title: "File from outside the project treated as local",
1147
1157
  description: `A file was treated as local but is outside the project.
1148
-
1158
+
1149
1159
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1150
1160
  shouldBeReported: true,
1151
1161
  },
@@ -160,7 +160,7 @@ function getFlamegraphFileContent(flamegraph: Flamegraph): string {
160
160
 
161
161
  <!-- D3.js -->
162
162
  <script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script>
163
-
163
+
164
164
  <!-- d3-tip -->
165
165
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js"></script>
166
166
 
@@ -182,27 +182,27 @@ function getFlamegraphFileContent(flamegraph: Flamegraph): string {
182
182
 
183
183
  function label(d) {
184
184
  if (d.data.parallel) {
185
- return "(multiple parallel runs) task: " + d.data.name + ", max time: " + readableTime(d.data.value);
185
+ return "(multiple parallel runs) task: " + d.data.name + ", max time: " + readableTime(d.data.value);
186
186
  }
187
-
187
+
188
188
  return "task: " + d.data.name + ", time: " + readableTime(d.data.value);
189
189
  }
190
-
190
+
191
191
  function readableTime(t) {
192
192
  const NANOSECONDS_TO_MILLISECONDS = 1_000_000;
193
193
  const NANOSECONDS_TO_SECONDS = 1_000_000_000;
194
-
194
+
195
195
  if (t < NANOSECONDS_TO_MILLISECONDS) {
196
196
  return t + "ns";
197
197
  }
198
-
198
+
199
199
  if (t < NANOSECONDS_TO_SECONDS) {
200
200
  return (t / NANOSECONDS_TO_MILLISECONDS).toFixed(4) + "ms";
201
201
  }
202
-
202
+
203
203
  return (t / NANOSECONDS_TO_SECONDS).toFixed(4) + "s";
204
204
  }
205
-
205
+
206
206
  const tip = d3.tip()
207
207
  .direction("s")
208
208
  .offset([8, 0])
@@ -215,7 +215,7 @@ function getFlamegraphFileContent(flamegraph: Flamegraph): string {
215
215
  flameGraph.setDetailsElement(details);
216
216
 
217
217
  flameGraph.label(label);
218
-
218
+
219
219
  flameGraph.setColorMapper(function(d, originalColor) {
220
220
  if (d.highlight) {
221
221
  return '#E600E6';
@@ -227,7 +227,7 @@ function getFlamegraphFileContent(flamegraph: Flamegraph): string {
227
227
 
228
228
  return "#EB5414"
229
229
  });
230
-
230
+
231
231
  d3.select("#chart")
232
232
  .datum(${data})
233
233
  .call(flameGraph);