hardhat 2.13.0-dev.0 → 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 (209) hide show
  1. package/builtin-tasks/compile.js +2 -11
  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/builtin-tasks/task-names.d.ts +0 -1
  6. package/builtin-tasks/task-names.d.ts.map +1 -1
  7. package/builtin-tasks/task-names.js +2 -3
  8. package/builtin-tasks/task-names.js.map +1 -1
  9. package/internal/artifacts/caching.d.ts +28 -0
  10. package/internal/artifacts/caching.d.ts.map +1 -0
  11. package/internal/artifacts/caching.js +178 -0
  12. package/internal/artifacts/caching.js.map +1 -0
  13. package/internal/artifacts/index.d.ts +45 -0
  14. package/internal/artifacts/index.d.ts.map +1 -0
  15. package/internal/artifacts/index.js +191 -0
  16. package/internal/artifacts/index.js.map +1 -0
  17. package/internal/artifacts/mutable.d.ts +29 -0
  18. package/internal/artifacts/mutable.d.ts.map +1 -0
  19. package/internal/artifacts/mutable.js +226 -0
  20. package/internal/artifacts/mutable.js.map +1 -0
  21. package/internal/artifacts/readonly.d.ts +94 -0
  22. package/internal/artifacts/readonly.d.ts.map +1 -0
  23. package/internal/artifacts/readonly.js +343 -0
  24. package/internal/artifacts/readonly.js.map +1 -0
  25. package/internal/artifacts.d.ts +5 -0
  26. package/internal/artifacts.d.ts.map +1 -1
  27. package/internal/artifacts.js +29 -10
  28. package/internal/artifacts.js.map +1 -1
  29. package/internal/cli/cli.js +15 -3
  30. package/internal/cli/cli.js.map +1 -1
  31. package/internal/cli/project-creation.d.ts +1 -0
  32. package/internal/cli/project-creation.d.ts.map +1 -1
  33. package/internal/cli/project-creation.js +13 -2
  34. package/internal/cli/project-creation.js.map +1 -1
  35. package/internal/core/config/config-env.d.ts +7 -1
  36. package/internal/core/config/config-env.d.ts.map +1 -1
  37. package/internal/core/config/config-env.js +13 -2
  38. package/internal/core/config/config-env.js.map +1 -1
  39. package/internal/core/config/config-resolution.d.ts.map +1 -1
  40. package/internal/core/config/config-resolution.js +2 -1
  41. package/internal/core/config/config-resolution.js.map +1 -1
  42. package/internal/core/config/extenders.d.ts +7 -4
  43. package/internal/core/config/extenders.d.ts.map +1 -1
  44. package/internal/core/config/extenders.js +12 -5
  45. package/internal/core/config/extenders.js.map +1 -1
  46. package/internal/core/errors-list.d.ts +14 -0
  47. package/internal/core/errors-list.d.ts.map +1 -1
  48. package/internal/core/errors-list.js +93 -75
  49. package/internal/core/errors-list.js.map +1 -1
  50. package/internal/core/flamegraph.js +10 -10
  51. package/internal/core/jsonrpc/types/input/blockTag.d.ts +3 -3
  52. package/internal/core/jsonrpc/types/input/blockTag.d.ts.map +1 -1
  53. package/internal/core/jsonrpc/types/output/metadata.d.ts +13 -0
  54. package/internal/core/jsonrpc/types/output/metadata.d.ts.map +1 -0
  55. package/internal/core/jsonrpc/types/output/metadata.js +3 -0
  56. package/internal/core/jsonrpc/types/output/metadata.js.map +1 -0
  57. package/internal/core/providers/accounts.d.ts.map +1 -1
  58. package/internal/core/providers/accounts.js +4 -1
  59. package/internal/core/providers/accounts.js.map +1 -1
  60. package/internal/core/providers/backwards-compatibility.d.ts.map +1 -1
  61. package/internal/core/providers/backwards-compatibility.js +3 -0
  62. package/internal/core/providers/backwards-compatibility.js.map +1 -1
  63. package/internal/core/providers/gas-providers.d.ts +1 -1
  64. package/internal/core/providers/gas-providers.d.ts.map +1 -1
  65. package/internal/core/providers/gas-providers.js +1 -1
  66. package/internal/core/providers/gas-providers.js.map +1 -1
  67. package/internal/core/runtime-environment.d.ts +2 -2
  68. package/internal/core/runtime-environment.d.ts.map +1 -1
  69. package/internal/core/runtime-environment.js +2 -2
  70. package/internal/core/runtime-environment.js.map +1 -1
  71. package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
  72. package/internal/hardhat-network/jsonrpc/client.js +5 -3
  73. package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
  74. package/internal/hardhat-network/provider/fork/ForkBlockchain.d.ts.map +1 -1
  75. package/internal/hardhat-network/provider/fork/ForkBlockchain.js +9 -1
  76. package/internal/hardhat-network/provider/fork/ForkBlockchain.js.map +1 -1
  77. package/internal/hardhat-network/provider/modules/eth.js +4 -4
  78. package/internal/hardhat-network/provider/modules/hardhat.d.ts +2 -0
  79. package/internal/hardhat-network/provider/modules/hardhat.d.ts.map +1 -1
  80. package/internal/hardhat-network/provider/modules/hardhat.js +9 -0
  81. package/internal/hardhat-network/provider/modules/hardhat.js.map +1 -1
  82. package/internal/hardhat-network/provider/modules/web3.d.ts +3 -0
  83. package/internal/hardhat-network/provider/modules/web3.d.ts.map +1 -1
  84. package/internal/hardhat-network/provider/modules/web3.js +4 -4
  85. package/internal/hardhat-network/provider/modules/web3.js.map +1 -1
  86. package/internal/hardhat-network/provider/node.d.ts +5 -0
  87. package/internal/hardhat-network/provider/node.d.ts.map +1 -1
  88. package/internal/hardhat-network/provider/node.js +40 -3
  89. package/internal/hardhat-network/provider/node.js.map +1 -1
  90. package/internal/hardhat-network/provider/output.d.ts +1 -1
  91. package/internal/hardhat-network/provider/output.d.ts.map +1 -1
  92. package/internal/hardhat-network/provider/output.js +1 -1
  93. package/internal/hardhat-network/provider/output.js.map +1 -1
  94. package/internal/hardhat-network/provider/provider.js +1 -1
  95. package/internal/hardhat-network/provider/provider.js.map +1 -1
  96. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.d.ts +32 -0
  97. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.d.ts.map +1 -0
  98. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.js +87 -0
  99. package/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.js.map +1 -0
  100. package/internal/hardhat-network/provider/utils/makeForkClient.d.ts +1 -0
  101. package/internal/hardhat-network/provider/utils/makeForkClient.d.ts.map +1 -1
  102. package/internal/hardhat-network/provider/utils/makeForkClient.js +4 -1
  103. package/internal/hardhat-network/provider/utils/makeForkClient.js.map +1 -1
  104. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +1 -1
  105. package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -5
  106. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
  107. package/internal/hardhat-network/stack-traces/solidity-errors.d.ts.map +1 -1
  108. package/internal/hardhat-network/stack-traces/solidity-errors.js +2 -1
  109. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  110. package/internal/hardhat-network/stack-traces/vm-debug-tracer.d.ts.map +1 -1
  111. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js +2 -1
  112. package/internal/hardhat-network/stack-traces/vm-debug-tracer.js.map +1 -1
  113. package/internal/lib/hardhat-lib.d.ts.map +1 -1
  114. package/internal/lib/hardhat-lib.js +4 -1
  115. package/internal/lib/hardhat-lib.js.map +1 -1
  116. package/internal/solidity/compiler/compiler-input.d.ts.map +1 -1
  117. package/internal/solidity/compiler/compiler-input.js +5 -1
  118. package/internal/solidity/compiler/compiler-input.js.map +1 -1
  119. package/internal/solidity/compiler/downloader.d.ts.map +1 -1
  120. package/internal/solidity/compiler/downloader.js +10 -12
  121. package/internal/solidity/compiler/downloader.js.map +1 -1
  122. package/internal/solidity/compiler/index.d.ts.map +1 -1
  123. package/internal/solidity/compiler/index.js +6 -0
  124. package/internal/solidity/compiler/index.js.map +1 -1
  125. package/internal/solidity/dependencyGraph.d.ts.map +1 -1
  126. package/internal/solidity/dependencyGraph.js +2 -0
  127. package/internal/solidity/dependencyGraph.js.map +1 -1
  128. package/internal/solidity/resolver.d.ts +3 -4
  129. package/internal/solidity/resolver.d.ts.map +1 -1
  130. package/internal/solidity/resolver.js +11 -5
  131. package/internal/solidity/resolver.js.map +1 -1
  132. package/internal/util/console.d.ts.map +1 -1
  133. package/internal/util/console.js +1 -1
  134. package/internal/util/console.js.map +1 -1
  135. package/internal/util/download.d.ts +3 -1
  136. package/internal/util/download.d.ts.map +1 -1
  137. package/internal/util/download.js +2 -1
  138. package/internal/util/download.js.map +1 -1
  139. package/internal/util/keys-derivation.d.ts.map +1 -1
  140. package/internal/util/keys-derivation.js +4 -1
  141. package/internal/util/keys-derivation.js.map +1 -1
  142. package/internal/util/packageInfo.d.ts +1 -0
  143. package/internal/util/packageInfo.d.ts.map +1 -1
  144. package/internal/util/packageInfo.js +10 -1
  145. package/internal/util/packageInfo.js.map +1 -1
  146. package/package.json +1 -1
  147. package/recommended-gitignore.txt +1 -1
  148. package/register.js +4 -1
  149. package/register.js.map +1 -1
  150. package/src/builtin-tasks/compile.ts +3 -20
  151. package/src/builtin-tasks/flatten.ts +14 -3
  152. package/src/builtin-tasks/task-names.ts +0 -2
  153. package/src/internal/artifacts/caching.ts +259 -0
  154. package/src/internal/artifacts/index.ts +302 -0
  155. package/src/internal/artifacts/mutable.ts +330 -0
  156. package/src/internal/artifacts/readonly.ts +470 -0
  157. package/src/internal/cli/cli.ts +22 -3
  158. package/src/internal/cli/project-creation.ts +17 -1
  159. package/src/internal/core/config/config-env.ts +13 -1
  160. package/src/internal/core/config/config-resolution.ts +4 -3
  161. package/src/internal/core/config/extenders.ts +15 -6
  162. package/src/internal/core/errors-list.ts +94 -75
  163. package/src/internal/core/flamegraph.ts +10 -10
  164. package/src/internal/core/jsonrpc/types/output/metadata.ts +32 -0
  165. package/src/internal/core/providers/accounts.ts +5 -2
  166. package/src/internal/core/providers/backwards-compatibility.ts +3 -0
  167. package/src/internal/core/providers/gas-providers.ts +1 -1
  168. package/src/internal/core/runtime-environment.ts +3 -1
  169. package/src/internal/hardhat-network/jsonrpc/client.ts +7 -4
  170. package/src/internal/hardhat-network/provider/fork/ForkBlockchain.ts +15 -3
  171. package/src/internal/hardhat-network/provider/modules/eth.ts +4 -4
  172. package/src/internal/hardhat-network/provider/modules/hardhat.ts +14 -0
  173. package/src/internal/hardhat-network/provider/modules/web3.ts +4 -4
  174. package/src/internal/hardhat-network/provider/node.ts +58 -0
  175. package/src/internal/hardhat-network/provider/output.ts +2 -2
  176. package/src/internal/hardhat-network/provider/provider.ts +1 -1
  177. package/src/internal/hardhat-network/provider/transactions/ReadOnlyValidUnknownTypeTransaction.ts +162 -0
  178. package/src/internal/hardhat-network/provider/utils/makeForkClient.ts +10 -1
  179. package/src/internal/hardhat-network/stack-traces/compiler-to-model.ts +2 -2
  180. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +2 -6
  181. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +3 -1
  182. package/src/internal/hardhat-network/stack-traces/vm-debug-tracer.ts +4 -1
  183. package/src/internal/lib/hardhat-lib.ts +6 -1
  184. package/src/internal/solidity/compiler/compiler-input.ts +7 -1
  185. package/src/internal/solidity/compiler/downloader.ts +11 -11
  186. package/src/internal/solidity/compiler/index.ts +8 -0
  187. package/src/internal/solidity/dependencyGraph.ts +2 -0
  188. package/src/internal/solidity/resolver.ts +13 -8
  189. package/src/internal/util/console.ts +4 -2
  190. package/src/internal/util/download.ts +3 -1
  191. package/src/internal/util/keys-derivation.ts +4 -1
  192. package/src/internal/util/packageInfo.ts +9 -0
  193. package/src/register.ts +6 -1
  194. package/src/types/artifacts.ts +116 -4
  195. package/src/types/runtime.ts +7 -1
  196. package/src/utils/source-names.ts +15 -0
  197. package/types/artifacts.d.ts +100 -4
  198. package/types/artifacts.d.ts.map +1 -1
  199. package/types/runtime.d.ts +6 -1
  200. package/types/runtime.d.ts.map +1 -1
  201. package/utils/source-names.d.ts +5 -0
  202. package/utils/source-names.d.ts.map +1 -1
  203. package/utils/source-names.js +14 -1
  204. package/utils/source-names.js.map +1 -1
  205. package/internal/hardhat-network/provider/utils/convertToRethnet.d.ts +0 -4
  206. package/internal/hardhat-network/provider/utils/convertToRethnet.d.ts.map +0 -1
  207. package/internal/hardhat-network/provider/utils/convertToRethnet.js +0 -31
  208. package/internal/hardhat-network/provider/utils/convertToRethnet.js.map +0 -1
  209. package/src/internal/artifacts.ts +0 -918
@@ -43,7 +43,7 @@ You can learn how to use Hardhat by reading the [Getting Started guide](/hardhat
43
43
  number: 2,
44
44
  message: "Hardhat doesn't support your Node.js version. It should be %requirement%.",
45
45
  title: "Unsupported Node.js",
46
- description: `Hardhat doesn't support your Node.js version.
46
+ description: `Hardhat doesn't support your Node.js version.
47
47
 
48
48
  Please upgrade your version of Node.js and try again.`,
49
49
  shouldBeReported: false,
@@ -52,9 +52,9 @@ Please upgrade your version of Node.js and try again.`,
52
52
  number: 3,
53
53
  message: "%operation% is not supported in Hardhat.",
54
54
  title: "Unsupported operation",
55
- description: `You are trying to perform an unsupported operation.
55
+ description: `You are trying to perform an unsupported operation.
56
56
 
57
- Unless you are creating a task or plugin, this is probably a bug.
57
+ Unless you are creating a task or plugin, this is probably a bug.
58
58
 
59
59
  Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us improve Hardhat.`,
60
60
  shouldBeReported: true,
@@ -100,24 +100,24 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
100
100
  message: `There's one or more errors in your config file:
101
101
 
102
102
  %errors%
103
-
103
+
104
104
  To learn more about Hardhat's configuration, please go to https://hardhat.org/config/`,
105
105
  title: "Invalid Hardhat config",
106
- description: `You have one or more errors in your config file.
107
-
106
+ description: `You have one or more errors in your config file.
107
+
108
108
  Check the error message for details, or go to the [documentation](https://hardhat.org/config/) to learn more.`,
109
109
  shouldBeReported: false,
110
110
  },
111
111
  LIB_IMPORTED_FROM_THE_CONFIG: {
112
112
  number: 9,
113
113
  message: `Error while loading Hardhat's configuration.
114
-
114
+
115
115
  You probably tried to import the "hardhat" module from your config or a file imported from it.
116
116
  This is not possible, as Hardhat can't be initialized while its config is being defined.
117
117
 
118
118
  To learn more about how to access the Hardhat Runtime Environment from different contexts go to https://hardhat.org/hre`,
119
119
  title: "Failed to load config file",
120
- description: `There was an error while loading your config file.
120
+ description: `There was an error while loading your config file.
121
121
 
122
122
  The most common source of errors is trying to import the Hardhat Runtime Environment from your config or a file imported from it.
123
123
  This is not possible, as Hardhat can't be initialized while its config is being defined.
@@ -163,7 +163,7 @@ Please install Hardhat locally using npm or Yarn, and try again.`,
163
163
  TS_NODE_NOT_INSTALLED: {
164
164
  number: 13,
165
165
  message: `Your Hardhat project uses typescript, but ts-node is not installed.
166
-
166
+
167
167
  Please run: npm install --save-dev ts-node`,
168
168
  title: "ts-node not installed",
169
169
  description: `You are running a Hardhat project that uses typescript, but you haven't installed ts-node.
@@ -174,7 +174,7 @@ Please run this and try again: \`npm install --save-dev ts-node\``,
174
174
  TYPESCRIPT_NOT_INSTALLED: {
175
175
  number: 14,
176
176
  message: `Your Hardhat project uses typescript, but it's not installed.
177
-
177
+
178
178
  Please run: npm install --save-dev typescript`,
179
179
  title: "typescript not installed",
180
180
  description: `You are running a Hardhat project that uses typescript, but it's not installed.
@@ -264,8 +264,8 @@ Please check that you are sending a \`data\` parameter.`,
264
264
  number: 103,
265
265
  message: "Account %account% is not managed by the node you are connected to.",
266
266
  title: "Unrecognized account",
267
- description: `You are trying to send a transaction or sign some data with an
268
- account not managed by your Ethereum node nor Hardhat.
267
+ description: `You are trying to send a transaction or sign some data with an
268
+ account not managed by your Ethereum node nor Hardhat.
269
269
 
270
270
  Please double check your accounts and the \`from\` parameter in your RPC calls.`,
271
271
  shouldBeReported: false,
@@ -274,8 +274,8 @@ Please double check your accounts and the \`from\` parameter in your RPC calls.`
274
274
  number: 104,
275
275
  message: "Missing param %param% from a tx being signed locally.",
276
276
  title: "Missing transaction parameter",
277
- description: `You are trying to send a transaction with a locally managed
278
- account, and some parameters are missing.
277
+ description: `You are trying to send a transaction with a locally managed
278
+ account, and some parameters are missing.
279
279
 
280
280
  Please double check your transactions' parameters.`,
281
281
  shouldBeReported: false,
@@ -284,7 +284,7 @@ Please double check your transactions' parameters.`,
284
284
  number: 105,
285
285
  message: "No local account was set and there are accounts in the remote node.",
286
286
  title: "No remote accounts available",
287
- description: `No local account was set and there are accounts in the remote node.
287
+ description: `No local account was set and there are accounts in the remote node.
288
288
 
289
289
  Please make sure that your Ethereum node has unlocked accounts.`,
290
290
  shouldBeReported: false,
@@ -293,8 +293,8 @@ Please make sure that your Ethereum node has unlocked accounts.`,
293
293
  number: 106,
294
294
  message: "HD path %path% is invalid. Read about BIP32 to know about the valid forms.",
295
295
  title: "Invalid HD path",
296
- description: `An invalid HD/BIP32 derivation path was provided in your config.
297
-
296
+ description: `An invalid HD/BIP32 derivation path was provided in your config.
297
+
298
298
  Read the [documentation](https://hardhat.org/hardhat-runner/docs/config#hd-wallet-config) to learn how to define HD accounts correctly.`,
299
299
  shouldBeReported: false,
300
300
  },
@@ -302,7 +302,7 @@ Read the [documentation](https://hardhat.org/hardhat-runner/docs/config#hd-walle
302
302
  number: 107,
303
303
  message: "Received invalid value `%value%` from/to the node's JSON-RPC, but a Quantity was expected.",
304
304
  title: "Invalid JSON-RPC value",
305
- description: `One of your transactions sent or received an invalid JSON-RPC QUANTITY value.
305
+ description: `One of your transactions sent or received an invalid JSON-RPC QUANTITY value.
306
306
 
307
307
  Please double check your calls' parameters and keep your Ethereum node up to date.`,
308
308
  shouldBeReported: false,
@@ -331,7 +331,7 @@ Please make sure your node is running, and check your internet connection and ne
331
331
  number: 110,
332
332
  message: "Invalid JSON-RPC response received: %response%",
333
333
  title: "Invalid JSON-RPC response",
334
- description: `One of your JSON-RPC requests received an invalid response.
334
+ description: `One of your JSON-RPC requests received an invalid response.
335
335
 
336
336
  Please make sure your node is running, and check your internet connection and networks config.`,
337
337
  shouldBeReported: false,
@@ -340,7 +340,7 @@ Please make sure your node is running, and check your internet connection and ne
340
340
  number: 111,
341
341
  message: "Cannot derive key %path% from mnemonic '%mnemonic%.\nTry using another mnemonic or deriving fewer keys.",
342
342
  title: "Could not derive an HD key",
343
- description: `One of your HD keys could not be derived.
343
+ description: `One of your HD keys could not be derived.
344
344
 
345
345
  Try using another mnemonic or deriving less keys.`,
346
346
  shouldBeReported: false,
@@ -349,7 +349,7 @@ Try using another mnemonic or deriving less keys.`,
349
349
  number: 112,
350
350
  message: "Received invalid value `%value%` from/to the node's JSON-RPC, but a Data was expected.",
351
351
  title: "Invalid JSON-RPC value",
352
- description: `One of your calls sent or received an invalid JSON-RPC DATA value.
352
+ description: `One of your calls sent or received an invalid JSON-RPC DATA value.
353
353
 
354
354
  Please double check your calls' parameters and keep your Ethereum node up to date.`,
355
355
  shouldBeReported: false,
@@ -366,8 +366,8 @@ Please check that you are sending a \`data\` parameter with a JSON string or obj
366
366
  number: 114,
367
367
  message: "An incompatible transaction with gasPrice and EIP-1559 fee price fields.",
368
368
  title: "Incompatible fee price parameters",
369
- description: `You are trying to send a transaction with a locally managed
370
- account, and its parameters are incompatible. You sent both gasPrice, and maxFeePerGas or maxPriorityFeePerGas.
369
+ description: `You are trying to send a transaction with a locally managed
370
+ account, and its parameters are incompatible. You sent both gasPrice, and maxFeePerGas or maxPriorityFeePerGas.
371
371
 
372
372
  Please double check your transactions' parameters.`,
373
373
  shouldBeReported: false,
@@ -376,7 +376,7 @@ Please double check your transactions' parameters.`,
376
376
  number: 115,
377
377
  message: "Tried to sign a transaction locally, but gasPrice, maxFeePerGas, and maxPriorityFeePerGas were missing.",
378
378
  title: "Missing fee price parameters",
379
- 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.
379
+ 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.
380
380
 
381
381
  Please double check your transactions' parameters.`,
382
382
  shouldBeReported: false,
@@ -396,8 +396,8 @@ Please check that you are sending an \`address\` parameter.`,
396
396
  number: 200,
397
397
  message: "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.",
398
398
  title: "Could not add positional param",
399
- description: `Could add a positional param to your task because
400
- there is already a variadic positional param and it has to be the last
399
+ description: `Could add a positional param to your task because
400
+ there is already a variadic positional param and it has to be the last
401
401
  positional one.
402
402
 
403
403
  Please double check your task definitions.`,
@@ -408,7 +408,7 @@ Please double check your task definitions.`,
408
408
  message: "Could not set param %paramName% for task %taskName% because its name is already used.",
409
409
  title: "Repeated param name",
410
410
  description: `Could not add a param to your task because its name is already used.
411
-
411
+
412
412
  Please double check your task definitions.`,
413
413
  shouldBeReported: false,
414
414
  },
@@ -417,7 +417,7 @@ Please double check your task definitions.`,
417
417
  message: "Could not set param %paramName% for task %taskName% because its name is used as a param for Hardhat.",
418
418
  title: "Hardhat and task param names clash",
419
419
  description: `Could not add a param to your task because its name is used as a param for Hardhat.
420
-
420
+
421
421
  Please double check your task definitions.`,
422
422
  shouldBeReported: false,
423
423
  },
@@ -426,7 +426,7 @@ Please double check your task definitions.`,
426
426
  message: "Could not set param %paramName% for task %taskName% because it is mandatory and it was added after an optional positional param.",
427
427
  title: "Optional param followed by a required one",
428
428
  description: `Could not add param to your task because it is required and it was added after an optional positional param.
429
-
429
+
430
430
  Please double check your task definitions.`,
431
431
  shouldBeReported: false,
432
432
  },
@@ -434,7 +434,7 @@ Please double check your task definitions.`,
434
434
  number: 204,
435
435
  message: "No action set for task %taskName%.",
436
436
  title: "Tried to run task without an action",
437
- description: `A task was run, but it has no action set.
437
+ description: `A task was run, but it has no action set.
438
438
 
439
439
  Please double check your task definitions.`,
440
440
  shouldBeReported: false,
@@ -443,7 +443,7 @@ Please double check your task definitions.`,
443
443
  number: 205,
444
444
  message: "Tried to call runSuper from a non-overridden definition of task %taskName%",
445
445
  title: "`runSuper` not available",
446
- description: `You tried to call \`runSuper\` from a non-overridden task.
446
+ description: `You tried to call \`runSuper\` from a non-overridden task.
447
447
 
448
448
  Please use \`runSuper.isDefined\` to make sure that you can call it.`,
449
449
  shouldBeReported: false,
@@ -452,7 +452,7 @@ Please use \`runSuper.isDefined\` to make sure that you can call it.`,
452
452
  number: 206,
453
453
  message: "Default value for param %paramName% of task %taskName% doesn't match the default one, try specifying it.",
454
454
  title: "Default value has incorrect type",
455
- description: `One of your tasks has a parameter whose default value doesn't match the expected type.
455
+ description: `One of your tasks has a parameter whose default value doesn't match the expected type.
456
456
 
457
457
  Please double check your task definitions.`,
458
458
  shouldBeReported: false,
@@ -461,7 +461,7 @@ Please double check your task definitions.`,
461
461
  number: 207,
462
462
  message: "Default value for param %paramName% of task %taskName% shouldn't be set.",
463
463
  title: "Required parameter has a default value",
464
- description: `One of your tasks has a required parameter with a default value.
464
+ description: `One of your tasks has a required parameter with a default value.
465
465
 
466
466
  Please double check your task definitions.`,
467
467
  shouldBeReported: false,
@@ -470,7 +470,7 @@ Please double check your task definitions.`,
470
470
  number: 208,
471
471
  message: "Invalid param name %paramName% in task %taskName%. Param names must be camelCase.",
472
472
  title: "Invalid casing in parameter name",
473
- description: `Your parameter names must use camelCase.
473
+ description: `Your parameter names must use camelCase.
474
474
 
475
475
  Please double check your task definitions.`,
476
476
  shouldBeReported: false,
@@ -513,7 +513,7 @@ Please double check your task definitions.`,
513
513
  title: "Invalid argument type",
514
514
  message: "Task %task% is not a subtask but one of its arguments uses the type %type%, which is not parseable.",
515
515
  description: `Tasks that can be invoked from the command line require CLIArgumentType types for their arguments.
516
-
516
+
517
517
  What makes these types special is that they can be represented as strings, so you can write them down in the terminal.`,
518
518
  shouldBeReported: false,
519
519
  },
@@ -541,7 +541,7 @@ Please double check your arguments.`,
541
541
  number: 302,
542
542
  message: "Invalid argument %name%: File %value% doesn't exist or is not a readable file.",
543
543
  title: "Invalid file argument",
544
- description: `One of your tasks expected a file as an argument, but you provided a
544
+ description: `One of your tasks expected a file as an argument, but you provided a
545
545
  nonexistent or non-readable file.
546
546
 
547
547
  Please double check your arguments.`,
@@ -561,7 +561,7 @@ Please double check the name of the task you are trying to run.`,
561
561
  message: "Unrecognised command line argument %argument%.\nNote that task arguments must come after the task name.",
562
562
  title: "Unrecognized command line argument",
563
563
  description: `Hardhat couldn't recognize one of your command line arguments.
564
-
564
+
565
565
  This may be because you are writing it before the task name. It should come after it.
566
566
 
567
567
  Please double check how you invoked Hardhat.`,
@@ -572,7 +572,7 @@ Please double check how you invoked Hardhat.`,
572
572
  message: "Unrecognized param %param%",
573
573
  title: "Unrecognized param",
574
574
  description: `Hardhat couldn't recognize one of your tasks' parameters.
575
-
575
+
576
576
  Please double check how you invoked Hardhat or ran your task.`,
577
577
  shouldBeReported: false,
578
578
  },
@@ -580,7 +580,7 @@ Please double check how you invoked Hardhat or ran your task.`,
580
580
  number: 306,
581
581
  message: "The '%param%' parameter of task '%task%' expects a value, but none was passed.",
582
582
  title: "Missing task argument",
583
- description: `You tried to run a task, but one of its required arguments was missing.
583
+ description: `You tried to run a task, but one of its required arguments was missing.
584
584
 
585
585
  Please double check how you invoked Hardhat or ran your task.`,
586
586
  shouldBeReported: false,
@@ -589,7 +589,7 @@ Please double check how you invoked Hardhat or ran your task.`,
589
589
  number: 307,
590
590
  message: "Missing positional argument %param%",
591
591
  title: "Missing task positional argument",
592
- description: `You tried to run a task, but one of its required arguments was missing.
592
+ description: `You tried to run a task, but one of its required arguments was missing.
593
593
 
594
594
  Please double check how you invoked Hardhat or ran your task.`,
595
595
  shouldBeReported: false,
@@ -607,7 +607,7 @@ Please double check how you invoked Hardhat or ran your task.`,
607
607
  number: 309,
608
608
  message: "Repeated parameter %param%",
609
609
  title: "Repeated task parameter",
610
- description: `You tried to run a task with a repeated parameter.
610
+ description: `You tried to run a task with a repeated parameter.
611
611
 
612
612
  Please double check how you invoked Hardhat or ran your task.`,
613
613
  shouldBeReported: false,
@@ -616,7 +616,7 @@ Please double check how you invoked Hardhat or ran your task.`,
616
616
  number: 310,
617
617
  message: "Invalid param %param%. Command line params must be lowercase.",
618
618
  title: "Invalid casing in command line parameter",
619
- description: `You tried to run hardhat with a parameter with invalid casing. They must be lowercase.
619
+ description: `You tried to run hardhat with a parameter with invalid casing. They must be lowercase.
620
620
 
621
621
  Please double check how you invoked Hardhat.`,
622
622
  shouldBeReported: false,
@@ -625,7 +625,7 @@ Please double check how you invoked Hardhat.`,
625
625
  number: 311,
626
626
  message: "Error parsing JSON value for argument %param%: %error%",
627
627
  title: "Invalid JSON parameter",
628
- description: `You tried to run a task with an invalid JSON parameter.
628
+ description: `You tried to run a task with an invalid JSON parameter.
629
629
 
630
630
  Please double check how you invoked Hardhat or ran your task.`,
631
631
  shouldBeReported: false,
@@ -635,7 +635,7 @@ Please double check how you invoked Hardhat or ran your task.`,
635
635
  title: "Subtask run from the command line",
636
636
  message: "Trying to run the %name% subtask from the CLI",
637
637
  description: `You tried to run a subtask from the command line.
638
-
638
+
639
639
  This is not supported. Please run the help task to see the available options.`,
640
640
  shouldBeReported: false,
641
641
  },
@@ -670,7 +670,7 @@ Please double check your imports or install the missing dependency.`,
670
670
  number: 402,
671
671
  message: "File %file% doesn't exist.",
672
672
  title: "Missing library file",
673
- description: `One of your libraries' files was imported but doesn't exist.
673
+ description: `One of your libraries' files was imported but doesn't exist.
674
674
 
675
675
  Please double check your imports or update your libraries.`,
676
676
  shouldBeReported: false,
@@ -679,7 +679,7 @@ Please double check your imports or update your libraries.`,
679
679
  number: 403,
680
680
  message: "Illegal import %imported% from %from%",
681
681
  title: "Illegal Solidity import",
682
- description: `One of your libraries tried to use a relative import to import a file outside of its scope.
682
+ description: `One of your libraries tried to use a relative import to import a file outside of its scope.
683
683
 
684
684
  This is disabled for security reasons.`,
685
685
  shouldBeReported: false,
@@ -698,7 +698,7 @@ Please double check your imports.`,
698
698
  message: "Invalid import %imported% from %from%. Imports must use / instead of \\, even in Windows",
699
699
  title: "Invalid import: use / instead of \\",
700
700
  description: `A Solidity file is trying to import another file via relative path and is using backslashes (\\\\) instead of slashes (/).
701
-
701
+
702
702
  You must always use slashes (/) in Solidity imports.`,
703
703
  shouldBeReported: false,
704
704
  },
@@ -707,7 +707,7 @@ You must always use slashes (/) in Solidity imports.`,
707
707
  message: "Invalid import %imported% from %from%. Hardhat doesn't support imports via %protocol%.",
708
708
  title: "Invalid import: trying to use an unsupported protocol",
709
709
  description: `A Solidity file is trying to import a file using an unsupported protocol, like http.
710
-
710
+
711
711
  You can only import files that are available locally or installed through npm.`,
712
712
  shouldBeReported: false,
713
713
  },
@@ -716,7 +716,7 @@ You can only import files that are available locally or installed through npm.`,
716
716
  message: "Invalid import %imported% from %from%. Hardhat doesn't support imports with absolute paths.",
717
717
  title: "Invalid import: absolute paths unsupported",
718
718
  description: `A Solidity file is trying to import a file using its absolute path.
719
-
719
+
720
720
  This is not supported, as it would lead to hard-to-reproduce compilations.`,
721
721
  shouldBeReported: false,
722
722
  },
@@ -725,7 +725,7 @@ This is not supported, as it would lead to hard-to-reproduce compilations.`,
725
725
  message: "Invalid import %imported% from %from%. The file being imported is outside of the project",
726
726
  title: "Invalid import: file outside of the project",
727
727
  description: `A Solidity file is trying to import a file that is outside of the project.
728
-
728
+
729
729
  This is not supported by Hardhat.`,
730
730
  shouldBeReported: false,
731
731
  },
@@ -734,7 +734,7 @@ This is not supported by Hardhat.`,
734
734
  message: "Trying to import %imported% from %from%, but it has an incorrect casing.",
735
735
  title: "Invalid import: wrong file casing",
736
736
  description: `A Solidity file is trying to import a file but its source name casing was wrong.
737
-
737
+
738
738
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
739
739
  shouldBeReported: false,
740
740
  },
@@ -743,7 +743,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
743
743
  message: "Trying to resolve the file %incorrect% but its correct case-sensitive name is %correct%",
744
744
  title: "Incorrect source name casing",
745
745
  description: `You tried to resolve a Solidity file with an incorrect casing.
746
-
746
+
747
747
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
748
748
  shouldBeReported: false,
749
749
  },
@@ -752,19 +752,28 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
752
752
  message: "The library %library%, imported from %from%, is not installed. Try installing it using npm.",
753
753
  title: "Invalid import: library not installed",
754
754
  description: `A Solidity file is trying to import another which belongs to a library that is not installed.
755
-
755
+
756
756
  Try installing the library using npm.`,
757
757
  shouldBeReported: false,
758
758
  },
759
+ INCLUDES_OWN_PACKAGE_NAME: {
760
+ number: 412,
761
+ message: "Invalid import %imported% from %from%. Trying to import file using the own package's name.",
762
+ title: "Invalid import: includes own package's name",
763
+ 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.
764
+
765
+ Use a relative import instead of referencing the package's name.`,
766
+ shouldBeReported: false,
767
+ },
759
768
  },
760
769
  SOLC: {
761
770
  INVALID_VERSION: {
762
771
  number: 500,
763
772
  message: `Solidity version %version% is invalid or hasn't been released yet.
764
-
773
+
765
774
  If you are certain it has been released, run "npx hardhat clean --global" and try again`,
766
775
  title: "Invalid or unreleased `solc` version",
767
- description: `The Solidity version in your config is invalid or hasn't been released yet.
776
+ description: `The Solidity version in your config is invalid or hasn't been released yet.
768
777
 
769
778
  If you are certain it has been released, run \`npx hardhat clean --global\` and try again.`,
770
779
  shouldBeReported: false,
@@ -773,8 +782,8 @@ If you are certain it has been released, run \`npx hardhat clean --global\` and
773
782
  number: 501,
774
783
  message: "Couldn't download compiler version %remoteVersion%. Please check your internet connection and try again.",
775
784
  title: "`solc` download failed",
776
- description: `Couldn't download \`solc\`.
777
-
785
+ description: `Couldn't download \`solc\`.
786
+
778
787
  Please check your internet connection and try again.`,
779
788
  shouldBeReported: false,
780
789
  },
@@ -782,8 +791,8 @@ Please check your internet connection and try again.`,
782
791
  number: 502,
783
792
  message: "Couldn't download compiler version list. Please check your internet connection and try again.",
784
793
  title: "Couldn't obtain `solc` version list",
785
- description: `Couldn't download \`solc\`'s version list.
786
-
794
+ description: `Couldn't download \`solc\`'s version list.
795
+
787
796
  Please check your internet connection and try again.`,
788
797
  shouldBeReported: false,
789
798
  },
@@ -796,7 +805,7 @@ Please check your internet connection and try again.
796
805
  If this error persists, run "npx hardhat clean --global".`,
797
806
  title: "Downloaded `solc` checksum verification failed",
798
807
  description: `Hardhat downloaded a version of the Solidity compiler, and its checksum verification failed.
799
-
808
+
800
809
  Please check your internet connection and try again.
801
810
 
802
811
  If this error persists, run \`npx hardhat clean --global\`.`,
@@ -833,7 +842,7 @@ If this error persists, run "npx hardhat clean --global".`,
833
842
  message: "Compilation failed",
834
843
  title: "Compilation failed",
835
844
  description: `Your smart contracts failed to compile.
836
-
845
+
837
846
  Please check Hardhat's output for more details.`,
838
847
  shouldBeReported: false,
839
848
  },
@@ -842,7 +851,7 @@ Please check Hardhat's output for more details.`,
842
851
  message: "Script %script% doesn't exist.",
843
852
  title: "Script doesn't exist",
844
853
  description: `Tried to use \`hardhat run\` to execute a nonexistent script.
845
-
854
+
846
855
  Please double check your script's path.`,
847
856
  shouldBeReported: false,
848
857
  },
@@ -850,7 +859,7 @@ Please double check your script's path.`,
850
859
  number: 602,
851
860
  message: "Error running script {%script%}: %error%",
852
861
  title: "Error running script",
853
- description: `Running a script resulted in an error.
862
+ description: `Running a script resulted in an error.
854
863
 
855
864
  Please check Hardhat's output for more details.`,
856
865
  shouldBeReported: false,
@@ -859,7 +868,7 @@ Please check Hardhat's output for more details.`,
859
868
  number: 603,
860
869
  message: "Hardhat flatten doesn't support cyclic dependencies.",
861
870
  title: "Flatten detected cyclic dependencies",
862
- description: `Hardhat flatten doesn't support cyclic dependencies.
871
+ description: `Hardhat flatten doesn't support cyclic dependencies.
863
872
 
864
873
  We recommend not using this kind of dependency.`,
865
874
  shouldBeReported: false,
@@ -876,7 +885,7 @@ We recommend not using this kind of dependency.`,
876
885
  message: "Unsupported network for JSON-RPC server. Only hardhat is currently supported.",
877
886
  title: "Unsupported network for JSON-RPC server.",
878
887
  description: `JSON-RPC server can only be started when running the Hardhat Network.
879
-
888
+
880
889
  To start the JSON-RPC server, retry the command without the --network parameter.`,
881
890
  shouldBeReported: false,
882
891
  },
@@ -927,7 +936,7 @@ Please replace %contractName% for one of these options wherever you are trying t
927
936
  %candidates%
928
937
  `,
929
938
  title: "Multiple artifacts found",
930
- description: `There are multiple artifacts that match the given contract name, and Hardhat doesn't know which one to use.
939
+ description: `There are multiple artifacts that match the given contract name, and Hardhat doesn't know which one to use.
931
940
 
932
941
  Please use the fully qualified name of the contract to disambiguate it.`,
933
942
  shouldBeReported: false,
@@ -937,7 +946,7 @@ Please use the fully qualified name of the contract to disambiguate it.`,
937
946
  message: "Invalid artifact path %incorrect%, its correct case-sensitive path is %correct%",
938
947
  title: "Incorrect artifact path casing",
939
948
  description: `You tried to get an artifact file with an incorrect casing.
940
-
949
+
941
950
  Hardhat's artifact resolution is case sensitive to ensure projects are portable across different operating systems.`,
942
951
  shouldBeReported: true,
943
952
  },
@@ -998,6 +1007,15 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
998
1007
  title: "Inferred artifact path doesn't exist",
999
1008
  description: `The inferred artifact path doesn't exist.
1000
1009
 
1010
+ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us improve Hardhat.`,
1011
+ shouldBeReported: true,
1012
+ },
1013
+ NO_SUPPORTED_ARTIFACT_SOURCE: {
1014
+ number: 904,
1015
+ message: "No configured artifact source can handle method %method%",
1016
+ title: "No configured artifact source can handle the request",
1017
+ description: `No configured artifact source can handle the requested method.
1018
+
1001
1019
  Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us improve Hardhat.`,
1002
1020
  shouldBeReported: true,
1003
1021
  },
@@ -1008,7 +1026,7 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
1008
1026
  message: "Invalid source name %name%. Expected source name but found an absolute path.",
1009
1027
  title: "Invalid source name: absolute path",
1010
1028
  description: `A Solidity source name was expected, but an absolute path was given.
1011
-
1029
+
1012
1030
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1013
1031
  shouldBeReported: true,
1014
1032
  },
@@ -1017,7 +1035,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1017
1035
  message: "Invalid source name %name%. Expected source name but found a relative path.",
1018
1036
  title: "Invalid source name: relative path",
1019
1037
  description: `A Solidity source name was expected, but a relative path was given.
1020
-
1038
+
1021
1039
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1022
1040
  shouldBeReported: true,
1023
1041
  },
@@ -1026,7 +1044,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1026
1044
  message: "Invalid source %name%. The source name uses backslashes (\\) instead of slashes (/).",
1027
1045
  title: "Invalid source name: backslashes",
1028
1046
  description: `A Solidity source name was invalid because it uses backslashes (\\\\) instead of slashes (/).
1029
-
1047
+
1030
1048
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1031
1049
  shouldBeReported: true,
1032
1050
  },
@@ -1035,7 +1053,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1035
1053
  message: "Invalid source name %name%. Source names must be normalized",
1036
1054
  title: "Invalid source name: not normalized",
1037
1055
  description: `A Solidity source name was invalid because it wasn't normalized. It probably contains some "." or "..".
1038
-
1056
+
1039
1057
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1040
1058
  shouldBeReported: true,
1041
1059
  },
@@ -1044,7 +1062,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1044
1062
  message: "Invalid source map %incorrect%, its correct case-sensitive source name is %correct%",
1045
1063
  title: "Incorrect source name casing",
1046
1064
  description: `You tried to resolve a Solidity file with an incorrect casing.
1047
-
1065
+
1048
1066
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1049
1067
  shouldBeReported: true,
1050
1068
  },
@@ -1053,7 +1071,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1053
1071
  message: "Solidity source file %name% not found",
1054
1072
  title: "Solidity source file not found",
1055
1073
  description: `A source name should correspond to an existing Solidity file but it doesn't.
1056
-
1074
+
1057
1075
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1058
1076
  shouldBeReported: true,
1059
1077
  },
@@ -1062,7 +1080,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1062
1080
  message: "The file %path% is treated as local but is inside a node_modules directory",
1063
1081
  title: "File from node_modules treated as local",
1064
1082
  description: `A file was treated as local but is inside a node_modules directory.
1065
-
1083
+
1066
1084
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1067
1085
  shouldBeReported: true,
1068
1086
  },
@@ -1071,7 +1089,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1071
1089
  message: "The file %path% is treated as local but is outside the project",
1072
1090
  title: "File from outside the project treated as local",
1073
1091
  description: `A file was treated as local but is outside the project.
1074
-
1092
+
1075
1093
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1076
1094
  shouldBeReported: true,
1077
1095
  },