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
@@ -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,7 +805,7 @@ 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
  },
@@ -824,10 +824,10 @@ Use a relative import instead of referencing the package's name.`,
824
824
  INVALID_VERSION: {
825
825
  number: 500,
826
826
  message: `Solidity version %version% is invalid or hasn't been released yet.
827
-
827
+
828
828
  If you are certain it has been released, run "npx hardhat clean --global" and try again`,
829
829
  title: "Invalid or unreleased `solc` version",
830
- 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.
831
831
 
832
832
  If you are certain it has been released, run \`npx hardhat clean --global\` and try again.`,
833
833
  shouldBeReported: false,
@@ -837,8 +837,8 @@ If you are certain it has been released, run \`npx hardhat clean --global\` and
837
837
  message:
838
838
  "Couldn't download compiler version %remoteVersion%. Please check your internet connection and try again.",
839
839
  title: "`solc` download failed",
840
- description: `Couldn't download \`solc\`.
841
-
840
+ description: `Couldn't download \`solc\`.
841
+
842
842
  Please check your internet connection and try again.`,
843
843
  shouldBeReported: false,
844
844
  },
@@ -847,8 +847,8 @@ Please check your internet connection and try again.`,
847
847
  message:
848
848
  "Couldn't download compiler version list. Please check your internet connection and try again.",
849
849
  title: "Couldn't obtain `solc` version list",
850
- description: `Couldn't download \`solc\`'s version list.
851
-
850
+ description: `Couldn't download \`solc\`'s version list.
851
+
852
852
  Please check your internet connection and try again.`,
853
853
  shouldBeReported: false,
854
854
  },
@@ -861,7 +861,7 @@ Please check your internet connection and try again.
861
861
  If this error persists, run "npx hardhat clean --global".`,
862
862
  title: "Downloaded `solc` checksum verification failed",
863
863
  description: `Hardhat downloaded a version of the Solidity compiler, and its checksum verification failed.
864
-
864
+
865
865
  Please check your internet connection and try again.
866
866
 
867
867
  If this error persists, run \`npx hardhat clean --global\`.`,
@@ -898,7 +898,7 @@ If this error persists, run "npx hardhat clean --global".`,
898
898
  message: "Compilation failed",
899
899
  title: "Compilation failed",
900
900
  description: `Your smart contracts failed to compile.
901
-
901
+
902
902
  Please check Hardhat's output for more details.`,
903
903
  shouldBeReported: false,
904
904
  },
@@ -907,7 +907,7 @@ Please check Hardhat's output for more details.`,
907
907
  message: "Script %script% doesn't exist.",
908
908
  title: "Script doesn't exist",
909
909
  description: `Tried to use \`hardhat run\` to execute a nonexistent script.
910
-
910
+
911
911
  Please double check your script's path.`,
912
912
  shouldBeReported: false,
913
913
  },
@@ -915,7 +915,7 @@ Please double check your script's path.`,
915
915
  number: 602,
916
916
  message: "Error running script {%script%}: %error%",
917
917
  title: "Error running script",
918
- description: `Running a script resulted in an error.
918
+ description: `Running a script resulted in an error.
919
919
 
920
920
  Please check Hardhat's output for more details.`,
921
921
  shouldBeReported: false,
@@ -924,7 +924,7 @@ Please check Hardhat's output for more details.`,
924
924
  number: 603,
925
925
  message: "Hardhat flatten doesn't support cyclic dependencies.",
926
926
  title: "Flatten detected cyclic dependencies",
927
- description: `Hardhat flatten doesn't support cyclic dependencies.
927
+ description: `Hardhat flatten doesn't support cyclic dependencies.
928
928
 
929
929
  We recommend not using this kind of dependency.`,
930
930
  shouldBeReported: false,
@@ -942,7 +942,7 @@ We recommend not using this kind of dependency.`,
942
942
  "Unsupported network for JSON-RPC server. Only hardhat is currently supported.",
943
943
  title: "Unsupported network for JSON-RPC server.",
944
944
  description: `JSON-RPC server can only be started when running the Hardhat Network.
945
-
945
+
946
946
  To start the JSON-RPC server, retry the command without the --network parameter.`,
947
947
  shouldBeReported: false,
948
948
  },
@@ -993,7 +993,7 @@ Please replace %contractName% for one of these options wherever you are trying t
993
993
  %candidates%
994
994
  `,
995
995
  title: "Multiple artifacts found",
996
- 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.
997
997
 
998
998
  Please use the fully qualified name of the contract to disambiguate it.`,
999
999
  shouldBeReported: false,
@@ -1004,7 +1004,7 @@ Please use the fully qualified name of the contract to disambiguate it.`,
1004
1004
  "Invalid artifact path %incorrect%, its correct case-sensitive path is %correct%",
1005
1005
  title: "Incorrect artifact path casing",
1006
1006
  description: `You tried to get an artifact file with an incorrect casing.
1007
-
1007
+
1008
1008
  Hardhat's artifact resolution is case sensitive to ensure projects are portable across different operating systems.`,
1009
1009
  shouldBeReported: true,
1010
1010
  },
@@ -1079,7 +1079,7 @@ Please [report it](https://github.com/nomiclabs/hardhat/issues/new) to help us i
1079
1079
  "Invalid source name %name%. Expected source name but found an absolute path.",
1080
1080
  title: "Invalid source name: absolute path",
1081
1081
  description: `A Solidity source name was expected, but an absolute path was given.
1082
-
1082
+
1083
1083
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1084
1084
  shouldBeReported: true,
1085
1085
  },
@@ -1089,7 +1089,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1089
1089
  "Invalid source name %name%. Expected source name but found a relative path.",
1090
1090
  title: "Invalid source name: relative path",
1091
1091
  description: `A Solidity source name was expected, but a relative path was given.
1092
-
1092
+
1093
1093
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1094
1094
  shouldBeReported: true,
1095
1095
  },
@@ -1099,7 +1099,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1099
1099
  "Invalid source %name%. The source name uses backslashes (\\) instead of slashes (/).",
1100
1100
  title: "Invalid source name: backslashes",
1101
1101
  description: `A Solidity source name was invalid because it uses backslashes (\\\\) instead of slashes (/).
1102
-
1102
+
1103
1103
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1104
1104
  shouldBeReported: true,
1105
1105
  },
@@ -1108,7 +1108,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1108
1108
  message: "Invalid source name %name%. Source names must be normalized",
1109
1109
  title: "Invalid source name: not normalized",
1110
1110
  description: `A Solidity source name was invalid because it wasn't normalized. It probably contains some "." or "..".
1111
-
1111
+
1112
1112
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1113
1113
  shouldBeReported: true,
1114
1114
  },
@@ -1118,7 +1118,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1118
1118
  "Invalid source map %incorrect%, its correct case-sensitive source name is %correct%",
1119
1119
  title: "Incorrect source name casing",
1120
1120
  description: `You tried to resolve a Solidity file with an incorrect casing.
1121
-
1121
+
1122
1122
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1123
1123
  shouldBeReported: true,
1124
1124
  },
@@ -1127,7 +1127,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1127
1127
  message: "Solidity source file %name% not found",
1128
1128
  title: "Solidity source file not found",
1129
1129
  description: `A source name should correspond to an existing Solidity file but it doesn't.
1130
-
1130
+
1131
1131
  Hardhat's compiler is case sensitive to ensure projects are portable across different operating systems.`,
1132
1132
  shouldBeReported: true,
1133
1133
  },
@@ -1137,7 +1137,7 @@ Hardhat's compiler is case sensitive to ensure projects are portable across diff
1137
1137
  "The file %path% is treated as local but is inside a node_modules directory",
1138
1138
  title: "File from node_modules treated as local",
1139
1139
  description: `A file was treated as local but is inside a node_modules directory.
1140
-
1140
+
1141
1141
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1142
1142
  shouldBeReported: true,
1143
1143
  },
@@ -1146,7 +1146,7 @@ If you aren't overriding compilation-related tasks, please report this as a bug.
1146
1146
  message: "The file %path% is treated as local but is outside the project",
1147
1147
  title: "File from outside the project treated as local",
1148
1148
  description: `A file was treated as local but is outside the project.
1149
-
1149
+
1150
1150
  If you aren't overriding compilation-related tasks, please report this as a bug.`,
1151
1151
  shouldBeReported: true,
1152
1152
  },
@@ -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);
@@ -6,10 +6,10 @@ export interface HardhatMetadata {
6
6
  // The chain's id. Used to sign transactions.
7
7
  chainId: number;
8
8
 
9
- // A 0x-prefixed hex-encoded 32 bytes id which uniquiely identifies an instance/run
9
+ // A 0x-prefixed hex-encoded 32 bytes id which uniquely identifies an instance/run
10
10
  // of Hardhat Network. Running Hardhat Network more than once (even with the same version
11
- // and parameters) would always result in different `instanceId`s.
12
- // Running `hardhat_reset` would change the `instanceId` of an existing Hardhat Network.
11
+ // and parameters) will always result in different `instanceId`s.
12
+ // Running `hardhat_reset` will change the `instanceId` of an existing Hardhat Network.
13
13
  instanceId: string;
14
14
 
15
15
  // The latest block's number in Hardhat Network
@@ -63,6 +63,9 @@ export class BackwardsCompatibilityProviderAdapter
63
63
  }
64
64
 
65
65
  response.error = {
66
+ // This might be a mistake, but I'm leaving it as is just in case,
67
+ // because it's not obvious what we should do here.
68
+ // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
66
69
  code: error.code ? +error.code : -1,
67
70
  message: error.message,
68
71
  data: {