@nomicfoundation/hardhat-errors 3.0.0-next.9 → 3.0.1

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.
@@ -3,7 +3,7 @@ export const ERROR_CATEGORIES = {
3
3
  min: 1,
4
4
  max: 9999,
5
5
  pluginId: undefined,
6
- websiteTitle: "Hardhat Core",
6
+ websiteTitle: "Hardhat 3",
7
7
  CATEGORIES: {
8
8
  GENERAL: {
9
9
  min: 1,
@@ -70,6 +70,11 @@ export const ERROR_CATEGORIES = {
70
70
  max: 1299,
71
71
  websiteSubTitle: "Hardhat test plugin errors",
72
72
  },
73
+ COVERAGE: {
74
+ min: 1300,
75
+ max: 1399,
76
+ websiteSubTitle: "Hardhat coverage errors",
77
+ },
73
78
  },
74
79
  },
75
80
  IGNITION: {
@@ -228,6 +233,24 @@ export const ERROR_CATEGORIES = {
228
233
  },
229
234
  },
230
235
  },
236
+ HARDHAT_VERIFY: {
237
+ min: 80000,
238
+ max: 89999,
239
+ pluginId: "hardhat-verify",
240
+ websiteTitle: "Hardhat Verify",
241
+ CATEGORIES: {
242
+ GENERAL: {
243
+ min: 80000,
244
+ max: 80099,
245
+ websiteSubTitle: "General errors",
246
+ },
247
+ VALIDATION: {
248
+ min: 80100,
249
+ max: 80199,
250
+ websiteSubTitle: "Validation errors",
251
+ },
252
+ },
253
+ },
231
254
  };
232
255
  export const ERRORS = {
233
256
  CORE: {
@@ -358,6 +381,29 @@ Please add the property "type" with the value "module" in your package.json to e
358
381
  websiteTitle: "Invalid hex string",
359
382
  websiteDescription: `Given value was not a valid hex string.`,
360
383
  },
384
+ CONFIG_VARIABLE_FORMAT_MUST_INCLUDE_VARIABLE: {
385
+ number: 19,
386
+ messageTemplate: `The format string "{format}" must include {marker} marker`,
387
+ websiteTitle: "Config variable format must include \\{variable\\}",
388
+ websiteDescription: `The config variable format must include the string "\\{variable\\}", which will be replaced with the actual value of the variable.`,
389
+ },
390
+ INVALID_FULLY_QUALIFIED_NAME: {
391
+ number: 20,
392
+ messageTemplate: `Invalid fully qualified contract name "{name}"`,
393
+ websiteTitle: "Invalid fully qualified contract name",
394
+ websiteDescription: `A contract name was expected to be in fully qualified form, but it's not.
395
+
396
+ A fully qualified name should look like file.sol:Contract`,
397
+ },
398
+ INVALID_CONFIG_FILE: {
399
+ number: 21,
400
+ messageTemplate: `Invalid Hardhat config file at {configPath}:
401
+ {errors}`,
402
+ websiteTitle: "Invalid Hardhat config file",
403
+ websiteDescription: `The config file has JS/TS errors.
404
+
405
+ Please resolve the errors before rerunning the command.`,
406
+ },
361
407
  },
362
408
  INTERNAL: {
363
409
  ASSERTION_ERROR: {
@@ -414,6 +460,12 @@ Please install a version of the peer dependency that meets the plugin's requirem
414
460
  websiteTitle: "Plugin hook factory is not a valid file URL",
415
461
  websiteDescription: `The loading of a plugin's hook factory failed as the import path is not a valid file:// URL.`,
416
462
  },
463
+ UNEXPECTED_HOOK_PARAM_MODIFICATION: {
464
+ number: 301,
465
+ messageTemplate: `Parameter "{paramName}" of hook "{hookCategoryName}#{hookName}" is not allowed to be modified`,
466
+ websiteTitle: "Unexpected hook parameter modification",
467
+ websiteDescription: `The parameter is not allowed to be modified`,
468
+ },
417
469
  },
418
470
  TASK_DEFINITIONS: {
419
471
  INVALID_FILE_ACTION: {
@@ -486,15 +538,15 @@ Please ensure that an action is defined for each task.`,
486
538
  websiteTitle: "Empty task",
487
539
  websiteDescription: "The task is empty. Please ensure that tasks have at least one action.",
488
540
  },
489
- INVALID_ACTION_URL: {
541
+ INVALID_ACTION_IMPORT: {
490
542
  number: 411,
491
- messageTemplate: 'Unable to import the action specified by task "{task}" from the module "{action}"',
492
- websiteTitle: "Invalid action URL",
493
- websiteDescription: "The action URL is invalid. Please ensure that the URL is correct.",
543
+ messageTemplate: 'Unable to import the action for task "{task}".',
544
+ websiteTitle: "Unable to import action for task",
545
+ websiteDescription: "Unable to import action for task. Please verify that the the file exists and that it provides a default function export.",
494
546
  },
495
547
  INVALID_ACTION: {
496
548
  number: 412,
497
- messageTemplate: 'The action resolved from "{action}" in task "{task}" is not a function',
549
+ messageTemplate: 'The action resolved in task "{task}" is not a function',
498
550
  websiteTitle: "Invalid action",
499
551
  websiteDescription: "The action of the task is not a function. Make sure that the file pointed to by the action URL exports a function as the default export.",
500
552
  },
@@ -602,6 +654,30 @@ Please double check your arguments.`,
602
654
  websiteTitle: 'The global option "--config" cannot be used with the "init" command',
603
655
  websiteDescription: `The global option "--config" cannot be used with the "init" command.
604
656
 
657
+ Please double check your arguments.`,
658
+ },
659
+ CANNOT_GROUP_OPTIONS: {
660
+ number: 509,
661
+ messageTemplate: 'Invalid option "{option}". Options cannot be grouped together. Try providing the options separately.',
662
+ websiteTitle: "Options grouping is not supported",
663
+ websiteDescription: `Options cannot be grouped together.
664
+
665
+ Please double check your arguments, and try providing the options separately.`,
666
+ },
667
+ CANNOT_REPEAT_OPTIONS: {
668
+ number: 510,
669
+ messageTemplate: 'Invalid option "{option}". Options of type "{type}" cannot be repeated.',
670
+ websiteTitle: "Options repetition is not supported",
671
+ websiteDescription: `Some options cannot be repeated.
672
+
673
+ Please double check your arguments.`,
674
+ },
675
+ INVALID_SHORT_NAME: {
676
+ number: 511,
677
+ messageTemplate: `Argument short name "{name}" is invalid. It must consist of exactly one letter.`,
678
+ websiteTitle: "Invalid short argument name",
679
+ websiteDescription: `One of your Hardhat or task short argument names is invalid.
680
+
605
681
  Please double check your arguments.`,
606
682
  },
607
683
  },
@@ -773,7 +849,7 @@ Try using another mnemonic or deriving less keys.`,
773
849
  number: 720,
774
850
  messageTemplate: 'The provided network type "{networkType}" for network "{networkName}" is not recognized, only `http` and `edr` are supported.',
775
851
  websiteTitle: "Invalid network type",
776
- websiteDescription: `The network manager only supports the network types 'http' and 'edr'.`,
852
+ websiteDescription: `The network manager only supports the network types 'http' and 'edr-simulated'.`,
777
853
  },
778
854
  DATA_FIELD_CANNOT_BE_NULL_WITH_NULL_ADDRESS: {
779
855
  number: 721,
@@ -787,6 +863,15 @@ Try using another mnemonic or deriving less keys.`,
787
863
  websiteTitle: "Provider closed",
788
864
  websiteDescription: "The provider your are trying to use has been closed. Please create a new one using hre.network.connect() and try again.",
789
865
  },
866
+ INCOMPATIBLE_EIP7702_FIELDS: {
867
+ number: 723,
868
+ messageTemplate: "An incompatible transaction with gasPrice and EIP-7702 fields.",
869
+ websiteTitle: "Incompatible EIP-7702 parameters",
870
+ websiteDescription: `You are trying to send a transaction with a locally managed
871
+ account, and its parameters are incompatible. You sent both gasPrice and authorizationList.
872
+
873
+ Please double check your transactions' parameters.`,
874
+ },
790
875
  },
791
876
  SOLIDITY_TESTS: {
792
877
  BUILD_INFO_NOT_FOUND_FOR_CONTRACT: {
@@ -813,134 +898,38 @@ Remaining test suites: {suites}`,
813
898
  },
814
899
  },
815
900
  SOLIDITY: {
816
- RESOLVING_INCORRECT_FILE_AS_PROJECT_FILE: {
901
+ PROJECT_ROOT_RESOLUTION_ERROR: {
817
902
  number: 900,
818
- shouldBeReported: true,
819
- messageTemplate: `File "{file}" is being resolved as a project file, but it's not part of the project.`,
820
- websiteTitle: "Solidity project file is outside the project",
821
- websiteDescription: `Tried to resolve a file as a project file, but it's not part of the project.`,
822
- },
823
- RESOLVING_NONEXISTENT_PROJECT_FILE: {
824
- number: 901,
825
- shouldBeReported: true,
826
- messageTemplate: `File "{file}" is being resolved as a project file, but it doesn't exist.`,
827
- websiteTitle: "Solidity project file doesn't exist",
828
- websiteDescription: `Tried to resolve a file as a project file, but it doesn't exist.`,
829
- },
830
- IMPORTED_FILE_DOESNT_EXIST: {
831
- number: 902,
832
- messageTemplate: `The import "{importPath} from "{from}" doesn't exist.`,
833
- websiteTitle: "Imported file doesn't exist",
834
- websiteDescription: `An imported file doesn't exist.`,
835
- },
836
- IMPORTED_FILE_WITH_INCORRECT_CASING: {
837
- number: 903,
838
- messageTemplate: 'The import "{importPath} from "{from}" exists, but its casing is incorrect. The correct casing is "{correctCasing}".',
839
- websiteTitle: "Imported file with incorrect casing",
840
- websiteDescription: `Hardhat enforces that you import your files with the correct casing (as stored in the filesystem).
903
+ messageTemplate: `There was an error while resolving the project file "{filePath}":
841
904
 
842
- This error is thrown when you import a file with the wrong casing under a case insensitve filesystem.`,
843
- },
844
- IMPORTED_PACKAGE_EXPORTS_FILE_WITH_INCORRECT_CASING: {
845
- number: 904,
846
- messageTemplate: 'The import "{importPath} from "{from}" exists, but its casing is incorrect.',
847
- websiteTitle: "Imported file with incorrect casing",
848
- websiteDescription: `Hardhat enforces that you import your files with the correct casing (as stored in the filesystem).
905
+ {error}`,
906
+ websiteTitle: "Project file resolution error",
907
+ websiteDescription: `There was an error while resolving the project file.
849
908
 
850
- This error is thrown when you import a file with the wrong casing under a case insensitve filesystem.`,
851
- },
852
- NPM_DEPEDNDENCY_NOT_INSTALLED: {
853
- number: 905,
854
- messageTemplate: 'The npm package "{packageName}" isn\'t installed in the {from}.',
855
- websiteTitle: "Uninstalled npm dependency",
856
- websiteDescription: `Trying to use an npm package as a solidity dependency, but it's not installed.`,
857
- },
858
- IMPORTED_NPM_DEPENDENCY_NOT_INSTALLED: {
859
- number: 906,
860
- messageTemplate: 'The import "{importPath}" from "{from}" is trying to use an uninstalled npm dependency.',
861
- websiteTitle: "Uninstalled npm solidity dependency",
862
- websiteDescription: `One of your files is traying to import a dependency using npm, but it hasn't been installed`,
909
+ Please double-check your configuration. If it keeps happening, please report it.`,
863
910
  },
864
- USER_REMAPPING_WITH_NPM_CONTEXT: {
865
- number: 907,
866
- messageTemplate: 'The remapping "{remapping}" has a context starting with "npm/", which is forbidden. Hardhat doesn\'t allow changing the behaviour of npm package\'s imports.',
867
- websiteTitle: "Remapping imports in npm packages is not allowed",
868
- websiteDescription: `This error happened because you are trying to change how the imports within an npm package, which is not allowed.
911
+ NPM_ROOT_RESOLUTION_ERROR: {
912
+ number: 901,
913
+ messageTemplate: `There was an error while resolving the npm module "{npmModule}" when trying to compile it:
869
914
 
870
- While Hardhat supports user-defined remappings, it doesn't support remapping the behavior of npm packages to ensure that everything what's imported via npm uses the same npm resolution logic.`,
871
- },
872
- REMAPPING_WITH_INVALID_SYNTAX: {
873
- number: 908,
874
- messageTemplate: `The remapping "{remapping}" is invalid.`,
875
- websiteTitle: "Invalid remapping",
876
- websiteDescription: `You are trying to set a user remapping, but it's syntax is invalid.
915
+ {error}`,
916
+ websiteTitle: "Npm file resolution error",
917
+ websiteDescription: `There was an error while resolving an npm module that you are trying to compile and generate artifacts for.
877
918
 
878
- Please double check your remmpaings' syntax.`,
919
+ Please double-check your configuration. If it keeps happening, please report it.`,
879
920
  },
880
- REMAPPING_TO_UNINSTALLED_PACKAGE: {
881
- number: 909,
882
- messageTemplate: `The remapping "{remapping}" is trying to use the npm package "{package}", which is not installed`,
883
- websiteTitle: "Remapping into an uninstaleld npm package",
884
- websiteDescription: `You are trying to set a user remapping that uses an npm pacakge as target, but it's not installed.
921
+ IMPORT_RESOLUTION_ERROR: {
922
+ number: 902,
923
+ messageTemplate: `There was an error while resolving the import "{importPath}" from "{filePath}":
885
924
 
886
- Please make sure to install the package or fix the remapping.`,
887
- },
888
- REMAPPING_NPM_PACKAGE_AS_MONOREPO: {
889
- number: 910,
890
- messageTemplate: `The remapping "{remapping}" targets the npm pacakge "{pacakge}" as if it were part of this repository, but version "{version}" is installed instead`,
891
- websiteTitle: "Remapping into a monorepo package but found an npm package instead",
892
- websiteDescription: `You are trying to set a remapping setting a monorepo package as target, but Hardhat found the pacakge to be installed from the npm regristry instead.`,
893
- },
894
- REMAPPING_HARDHAT_PROJECT_AS_MONOREPO_PACKAGE: {
895
- number: 911,
896
- messageTemplate: `The remapping "{remapping}" is trying to set the npm package "{package}" as target, but that's the project is the Hardhat project, so it shouldn't be remapped through npm/, but as internal project remappings.`,
897
- websiteTitle: `Remapping into the project using npm`,
898
- websiteDescription: `You are trying to set a remapping whose target uses the npm/ syntax, but is within your Hardhat project.
925
+ {error}`,
926
+ websiteTitle: "Import resolution error",
927
+ websiteDescription: `There was an error while resolving an import.
899
928
 
900
- Please don't use npm/... as target, but use normal internal project remapping istead.`,
901
- },
902
- REMAPPING_INCORRECT_VERSION: {
903
- number: 912,
904
- messageTemplate: `The remapping "{remapping}" is trying to set the npm package "{package}" version "{expectedVersion}" as target, but found version "{actualVersion}" instead.`,
905
- websiteTitle: `Remapping into incorrect npm package version`,
906
- websiteDescription: `You are trying to set a remapping into an npm package, but the version that you are using is not the currently installed one.
907
-
908
- Please change your remapping to match the installed version, or installed the correct one.`,
909
- },
910
- INVALID_NPM_IMPORT: {
911
- number: 913,
912
- messageTemplate: `The import "{importPath}" in "{from}" is treated as an npm import as it's first directory doesn't exist in your project, but it's syntax is not that of a valid npm import either.`,
913
- websiteTitle: `Invalid npm import`,
914
- websiteDescription: `You are trying to import a file that is not a valid npm import. Please double check that you are using the correct syntax.`,
915
- },
916
- ILLEGAL_PACKAGE_IMPORT: {
917
- number: 914,
918
- messageTemplate: `The import "{importPath}" in "{from}" is not a legal import as it's trying to import a file outside of its package.`,
919
- websiteTitle: `Illegal package import`,
920
- websiteDescription: `One of your npm packages has a Solidity file that is trying to import a file outside of its package using a relative import. This is disabled for security reasons.`,
921
- },
922
- ILEGALL_PROJECT_IMPORT: {
923
- number: 915,
924
- messageTemplate: `The import "{importPath}" in "{from}" is not a legal import as it's trying to import a file outside of the project.`,
925
- websiteTitle: `Illegal project import`,
926
- websiteDescription: `One of your Solidity files is trying to import a file outside of the Hardhat project using a relative import. This is disabled for security reasons.`,
927
- },
928
- ILLEGAL_PROJECT_IMPORT_AFTER_REMAPPING: {
929
- number: 916,
930
- messageTemplate: `Applying the remapping "{remapping}" to the import "{importPath}" from "{from}" results in an invalid import "{remappedDirectImport}", as it's not a local file. If you are trying to remap into an npm module use the npm/ syntax instead.`,
931
- websiteTitle: `Illegal project import after remapping`,
932
- websiteDescription: `One of your Solidity files has an import which after applying a user remapping becomes an illegal import, as it tries to import a file outside of the project. This is disabled for security reasons.
933
-
934
- If you are trying to remap into an npm module use the npm/ syntax instead.`,
935
- },
936
- IMPORT_PATH_WITH_WINDOWS_SEPARATOR: {
937
- number: 917,
938
- messageTemplate: `The import "{importPath}" in "{from}" is not a valid import as it contains a Windows path separator.`,
939
- websiteTitle: `Import path with Windows path separator`,
940
- websiteDescription: `One of your Solidity files is trying to import a file with a Windows path separator, and this is not supported. Please use a Unix-style path instead.`,
929
+ Please double-check your import`,
941
930
  },
942
931
  INVALID_SOLC_VERSION: {
943
- number: 918,
932
+ number: 903,
944
933
  messageTemplate: `Solidity version {version} is invalid or hasn't been released yet.
945
934
 
946
935
  If you are certain it has been released, run "npx hardhat clean --global" and try again`,
@@ -949,39 +938,8 @@ If you are certain it has been released, run "npx hardhat clean --global" and tr
949
938
 
950
939
  If you are certain it has been released, run \`npx hardhat clean --global\` and try again.`,
951
940
  },
952
- RESOLVE_NPM_FILE_WITH_INVALID_FORMAT: {
953
- number: 919,
954
- messageTemplate: `Couldn't resolve the npm file "{module}" because it has an invalid format.
955
-
956
- Make sure that you are providing valid npm file paths (e.g. package/File.sol) in your config and programatically.`,
957
- websiteTitle: "Resolving invalid npm file",
958
- websiteDescription: `Tried to resolve an npm file directly (i.e. not imported by another file) but its format is invalid.
959
-
960
- This can happen if you setting npm files to be compiled as local files, with invalid file paths, or by misusing the solidity build system.`,
961
- },
962
- RESOLVE_NPM_FILE_CLASHES_WITH_LOCAL_FILES: {
963
- number: 920,
964
- shouldBeReported: true,
965
- messageTemplate: `You are tying to resolve the npm file "{module}", for example to compile it as a local one, but it can clash with your project as the "{directory}" directory is present in your project.
966
-
967
- Please try renaming the directory.`,
968
- websiteTitle: "Resolution of npm file clashes with local files",
969
- websiteDescription: `You are tying to resolve an npm file, for example to compile it as a local one, but it can clash with your project files.`,
970
- },
971
- RESOLVE_NON_EXISTENT_NPM_ROOT: {
972
- number: 921,
973
- messageTemplate: `You are tying to compile the npm file "{module}", but it doesn't exist within its package.`,
974
- websiteTitle: "Resolution of non-existent npm file",
975
- websiteDescription: `You are tying to resolve an npm file that doesn't exist within its package.`,
976
- },
977
- RESOLVE_WRONG_CASING_NPM_ROOT: {
978
- number: 922,
979
- messageTemplate: `You are tying to compile the npm file "{module}", its casing is incorrect. Please double check it in your config.`,
980
- websiteTitle: "Resolution of npm file with incorrect casing",
981
- websiteDescription: `You are tying to resolve an npm file whose casing is incorrect.`,
982
- },
983
941
  DOWNLOAD_FAILED: {
984
- number: 923,
942
+ number: 904,
985
943
  messageTemplate: "Couldn't download compiler version {remoteVersion}. Please check your internet connection and try again.",
986
944
  websiteTitle: "`solc` download failed",
987
945
  websiteDescription: `Couldn't download \`solc\`.
@@ -989,7 +947,7 @@ Please try renaming the directory.`,
989
947
  Please check your internet connection and try again.`,
990
948
  },
991
949
  VERSION_LIST_DOWNLOAD_FAILED: {
992
- number: 924,
950
+ number: 905,
993
951
  messageTemplate: "Couldn't download compiler version list. Please check your internet connection and try again.",
994
952
  websiteTitle: "Couldn't obtain `solc` version list",
995
953
  websiteDescription: `Couldn't download \`solc\`'s version list.
@@ -997,7 +955,7 @@ Please check your internet connection and try again.`,
997
955
  Please check your internet connection and try again.`,
998
956
  },
999
957
  INVALID_DOWNLOAD: {
1000
- number: 925,
958
+ number: 906,
1001
959
  messageTemplate: `Couldn't download compiler version {remoteVersion}: Checksum verification failed.
1002
960
 
1003
961
  Please check your internet connection and try again.
@@ -1011,7 +969,7 @@ Please check your internet connection and try again.
1011
969
  If this error persists, run \`npx hardhat clean --global\`.`,
1012
970
  },
1013
971
  CANT_RUN_NATIVE_COMPILER: {
1014
- number: 926,
972
+ number: 907,
1015
973
  messageTemplate: `A native version of solc failed to run.
1016
974
 
1017
975
  If you are running MacOS, try installing Apple Rosetta.
@@ -1025,7 +983,7 @@ If you are running MacOS, try installing Apple Rosetta.
1025
983
  If this error persists, run "npx hardhat clean --global".`,
1026
984
  },
1027
985
  CANT_RUN_SOLCJS_COMPILER: {
1028
- number: 927,
986
+ number: 908,
1029
987
  messageTemplate: `A wasm version of solc failed to run.
1030
988
 
1031
989
  If this error persists, run "npx hardhat clean --global".`,
@@ -1037,7 +995,7 @@ If you are running MacOS, try installing Apple Rosetta.
1037
995
  If this error persists, run "npx hardhat clean --global".`,
1038
996
  },
1039
997
  COMPILATION_JOB_CREATION_ERROR: {
1040
- number: 928,
998
+ number: 909,
1041
999
  messageTemplate: `Failed to create compilation job for file "{rootFilePath}" using the build profile "{buildProfile}".
1042
1000
 
1043
1001
  {reason}`,
@@ -1047,7 +1005,7 @@ If this error persists, run "npx hardhat clean --global".`,
1047
1005
  This happens when your files require incompatible versions of solc or you haven't configured a version that works with them`,
1048
1006
  },
1049
1007
  BUILD_FAILED: {
1050
- number: 929,
1008
+ number: 910,
1051
1009
  messageTemplate: "Compilation failed",
1052
1010
  websiteTitle: "Compilation failed",
1053
1011
  websiteDescription: `Your smart contracts failed to compile.
@@ -1055,19 +1013,13 @@ This happens when your files require incompatible versions of solc or you haven'
1055
1013
  Please check Hardhat's output for more details.`,
1056
1014
  },
1057
1015
  INVALID_SOLCJS_COMPILER: {
1058
- number: 930,
1016
+ number: 911,
1059
1017
  messageTemplate: `A wasm version of solc {version} is invalid. The compile function is not available.`,
1060
1018
  websiteTitle: "Invalid solcjs compiler",
1061
- websiteDescription: `Hardhat successfully downloaded a WASM version of solc {version} but it is invalid. The compile function is missing.`,
1062
- },
1063
- RESOLVE_NOT_EXPORTED_NPM_FILE: {
1064
- number: 931,
1065
- messageTemplate: `You are tying to resolve the npm file "{module}", but it's not exported by its package`,
1066
- websiteTitle: "Resolution of not-exported npm file",
1067
- websiteDescription: `You are tying to resolve an npm file that is not exported by its package.`,
1019
+ websiteDescription: `Hardhat successfully downloaded a WASM version of solc but it is invalid. The compile function is missing.`,
1068
1020
  },
1069
1021
  BUILD_PROFILE_NOT_FOUND: {
1070
- number: 932,
1022
+ number: 912,
1071
1023
  messageTemplate: `The build profile "{buildProfileName}" is not defined in your Hardhat config`,
1072
1024
  websiteTitle: "Build profile not defined",
1073
1025
  websiteDescription: `The build profile you are trying to use is not defined in your Hardhat config.`,
@@ -1099,9 +1051,9 @@ Please use the fully qualified name of the contract to disambiguate it.`,
1099
1051
  NODE: {
1100
1052
  INVALID_NETWORK_TYPE: {
1101
1053
  number: 1100,
1102
- messageTemplate: `The provided node network type "{networkType}" for network "{networkName}" is not recognized, only 'edr' is supported.`,
1054
+ messageTemplate: `The provided node network type "{networkType}" for network "{networkName}" is not recognized, only 'edr-simulated' is supported.`,
1103
1055
  websiteTitle: "Invalid node network type",
1104
- websiteDescription: `The node only supports the 'edr' network type.`,
1056
+ websiteDescription: `The node only supports the 'edr-simulated' network type.`,
1105
1057
  },
1106
1058
  },
1107
1059
  TEST_PLUGIN: {
@@ -1112,6 +1064,20 @@ Please use the fully qualified name of the contract to disambiguate it.`,
1112
1064
  websiteDescription: `Cannot determine a test runner for the test files. This may be because the files are not correctly included in the test paths defined by the test plugins in the Hardhat configuration. If they are correctly included, this likely indicates an issue with a plugin failing to detect the files.`,
1113
1065
  },
1114
1066
  },
1067
+ COVERAGE: {
1068
+ SOURCE_NOT_INSTRUMENTED: {
1069
+ number: 1300,
1070
+ messageTemplate: `The source file "{sourceName}" could not be instrumented for coverage.`,
1071
+ websiteTitle: "Source file not instrumented for coverage",
1072
+ websiteDescription: `The source file could not be instrumented for coverage.`,
1073
+ },
1074
+ IMPORT_PATH_ALREADY_DEFINED: {
1075
+ number: 1301,
1076
+ messageTemplate: `The import path "{importPath}" is already defined in the compilation sources`,
1077
+ websiteTitle: "Import path already defined in compilation sources",
1078
+ websiteDescription: `The import path is already defined in the compilation sources`,
1079
+ },
1080
+ },
1115
1081
  },
1116
1082
  IGNITION: {
1117
1083
  GENERAL: {
@@ -1127,6 +1093,12 @@ Please use the fully qualified name of the contract to disambiguate it.`,
1127
1093
  websiteTitle: "Unsupported ethers.js value",
1128
1094
  websiteDescription: "Unsupported ethers.js value",
1129
1095
  },
1096
+ ARTIFACT_MIGRATION_NEEDED: {
1097
+ number: 10002,
1098
+ messageTemplate: "Hardhat Ignition needs to migrate this deployments artifacts to the new format. Please run `npx hardhat ignition migrate {deploymentId}`",
1099
+ websiteTitle: "Artifact migration needed",
1100
+ websiteDescription: "Hardhat Ignition needs to migrate the artifacts to the new format. Please run `npx hardhat ignition migrate {deploymentId}`",
1101
+ },
1130
1102
  },
1131
1103
  INTERNAL: {
1132
1104
  INTERNAL_ERROR: {
@@ -1384,11 +1356,11 @@ Please review the error message and try again.`,
1384
1356
  },
1385
1357
  TRANSACTION_LOST: {
1386
1358
  number: 10410,
1387
- messageTemplate: `An error occured while trying to send a transaction for future {futureId}.
1359
+ messageTemplate: `An error occurred while trying to send a transaction for future {futureId}.
1388
1360
  Please use a block explorer to find the hash of the transaction with nonce {nonce} sent from account {sender} and use the following command to add it to your deployment:
1389
1361
  npx hardhat ignition track-tx <txHash> <deploymentId> --network <networkName>`,
1390
1362
  websiteTitle: "Transaction lost",
1391
- websiteDescription: `An error occured while trying to send a transaction`,
1363
+ websiteDescription: `An error occurred while trying to send a transaction`,
1392
1364
  },
1393
1365
  },
1394
1366
  RECONCILIATION: {
@@ -1530,7 +1502,7 @@ npx hardhat ignition track-tx <txHash> <deploymentId> --network <networkName>`,
1530
1502
  number: 10717,
1531
1503
  messageTemplate: "Invalid libraries for contract {contractName}: The names '{inputName}' and '{libName}' clash with each other, please use qualified names for both.",
1532
1504
  websiteTitle: "Conflicting library names",
1533
- websiteDescription: `The libray names clash with each other`,
1505
+ websiteDescription: `The library names clash with each other`,
1534
1506
  },
1535
1507
  INVALID_LIBRARY_NAME: {
1536
1508
  number: 10718,
@@ -1602,6 +1574,12 @@ npx hardhat ignition track-tx <txHash> <deploymentId> --network <networkName>`,
1602
1574
  websiteTitle: "Chain ID changed",
1603
1575
  websiteDescription: `The deployment's chain cannot be changed between runs.`,
1604
1576
  },
1577
+ ALREADY_IN_PROGRESS: {
1578
+ number: 10901,
1579
+ messageTemplate: "Another instance of `IgnitionHelper.deploy()` is already in use. Please wait for the previous deployment to finish.",
1580
+ websiteTitle: "Deployment already in progress",
1581
+ websiteDescription: "Another instance of `IgnitionHelper.deploy()` is already in use. Please wait for the previous deployment to finish.",
1582
+ },
1605
1583
  },
1606
1584
  VERIFY: {
1607
1585
  UNINITIALIZED_DEPLOYMENT: {
@@ -1791,6 +1769,24 @@ Please try again later.`,
1791
1769
  websiteTitle: "Unsupported type for deep copy",
1792
1770
  websiteDescription: "Unsupported type for deep copy",
1793
1771
  },
1772
+ ACCOUNTS_OF_TYPE_REMOTE: {
1773
+ number: 20014,
1774
+ messageTemplate: "Tried to obtain a private key, but the network is configured to use remote accounts.",
1775
+ websiteTitle: "Remote accounts are not supported",
1776
+ websiteDescription: "Remote accounts are not supported",
1777
+ },
1778
+ WRONG_ACCOUNTS_FORMAT: {
1779
+ number: 20015,
1780
+ messageTemplate: `The "accounts" property in your Hardhat configuration file is not set correctly.`,
1781
+ websiteTitle: `Invalid "accounts" property in your Hardhat configuration file`,
1782
+ websiteDescription: `The "accounts" property in your Hardhat configuration file is not set correctly. Please double check it and try again.`,
1783
+ },
1784
+ NO_PRIVATE_KEY_FOR_ADDRESS: {
1785
+ number: 20016,
1786
+ messageTemplate: `No private key can be associated with the address "{address}".`,
1787
+ websiteTitle: "Private key for the address could not be found",
1788
+ websiteDescription: "The private key for the address could not be found. Please double check your private keys and try again.",
1789
+ },
1794
1790
  },
1795
1791
  },
1796
1792
  HARDHAT_MOCHA: {
@@ -1811,11 +1807,13 @@ Please try again later.`,
1811
1807
  websiteTitle: "Network not found",
1812
1808
  websiteDescription: `No network with the specified chain id was found. You can override the chain by passing it as a parameter to the client getter:
1813
1809
 
1810
+ \`\`\`ts
1814
1811
  import { someChain } from "viem/chains";
1815
1812
  const client = await hre.viem.getPublicClient({
1816
1813
  chain: someChain,
1817
1814
  ...
1818
1815
  });
1816
+ \`\`\`
1819
1817
 
1820
1818
  You can find a list of supported networks here: https://github.com/wevm/viem/blob/main/src/chains/index.ts`,
1821
1819
  },
@@ -1835,12 +1833,15 @@ Please ensure you're using one of the supported networks.`,
1835
1833
 
1836
1834
  To resolve this, make sure to add an account to the specified network in the Hardhat config. Alternatively, you can set a custom wallet client by passing it as a parameter in the relevant function:
1837
1835
 
1836
+ \`\`\`ts
1838
1837
  const networkConnection = await hre.network.connect(...);
1839
1838
  const walletClient = await networkConnection.viem.getWalletClient(address);
1840
1839
 
1841
1840
  await networkConnection.viem.deployContract(contractName, constructorArgs, { walletClient });
1842
1841
  await networkConnection.viem.sendDeploymentTransaction(contractName, constructorArgs, { walletClient });
1843
- await networkConnection.viem.getContractAt(contractName, address, { walletClient });`,
1842
+ await networkConnection.viem.getContractAt(contractName, address, { walletClient });
1843
+ \`\`\`
1844
+ `,
1844
1845
  },
1845
1846
  LINKING_CONTRACT_ERROR: {
1846
1847
  number: 40003,
@@ -1874,6 +1875,20 @@ Please check Hardhat's output for more details.`,
1874
1875
  websiteTitle: "Invalid password or corrupted keystore file",
1875
1876
  websiteDescription: "The password you provided is incorrect or the keystore file is corrupted.",
1876
1877
  },
1878
+ CANNOT_CHANGED_PASSWORD_FOR_DEV_KEYSTORE: {
1879
+ number: 50001,
1880
+ messageTemplate: `The keystore "change-password" task cannot be used with the development keystore`,
1881
+ websiteTitle: "Cannot change password for dev keystore",
1882
+ websiteDescription: `The keystore "change-password" task cannot be used with the development keystore`,
1883
+ },
1884
+ KEY_NOT_FOUND_DURING_TESTS_WITH_DEV_KEYSTORE: {
1885
+ number: 50002,
1886
+ messageTemplate: `Key "{key}" not found in the development keystore. Run "npx hardhat keystore set {key} --dev" to set it.`,
1887
+ websiteTitle: "Key not found in the development keystore during tests",
1888
+ websiteDescription: `Key not found in the development keystore. During tests, configuration variables can only be accessed through the development keystore.
1889
+
1890
+ Run \`npx hardhat keystore set <KEY> --dev\` to set it.`,
1891
+ },
1877
1892
  },
1878
1893
  },
1879
1894
  NETWORK_HELPERS: {
@@ -2052,8 +2067,8 @@ This might be caused by using hardhat_reset and loadFixture calls in a testcase.
2052
2067
  REVERT_INVALID_ARGUMENTS_LENGTH: {
2053
2068
  number: 70010,
2054
2069
  messageTemplate: "The .revertedWithCustomError matcher expects two arguments: the contract and the custom error name. Arguments should be asserted with the .withArgs helper.",
2055
- websiteTitle: "Invalid arguments length for the .revertedWithCustomError matcher",
2056
- websiteDescription: "Invalid arguments length for the .revertedWithCustomError matcher",
2070
+ websiteTitle: "Invalid arguments length for the .revertedWithCustomError matcher",
2071
+ websiteDescription: "Invalid arguments length for the .revertedWithCustomError matcher",
2057
2072
  },
2058
2073
  WITH_ARGS_FORBIDDEN: {
2059
2074
  number: 70011,
@@ -2133,6 +2148,387 @@ This might be caused by using hardhat_reset and loadFixture calls in a testcase.
2133
2148
  websiteTitle: "withArgs called with both .emit and .revertedWithCustomError, but these assertions cannot be combined",
2134
2149
  websiteDescription: "withArgs called with both .emit and .revertedWithCustomError, but these assertions cannot be combined",
2135
2150
  },
2151
+ DEPRECATED_REVERTED_MATCHER: {
2152
+ number: 70024,
2153
+ messageTemplate: "The .reverted matcher has been deprecated. Use .revert(ethers) instead.",
2154
+ websiteTitle: "Deprecated `reverted` matcher",
2155
+ websiteDescription: "The `.reverted` matcher was deprecated and you should use `.revert(ethers)` instead.",
2156
+ },
2157
+ },
2158
+ },
2159
+ HARDHAT_VERIFY: {
2160
+ GENERAL: {
2161
+ NETWORK_NOT_SUPPORTED: {
2162
+ number: 80000,
2163
+ messageTemplate: `The network "{networkName}" with chain id "{chainId}" is not supported.`,
2164
+ websiteTitle: "Network not supported",
2165
+ websiteDescription: `The network is not supported by hardhat-verify. To see the list of supported networks, run:
2166
+
2167
+ \`\`\`sh
2168
+ npx hardhat verify --list-networks
2169
+ \`\`\`
2170
+
2171
+ To add support for a new network, see https://hardhat.org/verify-custom-networks`,
2172
+ },
2173
+ EXPLORER_REQUEST_FAILED: {
2174
+ number: 80001,
2175
+ messageTemplate: `The request to {url} failed with the message "{errorMessage}". This error comes from {name}, not Hardhat.`,
2176
+ websiteTitle: "Explorer request failed",
2177
+ websiteDescription: `The request to the explorer failed.
2178
+
2179
+ - Verify that the URL is correct.
2180
+ - Ensure the service is up and reachable.
2181
+ - Check your network connection and try again.`,
2182
+ },
2183
+ EXPLORER_REQUEST_STATUS_CODE_ERROR: {
2184
+ number: 80002,
2185
+ messageTemplate: `The request to {url} returned a non-success status code {statusCode}: "{errorMessage}". (This response comes from {name}, not Hardhat.)`,
2186
+ websiteTitle: "Explorer request status code error",
2187
+ websiteDescription: `The request to the explorer returned a non-success status code.
2188
+
2189
+ - Verify that the URL is correct.
2190
+ - Ensure the service is up and reachable.
2191
+ - Check your network connection and try again.`,
2192
+ },
2193
+ SOLC_VERSION_NOT_SUPPORTED: {
2194
+ number: 80003,
2195
+ messageTemplate: `The following Solidity compiler versions are not supported by the Etherscan API: {unsupportedSolcVersions}.`,
2196
+ websiteTitle: "Unsupported solidity compiler version",
2197
+ websiteDescription: `The specified Solidity compiler version is not supported by the Etherscan API. Only versions 0.4.11 and above are supported.
2198
+ For a full list of supported versions, visit: https://etherscan.io/solcversions`,
2199
+ },
2200
+ DEPLOYED_BYTECODE_NOT_FOUND: {
2201
+ number: 80004,
2202
+ messageTemplate: `No bytecode found at address "{address}". Is the contract deployed on the "{networkName}" network?`,
2203
+ websiteTitle: "Deployed bytecode not found",
2204
+ websiteDescription: `No bytecode was found at the specified address. This usually means the contract is not deployed or was deployed to a different network.
2205
+ Please verify the address and selected network, and try again.`,
2206
+ },
2207
+ SOLC_VERSION_MISMATCH: {
2208
+ number: 80005,
2209
+ messageTemplate: `The contract deployed to the "{networkName}" network was compiled with Solidity {deployedSolcVersion}, but the configured compiler {configuredSolcVersionSummary}.`,
2210
+ websiteTitle: "Compiler version mismatch",
2211
+ websiteDescription: `The Solidity compiler version used to compile the deployed contract does not match any of the versions configured in your Hardhat project.
2212
+
2213
+ This mismatch may indicate:
2214
+
2215
+ - You're not on the same commit that was used to deploy the contract.
2216
+ - The compiler version in your Hardhat config is incorrect.
2217
+ - The address provided is not the deployed contract.
2218
+ - The selected network is incorrect.`,
2219
+ },
2220
+ CONTRACT_NOT_FOUND: {
2221
+ number: 80006,
2222
+ messageTemplate: `The contract "{contract}" is not present in your project's artifacts.`,
2223
+ websiteTitle: "Contract not found",
2224
+ websiteDescription: `The specified contract is not present in your project's artifacts. Please ensure the contract is compiled and the name is correct.`,
2225
+ },
2226
+ BUILD_INFO_NOT_FOUND: {
2227
+ number: 80007,
2228
+ messageTemplate: `The contract "{contract}" is present in your project, but its build info is missing.`,
2229
+ websiteTitle: "Build info not found",
2230
+ websiteDescription: `The specified contract is present in your project, but its build info is missing. Please ensure the contract is compiled by Hardhat and that it is written in Solidity.`,
2231
+ },
2232
+ BUILD_INFO_SOLC_VERSION_MISMATCH: {
2233
+ number: 80008,
2234
+ messageTemplate: `The contract "{contract}" build info specifies Solidity {buildInfoSolcVersion}, but the deployed bytecode on the "{networkName}" network indicates {versionDetails}.`,
2235
+ websiteTitle: "Build info compiler version mismatch",
2236
+ websiteDescription: `The compiler version in the build info does not match the version encoded in the deployed bytecode.
2237
+ Possible causes:
2238
+
2239
+ - Compiler settings were changed after deployment.
2240
+ - The contract address is incorrect.
2241
+ - The selected network is incorrect.`,
2242
+ },
2243
+ DEPLOYED_BYTECODE_MISMATCH: {
2244
+ number: 80009,
2245
+ messageTemplate: `The address contains a contract whose bytecode does not match {contractDescription}.`,
2246
+ websiteTitle: "Deployed bytecode mismatch",
2247
+ websiteDescription: `The bytecode at the specified address did not match the expected contract.
2248
+
2249
+ Possible causes:
2250
+
2251
+ - Your artifacts are outdated or missing; try running \`npx hardhat compile --force --buildProfile production\`.
2252
+ - The contract code was modified after deployment.
2253
+ - Compiler settings (optimizer, EVM version, etc.) changed after deployment.
2254
+ - The provided address is incorrect.
2255
+ - The selected network is incorrect.`,
2256
+ },
2257
+ DEPLOYED_BYTECODE_MULTIPLE_MATCHES: {
2258
+ number: 80010,
2259
+ messageTemplate: `More than one contract matches the deployed bytecode:
2260
+ {fqnList}
2261
+
2262
+ Specify the exact contract using the \`--contract\` flag.`,
2263
+ websiteTitle: "Multiple contract matches",
2264
+ websiteDescription: `The deployed bytecode matches multiple compiled contracts. Specify the exact contract using the \`--contract\` flag. For example:
2265
+
2266
+ \`\`\`sh
2267
+ npx hardhat verify --contract contracts/Example.sol:ExampleContract <other args>
2268
+ \`\`\`
2269
+ `,
2270
+ },
2271
+ INVALID_LIBRARY_ADDRESS: {
2272
+ number: 80011,
2273
+ messageTemplate: `The library "{library}" provided for the contract "{contract}" has an invalid address: "{address}".`,
2274
+ websiteTitle: "Invalid library address",
2275
+ websiteDescription: `The address provided for a linked library is invalid. Please make sure the address is a valid Ethereum address.`,
2276
+ },
2277
+ UNUSED_LIBRARY: {
2278
+ number: 80012,
2279
+ messageTemplate: `The library "{library}" provided for the contract "{contract}" is not used by the contract.
2280
+
2281
+ {suggestion}`,
2282
+ websiteTitle: "Library not found in contract",
2283
+ websiteDescription: `A library was specified using the "--libraries" option, but the selected contract does not use it.
2284
+
2285
+ If the contract uses external libraries, verify that the provided name matches the fully qualified name (FQN) of one of them, such as:
2286
+
2287
+ \`\`\`
2288
+ contracts/Math.sol:SafeMath
2289
+ \`\`\`
2290
+ `,
2291
+ },
2292
+ LIBRARY_MULTIPLE_MATCHES: {
2293
+ number: 80013,
2294
+ messageTemplate: `The library "{library}" provided for the contract "{contract}" is ambiguous.
2295
+ It matches multiple libraries:
2296
+ {fqnList}
2297
+
2298
+ To fix this, specify one of these fully qualified library names and try again.`,
2299
+ websiteTitle: "Library name is ambiguous",
2300
+ websiteDescription: `The specified library name matches multiple libraries used by the contract.
2301
+
2302
+ To resolve the ambiguity, provide the fully qualified library name in the format:
2303
+
2304
+ \`\`\`
2305
+ path/to/LibraryFile.sol:LibraryName
2306
+ \`\`\`
2307
+ `,
2308
+ },
2309
+ DUPLICATED_LIBRARY: {
2310
+ number: 80014,
2311
+ messageTemplate: `The library name "{library}" and its fully qualified name "{libraryFqn}" refer to the same library.
2312
+
2313
+ To fix this, remove one of them and try again.`,
2314
+ websiteTitle: "Duplicated library entry",
2315
+ websiteDescription: `The same library was specified more than once using both its short name and fully qualified name (FQN) in the \`--libraries\` option.
2316
+
2317
+ Only one form should be used for each library. Remove one of the entries and try again.`,
2318
+ },
2319
+ LIBRARY_ADDRESSES_MISMATCH: {
2320
+ number: 80015,
2321
+ messageTemplate: `The following detected library addresses differ from those you provided:
2322
+ {conflictList}
2323
+
2324
+ You can either fix these addresses in your libraries, or remove them to let the plugin autodetect them.`,
2325
+ websiteTitle: "Library address mismatch",
2326
+ websiteDescription: `Some libraries have conflicting addresses between what you provided and what was detected in the deployed bytecode.
2327
+
2328
+ Please ensure each library address is correct. You can remove entries from your input to use autodetection instead.`,
2329
+ },
2330
+ MISSING_LIBRARY_ADDRESSES: {
2331
+ number: 80016,
2332
+ messageTemplate: `The contract "{contract}" has one or more library addresses that cannot be detected from the deployed bytecode.
2333
+ This can occur if a library is only used in the contract's constructor. The missing libraries are:
2334
+ {missingList}`,
2335
+ websiteTitle: "Missing library addresses",
2336
+ websiteDescription: `One or more libraries required by the contract could not be detected from the deployed bytecode.
2337
+
2338
+ This usually happens when a library is only referenced in the contract's constructor. To resolve this, provide the missing library addresses using the "--libraries" option.`,
2339
+ },
2340
+ INVALID_CONSTRUCTOR_ARGUMENT_TYPE: {
2341
+ number: 80017,
2342
+ messageTemplate: `The value "{value}" for a constructor parameter cannot be encoded.
2343
+ Reason: {reason}.`,
2344
+ websiteTitle: "Invalid constructor argument type",
2345
+ websiteDescription: `One of the arguments passed to the contract's constructor has an invalid JavaScript type.
2346
+
2347
+ This error occurs when you supply a value whose runtime type doesn't match the expected Solidity type. For example, you must pass a JS string for a Solidity string parameter.
2348
+
2349
+ Please verify that each constructor argument is the correct JS type.`,
2350
+ },
2351
+ INVALID_CONSTRUCTOR_ARGUMENTS_LENGTH: {
2352
+ number: 80018,
2353
+ messageTemplate: `The constructor for "{contract}" has {requiredArgs} parameters but {providedArgs} arguments were provided instead.`,
2354
+ websiteTitle: "Invalid constructor argument count",
2355
+ websiteDescription: `The number of arguments provided to the contract's constructor doesn't match the number of parameters defined in its ABI.
2356
+
2357
+ This error occurs when you supply a different number of arguments than the constructor expects. For example, if the constructor expects two parameters but you provided three.
2358
+
2359
+ Please verify that you pass the exact number of arguments required by the constructor.`,
2360
+ },
2361
+ CONSTRUCTOR_ARGUMENT_OVERFLOW: {
2362
+ number: 80019,
2363
+ messageTemplate: `The value "{value}" is out of bounds for its Solidity type and cannot be encoded.`,
2364
+ websiteTitle: "Constructor argument value out of bounds",
2365
+ websiteDescription: `One of the arguments passed to the contract's constructor is outside the allowed range for its Solidity type (for example, passing 256 to a uint8 parameter).
2366
+
2367
+ This error occurs when a value exceeds the maximum or minimum allowed for the specified Solidity type.
2368
+
2369
+ Please ensure all argument values fit within the valid range for their respective Solidity types.`,
2370
+ },
2371
+ CONSTRUCTOR_ARGUMENTS_ENCODING_FAILED: {
2372
+ number: 80020,
2373
+ messageTemplate: `The constructor arguments for "{contract}" could not be encoded. Reason: {reason}.`,
2374
+ websiteTitle: "Constructor arguments encoding failed",
2375
+ websiteDescription: `The constructor arguments provided for the contract could not be encoded correctly.
2376
+ Please review the provided arguments and ensure they match the expected arguments defined in the contract's ABI.`,
2377
+ },
2378
+ CONTRACT_VERIFICATION_MISSING_BYTECODE: {
2379
+ number: 80021,
2380
+ messageTemplate: `The request to {url} failed because the address "{address}" does not have bytecode.`,
2381
+ websiteTitle: "Missing bytecode at address",
2382
+ websiteDescription: `The explorer responded that the specified address does not contain bytecode. This usually means the contract was deployed recently and the explorer's backend has not yet indexed it.
2383
+
2384
+ Please wait a short time (e.g., 30-60 seconds) and try again. If you're running this from a script, wait for at least five confirmations before verifying.`,
2385
+ },
2386
+ CONTRACT_ALREADY_VERIFIED: {
2387
+ number: 80022,
2388
+ messageTemplate: `The contract "{contract}" at address "{address}" is already verified.`,
2389
+ websiteTitle: "Contract already verified",
2390
+ websiteDescription: `The block explorer responded that the contract is already verified.
2391
+
2392
+ This typically occurs if you used the "--force" flag and the explorer does not support re-verification, or if the contract was previously verified with a full match.`,
2393
+ },
2394
+ CONTRACT_VERIFICATION_REQUEST_FAILED: {
2395
+ number: 80023,
2396
+ messageTemplate: `The contract verification request failed: "{message}".`,
2397
+ websiteTitle: "Contract verification request failed",
2398
+ websiteDescription: `The block explorer returned an error when attempting to verify the contract's source code.
2399
+
2400
+ Please check the returned message for details.`,
2401
+ },
2402
+ CONTRACT_VERIFICATION_STATUS_POLLING_FAILED: {
2403
+ number: 80024,
2404
+ messageTemplate: `The contract verification status polling encountered an error: "{message}". Verification may still succeed.`,
2405
+ websiteTitle: "Contract verification status polling failed",
2406
+ websiteDescription: "The block explorer returned a failure status when checking the verification status. Verification may still succeed; please check manually.",
2407
+ },
2408
+ CONTRACT_VERIFICATION_UNEXPECTED_RESPONSE: {
2409
+ number: 80025,
2410
+ messageTemplate: `The block explorer API returned an unexpected message: "{message}". Please report this issue to the Hardhat team.`,
2411
+ shouldBeReported: true,
2412
+ websiteTitle: "Unexpected API response during contract verification",
2413
+ websiteDescription: `The block explorer API returned a message that doesn't match the expected format. This may indicate a change in the API or an issue with the request.
2414
+
2415
+ Please report this issue to the Hardhat team.`,
2416
+ },
2417
+ CONTRACT_VERIFICATION_FAILED: {
2418
+ number: 80026,
2419
+ messageTemplate: `The contract verification failed.
2420
+ Reason: "{reason}".
2421
+ {librariesWarning}`,
2422
+ websiteTitle: "Contract verification failed",
2423
+ websiteDescription: `Unable to verify the contract on the block explorer.
2424
+
2425
+ If your contract uses libraries whose addresses cannot be detected automatically, make sure you are providing the correct address for each undetectable library.`,
2426
+ },
2427
+ BLOCK_EXPLORER_NOT_CONFIGURED: {
2428
+ number: 80027,
2429
+ messageTemplate: "No {verificationProvider} block explorer is configured for the {chainId} chain in the chain descriptors.",
2430
+ websiteTitle: "Block explorer not configured",
2431
+ websiteDescription: `
2432
+ Block explorer information is missing in your chain descriptor configuration.
2433
+
2434
+ To enable contract verification, add an entry for the verification provider in the blockExplorers field of the relevant chain descriptor.
2435
+ You can override the default chain descriptor by providing your own chainDescriptors object in the Hardhat config, with the following structure:
2436
+
2437
+ \`\`\`
2438
+ chainDescriptors: {
2439
+ <chainId>: {
2440
+ name: <name>,
2441
+ blockExplorers: {
2442
+ blockscout: { name: "Blockscout", url: <blockscout-url> apiUrl: <blockscout-api-url> };
2443
+ etherscan: { name: "Etherscan", url: <etherscan-url> apiUrl: <etherscan-api-url> };
2444
+ }
2445
+ }
2446
+ }
2447
+ \`\`\`
2448
+ `,
2449
+ },
2450
+ ADDRESS_NOT_A_CONTRACT: {
2451
+ number: 80028,
2452
+ messageTemplate: `{verificationProvider} responded that the address "{address}" does not contain a contract. This usually means the address is incorrect, the contract was not deployed on the selected network, or there is a temporary issue with the block explorer not updating its index.`,
2453
+ websiteTitle: "Address is not a contract",
2454
+ websiteDescription: `The block explorer responded that the address does not contain a contract. This usually means the address is incorrect, the contract was not deployed on the selected network, or there is a temporary issue with the block explorer not updating its index.
2455
+ Please verify the address and network, and try again later if necessary.`,
2456
+ },
2457
+ EXPLORER_API_KEY_EMPTY: {
2458
+ number: 80029,
2459
+ messageTemplate: `The {verificationProvider} API key is empty.`,
2460
+ websiteTitle: "Block explorer API key is empty",
2461
+ websiteDescription: `The provided API key for the block explorer is empty. This can happen in the following cases:
2462
+
2463
+ - No "apiKey" field is configured in the hardhat config.
2464
+ - The "apiKey" is explicitly set to an empty string in the Hardhat config.
2465
+ - The "apiKey" is assigned to a config variable that resolves to an empty string at runtime.
2466
+
2467
+ To resolve this, set a valid non-empty API key in your Hardhat config, then try again.`,
2468
+ },
2469
+ },
2470
+ VALIDATION: {
2471
+ INVALID_ADDRESS: {
2472
+ number: 80100,
2473
+ messageTemplate: `"{value}" is not a valid address`,
2474
+ websiteTitle: "Invalid address",
2475
+ websiteDescription: "The value is not a valid address",
2476
+ },
2477
+ MUTUALLY_EXCLUSIVE_CONSTRUCTOR_ARGS: {
2478
+ number: 80101,
2479
+ messageTemplate: "The parameters constructorArgs and constructorArgsPath are mutually exclusive.",
2480
+ websiteTitle: "Mutually exclusive constructor arguments",
2481
+ websiteDescription: "The parameters constructorArgs and constructorArgsPath are mutually exclusive. Please provide only one of them.",
2482
+ },
2483
+ INVALID_CONSTRUCTOR_ARGS_MODULE_EXPORT: {
2484
+ number: 80102,
2485
+ messageTemplate: `The module specified by "{constructorArgsPath}" must default export an array of constructor arguments.`,
2486
+ websiteTitle: "Invalid constructor arguments module",
2487
+ websiteDescription: `The module specified by the constructorArgsPath parameter must default export an array of constructor arguments.
2488
+
2489
+ Example:
2490
+
2491
+ \`\`\`ts
2492
+ export default ["arg1", "arg2", ...];
2493
+ \`\`\`
2494
+ `,
2495
+ },
2496
+ MODULE_NOT_FOUND: {
2497
+ number: 80103,
2498
+ messageTemplate: `The module specified by "{modulePath}" could not be found.`,
2499
+ websiteTitle: "Module not found",
2500
+ websiteDescription: "The specified module could not be found. Please check the path and try again.",
2501
+ },
2502
+ MODULE_SYNTAX_ERROR: {
2503
+ number: 80104,
2504
+ messageTemplate: `The module specified by "{modulePath}" has a syntax error: {errorMessage}`,
2505
+ websiteTitle: "Module syntax error",
2506
+ websiteDescription: "The specified module has a syntax error. Please fix the error and try again.",
2507
+ },
2508
+ IMPORT_MODULE_FAILED: {
2509
+ number: 80105,
2510
+ messageTemplate: `The module specified by "{modulePath}" could not be imported: {errorMessage}`,
2511
+ websiteTitle: "Import module failed",
2512
+ websiteDescription: "The specified module could not be imported.",
2513
+ },
2514
+ INVALID_LIBRARIES_MODULE_EXPORT: {
2515
+ number: 80106,
2516
+ messageTemplate: `The module specified by "{librariesPath}" must default export a record of libraries.`,
2517
+ websiteTitle: "Invalid libraries module",
2518
+ websiteDescription: `The module specified by the librariesPath parameter must default export a record of libraries.
2519
+
2520
+ Example:
2521
+
2522
+ \`\`\`ts
2523
+ export default { lib1: "0x...", lib2: "0x...", ... };
2524
+ \`\`\``,
2525
+ },
2526
+ INVALID_VERIFICATION_PROVIDER: {
2527
+ number: 80107,
2528
+ messageTemplate: `The verification provider "{verificationProvider}" is not supported. Supported providers are: {supportedVerificationProviders}.`,
2529
+ websiteTitle: "Invalid verification provider",
2530
+ websiteDescription: "The specified verification provider is not supported. Please use one of the supported providers.",
2531
+ },
2136
2532
  },
2137
2533
  },
2138
2534
  };