hardhat 2.12.4 → 2.12.5

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 (63) 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.d.ts.map +1 -1
  6. package/internal/artifacts.js +6 -10
  7. package/internal/artifacts.js.map +1 -1
  8. package/internal/cli/cli.js +3 -1
  9. package/internal/cli/cli.js.map +1 -1
  10. package/internal/cli/project-creation.js +1 -1
  11. package/internal/core/config/config-resolution.d.ts.map +1 -1
  12. package/internal/core/config/config-resolution.js +2 -1
  13. package/internal/core/config/config-resolution.js.map +1 -1
  14. package/internal/core/errors-list.js +75 -75
  15. package/internal/core/flamegraph.js +10 -10
  16. package/internal/core/providers/backwards-compatibility.d.ts.map +1 -1
  17. package/internal/core/providers/backwards-compatibility.js +3 -0
  18. package/internal/core/providers/backwards-compatibility.js.map +1 -1
  19. package/internal/core/providers/gas-providers.d.ts +1 -1
  20. package/internal/core/providers/gas-providers.d.ts.map +1 -1
  21. package/internal/core/providers/gas-providers.js +1 -1
  22. package/internal/core/providers/gas-providers.js.map +1 -1
  23. package/internal/hardhat-network/jsonrpc/client.d.ts.map +1 -1
  24. package/internal/hardhat-network/jsonrpc/client.js +5 -3
  25. package/internal/hardhat-network/jsonrpc/client.js.map +1 -1
  26. package/internal/hardhat-network/provider/modules/eth.js +4 -4
  27. package/internal/hardhat-network/stack-traces/error-inferrer.d.ts.map +1 -1
  28. package/internal/hardhat-network/stack-traces/error-inferrer.js +2 -5
  29. package/internal/hardhat-network/stack-traces/error-inferrer.js.map +1 -1
  30. package/internal/hardhat-network/stack-traces/solidity-errors.d.ts.map +1 -1
  31. package/internal/hardhat-network/stack-traces/solidity-errors.js +2 -1
  32. package/internal/hardhat-network/stack-traces/solidity-errors.js.map +1 -1
  33. package/internal/solidity/dependencyGraph.d.ts.map +1 -1
  34. package/internal/solidity/dependencyGraph.js +2 -0
  35. package/internal/solidity/dependencyGraph.js.map +1 -1
  36. package/internal/util/console.d.ts.map +1 -1
  37. package/internal/util/console.js +1 -1
  38. package/internal/util/console.js.map +1 -1
  39. package/internal/util/download.d.ts +3 -1
  40. package/internal/util/download.d.ts.map +1 -1
  41. package/internal/util/download.js +2 -1
  42. package/internal/util/download.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/builtin-tasks/compile.ts +2 -4
  45. package/src/builtin-tasks/flatten.ts +14 -3
  46. package/src/internal/artifacts.ts +6 -15
  47. package/src/internal/cli/cli.ts +5 -1
  48. package/src/internal/cli/project-creation.ts +1 -1
  49. package/src/internal/core/config/config-resolution.ts +4 -3
  50. package/src/internal/core/errors-list.ts +75 -75
  51. package/src/internal/core/flamegraph.ts +10 -10
  52. package/src/internal/core/jsonrpc/types/output/metadata.ts +3 -3
  53. package/src/internal/core/providers/backwards-compatibility.ts +3 -0
  54. package/src/internal/core/providers/gas-providers.ts +1 -1
  55. package/src/internal/hardhat-network/jsonrpc/client.ts +7 -4
  56. package/src/internal/hardhat-network/provider/modules/eth.ts +4 -4
  57. package/src/internal/hardhat-network/stack-traces/compiler-to-model.ts +2 -2
  58. package/src/internal/hardhat-network/stack-traces/error-inferrer.ts +2 -6
  59. package/src/internal/hardhat-network/stack-traces/solidity-errors.ts +3 -1
  60. package/src/internal/solidity/compiler/downloader.ts +1 -1
  61. package/src/internal/solidity/dependencyGraph.ts +2 -0
  62. package/src/internal/util/console.ts +4 -2
  63. package/src/internal/util/download.ts +3 -1
@@ -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,7 +752,7 @@ 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
  },
@@ -770,10 +770,10 @@ Use a relative import instead of referencing the package's name.`,
770
770
  INVALID_VERSION: {
771
771
  number: 500,
772
772
  message: `Solidity version %version% is invalid or hasn't been released yet.
773
-
773
+
774
774
  If you are certain it has been released, run "npx hardhat clean --global" and try again`,
775
775
  title: "Invalid or unreleased `solc` version",
776
- 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.
777
777
 
778
778
  If you are certain it has been released, run \`npx hardhat clean --global\` and try again.`,
779
779
  shouldBeReported: false,
@@ -782,8 +782,8 @@ If you are certain it has been released, run \`npx hardhat clean --global\` and
782
782
  number: 501,
783
783
  message: "Couldn't download compiler version %remoteVersion%. Please check your internet connection and try again.",
784
784
  title: "`solc` download failed",
785
- description: `Couldn't download \`solc\`.
786
-
785
+ description: `Couldn't download \`solc\`.
786
+
787
787
  Please check your internet connection and try again.`,
788
788
  shouldBeReported: false,
789
789
  },
@@ -791,8 +791,8 @@ Please check your internet connection and try again.`,
791
791
  number: 502,
792
792
  message: "Couldn't download compiler version list. Please check your internet connection and try again.",
793
793
  title: "Couldn't obtain `solc` version list",
794
- description: `Couldn't download \`solc\`'s version list.
795
-
794
+ description: `Couldn't download \`solc\`'s version list.
795
+
796
796
  Please check your internet connection and try again.`,
797
797
  shouldBeReported: false,
798
798
  },
@@ -805,7 +805,7 @@ Please check your internet connection and try again.
805
805
  If this error persists, run "npx hardhat clean --global".`,
806
806
  title: "Downloaded `solc` checksum verification failed",
807
807
  description: `Hardhat downloaded a version of the Solidity compiler, and its checksum verification failed.
808
-
808
+
809
809
  Please check your internet connection and try again.
810
810
 
811
811
  If this error persists, run \`npx hardhat clean --global\`.`,
@@ -842,7 +842,7 @@ If this error persists, run "npx hardhat clean --global".`,
842
842
  message: "Compilation failed",
843
843
  title: "Compilation failed",
844
844
  description: `Your smart contracts failed to compile.
845
-
845
+
846
846
  Please check Hardhat's output for more details.`,
847
847
  shouldBeReported: false,
848
848
  },
@@ -851,7 +851,7 @@ Please check Hardhat's output for more details.`,
851
851
  message: "Script %script% doesn't exist.",
852
852
  title: "Script doesn't exist",
853
853
  description: `Tried to use \`hardhat run\` to execute a nonexistent script.
854
-
854
+
855
855
  Please double check your script's path.`,
856
856
  shouldBeReported: false,
857
857
  },
@@ -859,7 +859,7 @@ Please double check your script's path.`,
859
859
  number: 602,
860
860
  message: "Error running script {%script%}: %error%",
861
861
  title: "Error running script",
862
- description: `Running a script resulted in an error.
862
+ description: `Running a script resulted in an error.
863
863
 
864
864
  Please check Hardhat's output for more details.`,
865
865
  shouldBeReported: false,
@@ -868,7 +868,7 @@ Please check Hardhat's output for more details.`,
868
868
  number: 603,
869
869
  message: "Hardhat flatten doesn't support cyclic dependencies.",
870
870
  title: "Flatten detected cyclic dependencies",
871
- description: `Hardhat flatten doesn't support cyclic dependencies.
871
+ description: `Hardhat flatten doesn't support cyclic dependencies.
872
872
 
873
873
  We recommend not using this kind of dependency.`,
874
874
  shouldBeReported: false,
@@ -885,7 +885,7 @@ We recommend not using this kind of dependency.`,
885
885
  message: "Unsupported network for JSON-RPC server. Only hardhat is currently supported.",
886
886
  title: "Unsupported network for JSON-RPC server.",
887
887
  description: `JSON-RPC server can only be started when running the Hardhat Network.
888
-
888
+
889
889
  To start the JSON-RPC server, retry the command without the --network parameter.`,
890
890
  shouldBeReported: false,
891
891
  },
@@ -936,7 +936,7 @@ Please replace %contractName% for one of these options wherever you are trying t
936
936
  %candidates%
937
937
  `,
938
938
  title: "Multiple artifacts found",
939
- 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.
940
940
 
941
941
  Please use the fully qualified name of the contract to disambiguate it.`,
942
942
  shouldBeReported: false,
@@ -946,7 +946,7 @@ Please use the fully qualified name of the contract to disambiguate it.`,
946
946
  message: "Invalid artifact path %incorrect%, its correct case-sensitive path is %correct%",
947
947
  title: "Incorrect artifact path casing",
948
948
  description: `You tried to get an artifact file with an incorrect casing.
949
-
949
+
950
950
  Hardhat's artifact resolution is case sensitive to ensure projects are portable across different operating systems.`,
951
951
  shouldBeReported: true,
952
952
  },
@@ -1017,7 +1017,7 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
1017
1017
  message: "Invalid source name %name%. Expected source name but found an absolute path.",
1018
1018
  title: "Invalid source name: absolute path",
1019
1019
  description: `A Solidity source name was expected, but an absolute path was given.
1020
-
1020
+
1021
1021
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1022
1022
  shouldBeReported: true,
1023
1023
  },
@@ -1026,7 +1026,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1026
1026
  message: "Invalid source name %name%. Expected source name but found a relative path.",
1027
1027
  title: "Invalid source name: relative path",
1028
1028
  description: `A Solidity source name was expected, but a relative path was given.
1029
-
1029
+
1030
1030
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1031
1031
  shouldBeReported: true,
1032
1032
  },
@@ -1035,7 +1035,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1035
1035
  message: "Invalid source %name%. The source name uses backslashes (\\) instead of slashes (/).",
1036
1036
  title: "Invalid source name: backslashes",
1037
1037
  description: `A Solidity source name was invalid because it uses backslashes (\\\\) instead of slashes (/).
1038
-
1038
+
1039
1039
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1040
1040
  shouldBeReported: true,
1041
1041
  },
@@ -1044,7 +1044,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1044
1044
  message: "Invalid source name %name%. Source names must be normalized",
1045
1045
  title: "Invalid source name: not normalized",
1046
1046
  description: `A Solidity source name was invalid because it wasn't normalized. It probably contains some "." or "..".
1047
-
1047
+
1048
1048
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1049
1049
  shouldBeReported: true,
1050
1050
  },
@@ -1053,7 +1053,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1053
1053
  message: "Invalid source map %incorrect%, its correct case-sensitive source name is %correct%",
1054
1054
  title: "Incorrect source name casing",
1055
1055
  description: `You tried to resolve a Solidity file with an incorrect casing.
1056
-
1056
+
1057
1057
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1058
1058
  shouldBeReported: true,
1059
1059
  },
@@ -1062,7 +1062,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1062
1062
  message: "Solidity source file %name% not found",
1063
1063
  title: "Solidity source file not found",
1064
1064
  description: `A source name should correspond to an existing Solidity file but it doesn't.
1065
-
1065
+
1066
1066
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1067
1067
  shouldBeReported: true,
1068
1068
  },
@@ -1071,7 +1071,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1071
1071
  message: "The file %path% is treated as local but is inside a node_modules directory",
1072
1072
  title: "File from node_modules treated as local",
1073
1073
  description: `A file was treated as local but is inside a node_modules directory.
1074
-
1074
+
1075
1075
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1076
1076
  shouldBeReported: true,
1077
1077
  },
@@ -1080,7 +1080,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1080
1080
  message: "The file %path% is treated as local but is outside the project",
1081
1081
  title: "File from outside the project treated as local",
1082
1082
  description: `A file was treated as local but is outside the project.
1083
-
1083
+
1084
1084
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1085
1085
  shouldBeReported: true,
1086
1086
  },
@@ -144,7 +144,7 @@ function getFlamegraphFileContent(flamegraph) {
144
144
 
145
145
  <!-- D3.js -->
146
146
  <script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script>
147
-
147
+
148
148
  <!-- d3-tip -->
149
149
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js"></script>
150
150
 
@@ -166,27 +166,27 @@ function getFlamegraphFileContent(flamegraph) {
166
166
 
167
167
  function label(d) {
168
168
  if (d.data.parallel) {
169
- return "(multiple parallel runs) task: " + d.data.name + ", max time: " + readableTime(d.data.value);
169
+ return "(multiple parallel runs) task: " + d.data.name + ", max time: " + readableTime(d.data.value);
170
170
  }
171
-
171
+
172
172
  return "task: " + d.data.name + ", time: " + readableTime(d.data.value);
173
173
  }
174
-
174
+
175
175
  function readableTime(t) {
176
176
  const NANOSECONDS_TO_MILLISECONDS = 1_000_000;
177
177
  const NANOSECONDS_TO_SECONDS = 1_000_000_000;
178
-
178
+
179
179
  if (t < NANOSECONDS_TO_MILLISECONDS) {
180
180
  return t + "ns";
181
181
  }
182
-
182
+
183
183
  if (t < NANOSECONDS_TO_SECONDS) {
184
184
  return (t / NANOSECONDS_TO_MILLISECONDS).toFixed(4) + "ms";
185
185
  }
186
-
186
+
187
187
  return (t / NANOSECONDS_TO_SECONDS).toFixed(4) + "s";
188
188
  }
189
-
189
+
190
190
  const tip = d3.tip()
191
191
  .direction("s")
192
192
  .offset([8, 0])
@@ -199,7 +199,7 @@ function getFlamegraphFileContent(flamegraph) {
199
199
  flameGraph.setDetailsElement(details);
200
200
 
201
201
  flameGraph.label(label);
202
-
202
+
203
203
  flameGraph.setColorMapper(function(d, originalColor) {
204
204
  if (d.highlight) {
205
205
  return '#E600E6';
@@ -211,7 +211,7 @@ function getFlamegraphFileContent(flamegraph) {
211
211
 
212
212
  return "#EB5414"
213
213
  });
214
-
214
+
215
215
  d3.select("#chart")
216
216
  .datum(${data})
217
217
  .call(flameGraph);
@@ -1 +1 @@
1
- {"version":3,"file":"backwards-compatibility.d.ts","sourceRoot":"","sources":["../../../src/internal/core/providers/backwards-compatibility.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;;GAMG;AACH,qBAAa,qCACX,SAAQ,mBACR,YAAW,gBAAgB;IAEf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,eAAe;IAQhD,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlD,SAAS,CACd,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,KAAK,IAAI,GACxD,IAAI;YAIO,mBAAmB;CA+BlC"}
1
+ {"version":3,"file":"backwards-compatibility.d.ts","sourceRoot":"","sources":["../../../src/internal/core/providers/backwards-compatibility.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;;GAMG;AACH,qBAAa,qCACX,SAAQ,mBACR,YAAW,gBAAgB;IAEf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,eAAe;IAQhD,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAIlD,SAAS,CACd,OAAO,EAAE,cAAc,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe,KAAK,IAAI,GACxD,IAAI;YAIO,mBAAmB;CAkClC"}
@@ -48,6 +48,9 @@ class BackwardsCompatibilityProviderAdapter extends event_emitter_1.EventEmitter
48
48
  throw error;
49
49
  }
50
50
  response.error = {
51
+ // This might be a mistake, but I'm leaving it as is just in case,
52
+ // because it's not obvious what we should do here.
53
+ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
51
54
  code: error.code ? +error.code : -1,
52
55
  message: error.message,
53
56
  data: {