@nomicfoundation/hardhat-errors 3.0.0-next.9 → 3.0.0
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.
- package/CHANGELOG.md +3 -11
- package/README.md +3 -1
- package/dist/src/descriptors.d.ts +378 -162
- package/dist/src/descriptors.d.ts.map +1 -1
- package/dist/src/descriptors.js +569 -179
- package/dist/src/descriptors.js.map +1 -1
- package/package.json +5 -5
- package/src/descriptors.ts +586 -187
package/src/descriptors.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface ErrorDescriptor {
|
|
|
8
8
|
number: number;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* A
|
|
11
|
+
* A template of the message of the error.
|
|
12
12
|
*
|
|
13
13
|
* This should be a short description. If possible, it should tell the user
|
|
14
14
|
* how to solve their problem.
|
|
@@ -54,7 +54,7 @@ export const ERROR_CATEGORIES: {
|
|
|
54
54
|
min: 1,
|
|
55
55
|
max: 9999,
|
|
56
56
|
pluginId: undefined,
|
|
57
|
-
websiteTitle: "Hardhat
|
|
57
|
+
websiteTitle: "Hardhat 3",
|
|
58
58
|
CATEGORIES: {
|
|
59
59
|
GENERAL: {
|
|
60
60
|
min: 1,
|
|
@@ -121,6 +121,11 @@ export const ERROR_CATEGORIES: {
|
|
|
121
121
|
max: 1299,
|
|
122
122
|
websiteSubTitle: "Hardhat test plugin errors",
|
|
123
123
|
},
|
|
124
|
+
COVERAGE: {
|
|
125
|
+
min: 1300,
|
|
126
|
+
max: 1399,
|
|
127
|
+
websiteSubTitle: "Hardhat coverage errors",
|
|
128
|
+
},
|
|
124
129
|
},
|
|
125
130
|
},
|
|
126
131
|
IGNITION: {
|
|
@@ -279,6 +284,24 @@ export const ERROR_CATEGORIES: {
|
|
|
279
284
|
},
|
|
280
285
|
},
|
|
281
286
|
},
|
|
287
|
+
HARDHAT_VERIFY: {
|
|
288
|
+
min: 80000,
|
|
289
|
+
max: 89999,
|
|
290
|
+
pluginId: "hardhat-verify",
|
|
291
|
+
websiteTitle: "Hardhat Verify",
|
|
292
|
+
CATEGORIES: {
|
|
293
|
+
GENERAL: {
|
|
294
|
+
min: 80000,
|
|
295
|
+
max: 80099,
|
|
296
|
+
websiteSubTitle: "General errors",
|
|
297
|
+
},
|
|
298
|
+
VALIDATION: {
|
|
299
|
+
min: 80100,
|
|
300
|
+
max: 80199,
|
|
301
|
+
websiteSubTitle: "Validation errors",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
282
305
|
};
|
|
283
306
|
|
|
284
307
|
export const ERRORS = {
|
|
@@ -419,6 +442,29 @@ Please add the property "type" with the value "module" in your package.json to e
|
|
|
419
442
|
websiteTitle: "Invalid hex string",
|
|
420
443
|
websiteDescription: `Given value was not a valid hex string.`,
|
|
421
444
|
},
|
|
445
|
+
CONFIG_VARIABLE_FORMAT_MUST_INCLUDE_VARIABLE: {
|
|
446
|
+
number: 19,
|
|
447
|
+
messageTemplate: `The format string "{format}" must include {marker} marker`,
|
|
448
|
+
websiteTitle: "Config variable format must include \\{variable\\}",
|
|
449
|
+
websiteDescription: `The config variable format must include the string "\\{variable\\}", which will be replaced with the actual value of the variable.`,
|
|
450
|
+
},
|
|
451
|
+
INVALID_FULLY_QUALIFIED_NAME: {
|
|
452
|
+
number: 20,
|
|
453
|
+
messageTemplate: `Invalid fully qualified contract name "{name}"`,
|
|
454
|
+
websiteTitle: "Invalid fully qualified contract name",
|
|
455
|
+
websiteDescription: `A contract name was expected to be in fully qualified form, but it's not.
|
|
456
|
+
|
|
457
|
+
A fully qualified name should look like file.sol:Contract`,
|
|
458
|
+
},
|
|
459
|
+
INVALID_CONFIG_FILE: {
|
|
460
|
+
number: 21,
|
|
461
|
+
messageTemplate: `Invalid Hardhat config file at {configPath}:
|
|
462
|
+
{errors}`,
|
|
463
|
+
websiteTitle: "Invalid Hardhat config file",
|
|
464
|
+
websiteDescription: `The config file has JS/TS errors.
|
|
465
|
+
|
|
466
|
+
Please resolve the errors before rerunning the command.`,
|
|
467
|
+
},
|
|
422
468
|
},
|
|
423
469
|
INTERNAL: {
|
|
424
470
|
ASSERTION_ERROR: {
|
|
@@ -478,6 +524,12 @@ Please install a version of the peer dependency that meets the plugin's requirem
|
|
|
478
524
|
websiteTitle: "Plugin hook factory is not a valid file URL",
|
|
479
525
|
websiteDescription: `The loading of a plugin's hook factory failed as the import path is not a valid file:// URL.`,
|
|
480
526
|
},
|
|
527
|
+
UNEXPECTED_HOOK_PARAM_MODIFICATION: {
|
|
528
|
+
number: 301,
|
|
529
|
+
messageTemplate: `Parameter "{paramName}" of hook "{hookCategoryName}#{hookName}" is not allowed to be modified`,
|
|
530
|
+
websiteTitle: "Unexpected hook parameter modification",
|
|
531
|
+
websiteDescription: `The parameter is not allowed to be modified`,
|
|
532
|
+
},
|
|
481
533
|
},
|
|
482
534
|
TASK_DEFINITIONS: {
|
|
483
535
|
INVALID_FILE_ACTION: {
|
|
@@ -565,18 +617,17 @@ Please ensure that an action is defined for each task.`,
|
|
|
565
617
|
websiteDescription:
|
|
566
618
|
"The task is empty. Please ensure that tasks have at least one action.",
|
|
567
619
|
},
|
|
568
|
-
|
|
620
|
+
INVALID_ACTION_IMPORT: {
|
|
569
621
|
number: 411,
|
|
570
|
-
messageTemplate:
|
|
571
|
-
|
|
572
|
-
websiteTitle: "Invalid action URL",
|
|
622
|
+
messageTemplate: 'Unable to import the action for task "{task}".',
|
|
623
|
+
websiteTitle: "Unable to import action for task",
|
|
573
624
|
websiteDescription:
|
|
574
|
-
"
|
|
625
|
+
"Unable to import action for task. Please verify that the the file exists and that it provides a default function export.",
|
|
575
626
|
},
|
|
576
627
|
INVALID_ACTION: {
|
|
577
628
|
number: 412,
|
|
578
629
|
messageTemplate:
|
|
579
|
-
'The action resolved
|
|
630
|
+
'The action resolved in task "{task}" is not a function',
|
|
580
631
|
websiteTitle: "Invalid action",
|
|
581
632
|
websiteDescription:
|
|
582
633
|
"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.",
|
|
@@ -695,6 +746,32 @@ Please double check your arguments.`,
|
|
|
695
746
|
'The global option "--config" cannot be used with the "init" command',
|
|
696
747
|
websiteDescription: `The global option "--config" cannot be used with the "init" command.
|
|
697
748
|
|
|
749
|
+
Please double check your arguments.`,
|
|
750
|
+
},
|
|
751
|
+
CANNOT_GROUP_OPTIONS: {
|
|
752
|
+
number: 509,
|
|
753
|
+
messageTemplate:
|
|
754
|
+
'Invalid option "{option}". Options cannot be grouped together. Try providing the options separately.',
|
|
755
|
+
websiteTitle: "Options grouping is not supported",
|
|
756
|
+
websiteDescription: `Options cannot be grouped together.
|
|
757
|
+
|
|
758
|
+
Please double check your arguments, and try providing the options separately.`,
|
|
759
|
+
},
|
|
760
|
+
CANNOT_REPEAT_OPTIONS: {
|
|
761
|
+
number: 510,
|
|
762
|
+
messageTemplate:
|
|
763
|
+
'Invalid option "{option}". Options of type "{type}" cannot be repeated.',
|
|
764
|
+
websiteTitle: "Options repetition is not supported",
|
|
765
|
+
websiteDescription: `Some options cannot be repeated.
|
|
766
|
+
|
|
767
|
+
Please double check your arguments.`,
|
|
768
|
+
},
|
|
769
|
+
INVALID_SHORT_NAME: {
|
|
770
|
+
number: 511,
|
|
771
|
+
messageTemplate: `Argument short name "{name}" is invalid. It must consist of exactly one letter.`,
|
|
772
|
+
websiteTitle: "Invalid short argument name",
|
|
773
|
+
websiteDescription: `One of your Hardhat or task short argument names is invalid.
|
|
774
|
+
|
|
698
775
|
Please double check your arguments.`,
|
|
699
776
|
},
|
|
700
777
|
},
|
|
@@ -876,7 +953,7 @@ Try using another mnemonic or deriving less keys.`,
|
|
|
876
953
|
messageTemplate:
|
|
877
954
|
'The provided network type "{networkType}" for network "{networkName}" is not recognized, only `http` and `edr` are supported.',
|
|
878
955
|
websiteTitle: "Invalid network type",
|
|
879
|
-
websiteDescription: `The network manager only supports the network types 'http' and 'edr'.`,
|
|
956
|
+
websiteDescription: `The network manager only supports the network types 'http' and 'edr-simulated'.`,
|
|
880
957
|
},
|
|
881
958
|
DATA_FIELD_CANNOT_BE_NULL_WITH_NULL_ADDRESS: {
|
|
882
959
|
number: 721,
|
|
@@ -892,6 +969,16 @@ Try using another mnemonic or deriving less keys.`,
|
|
|
892
969
|
websiteDescription:
|
|
893
970
|
"The provider your are trying to use has been closed. Please create a new one using hre.network.connect() and try again.",
|
|
894
971
|
},
|
|
972
|
+
INCOMPATIBLE_EIP7702_FIELDS: {
|
|
973
|
+
number: 723,
|
|
974
|
+
messageTemplate:
|
|
975
|
+
"An incompatible transaction with gasPrice and EIP-7702 fields.",
|
|
976
|
+
websiteTitle: "Incompatible EIP-7702 parameters",
|
|
977
|
+
websiteDescription: `You are trying to send a transaction with a locally managed
|
|
978
|
+
account, and its parameters are incompatible. You sent both gasPrice and authorizationList.
|
|
979
|
+
|
|
980
|
+
Please double check your transactions' parameters.`,
|
|
981
|
+
},
|
|
895
982
|
},
|
|
896
983
|
SOLIDITY_TESTS: {
|
|
897
984
|
BUILD_INFO_NOT_FOUND_FOR_CONTRACT: {
|
|
@@ -919,140 +1006,38 @@ Remaining test suites: {suites}`,
|
|
|
919
1006
|
},
|
|
920
1007
|
},
|
|
921
1008
|
SOLIDITY: {
|
|
922
|
-
|
|
1009
|
+
PROJECT_ROOT_RESOLUTION_ERROR: {
|
|
923
1010
|
number: 900,
|
|
924
|
-
|
|
925
|
-
messageTemplate: `File "{file}" is being resolved as a project file, but it's not part of the project.`,
|
|
926
|
-
websiteTitle: "Solidity project file is outside the project",
|
|
927
|
-
websiteDescription: `Tried to resolve a file as a project file, but it's not part of the project.`,
|
|
928
|
-
},
|
|
929
|
-
RESOLVING_NONEXISTENT_PROJECT_FILE: {
|
|
930
|
-
number: 901,
|
|
931
|
-
shouldBeReported: true,
|
|
932
|
-
messageTemplate: `File "{file}" is being resolved as a project file, but it doesn't exist.`,
|
|
933
|
-
websiteTitle: "Solidity project file doesn't exist",
|
|
934
|
-
websiteDescription: `Tried to resolve a file as a project file, but it doesn't exist.`,
|
|
935
|
-
},
|
|
936
|
-
IMPORTED_FILE_DOESNT_EXIST: {
|
|
937
|
-
number: 902,
|
|
938
|
-
messageTemplate: `The import "{importPath} from "{from}" doesn't exist.`,
|
|
939
|
-
websiteTitle: "Imported file doesn't exist",
|
|
940
|
-
websiteDescription: `An imported file doesn't exist.`,
|
|
941
|
-
},
|
|
942
|
-
IMPORTED_FILE_WITH_INCORRECT_CASING: {
|
|
943
|
-
number: 903,
|
|
944
|
-
messageTemplate:
|
|
945
|
-
'The import "{importPath} from "{from}" exists, but its casing is incorrect. The correct casing is "{correctCasing}".',
|
|
946
|
-
websiteTitle: "Imported file with incorrect casing",
|
|
947
|
-
websiteDescription: `Hardhat enforces that you import your files with the correct casing (as stored in the filesystem).
|
|
1011
|
+
messageTemplate: `There was an error while resolving the project file "{filePath}":
|
|
948
1012
|
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
number: 904,
|
|
953
|
-
messageTemplate:
|
|
954
|
-
'The import "{importPath} from "{from}" exists, but its casing is incorrect.',
|
|
955
|
-
websiteTitle: "Imported file with incorrect casing",
|
|
956
|
-
websiteDescription: `Hardhat enforces that you import your files with the correct casing (as stored in the filesystem).
|
|
1013
|
+
{error}`,
|
|
1014
|
+
websiteTitle: "Project file resolution error",
|
|
1015
|
+
websiteDescription: `There was an error while resolving the project file.
|
|
957
1016
|
|
|
958
|
-
|
|
959
|
-
},
|
|
960
|
-
NPM_DEPEDNDENCY_NOT_INSTALLED: {
|
|
961
|
-
number: 905,
|
|
962
|
-
messageTemplate:
|
|
963
|
-
'The npm package "{packageName}" isn\'t installed in the {from}.',
|
|
964
|
-
websiteTitle: "Uninstalled npm dependency",
|
|
965
|
-
websiteDescription: `Trying to use an npm package as a solidity dependency, but it's not installed.`,
|
|
1017
|
+
Please double-check your configuration. If it keeps happening, please report it.`,
|
|
966
1018
|
},
|
|
967
|
-
|
|
968
|
-
number:
|
|
969
|
-
messageTemplate:
|
|
970
|
-
'The import "{importPath}" from "{from}" is trying to use an uninstalled npm dependency.',
|
|
971
|
-
websiteTitle: "Uninstalled npm solidity dependency",
|
|
972
|
-
websiteDescription: `One of your files is traying to import a dependency using npm, but it hasn't been installed`,
|
|
973
|
-
},
|
|
974
|
-
USER_REMAPPING_WITH_NPM_CONTEXT: {
|
|
975
|
-
number: 907,
|
|
976
|
-
messageTemplate:
|
|
977
|
-
'The remapping "{remapping}" has a context starting with "npm/", which is forbidden. Hardhat doesn\'t allow changing the behaviour of npm package\'s imports.',
|
|
978
|
-
websiteTitle: "Remapping imports in npm packages is not allowed",
|
|
979
|
-
websiteDescription: `This error happened because you are trying to change how the imports within an npm package, which is not allowed.
|
|
1019
|
+
NPM_ROOT_RESOLUTION_ERROR: {
|
|
1020
|
+
number: 901,
|
|
1021
|
+
messageTemplate: `There was an error while resolving the npm module "{npmModule}" when trying to compile it:
|
|
980
1022
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
number: 908,
|
|
985
|
-
messageTemplate: `The remapping "{remapping}" is invalid.`,
|
|
986
|
-
websiteTitle: "Invalid remapping",
|
|
987
|
-
websiteDescription: `You are trying to set a user remapping, but it's syntax is invalid.
|
|
1023
|
+
{error}`,
|
|
1024
|
+
websiteTitle: "Npm file resolution error",
|
|
1025
|
+
websiteDescription: `There was an error while resolving an npm module that you are trying to compile and generate artifacts for.
|
|
988
1026
|
|
|
989
|
-
Please double
|
|
1027
|
+
Please double-check your configuration. If it keeps happening, please report it.`,
|
|
990
1028
|
},
|
|
991
|
-
|
|
992
|
-
number:
|
|
993
|
-
messageTemplate: `
|
|
994
|
-
websiteTitle: "Remapping into an uninstaleld npm package",
|
|
995
|
-
websiteDescription: `You are trying to set a user remapping that uses an npm pacakge as target, but it's not installed.
|
|
1029
|
+
IMPORT_RESOLUTION_ERROR: {
|
|
1030
|
+
number: 902,
|
|
1031
|
+
messageTemplate: `There was an error while resolving the import "{importPath}" from "{filePath}":
|
|
996
1032
|
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
number: 910,
|
|
1001
|
-
messageTemplate: `The remapping "{remapping}" targets the npm pacakge "{pacakge}" as if it were part of this repository, but version "{version}" is installed instead`,
|
|
1002
|
-
websiteTitle:
|
|
1003
|
-
"Remapping into a monorepo package but found an npm package instead",
|
|
1004
|
-
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.`,
|
|
1005
|
-
},
|
|
1006
|
-
REMAPPING_HARDHAT_PROJECT_AS_MONOREPO_PACKAGE: {
|
|
1007
|
-
number: 911,
|
|
1008
|
-
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.`,
|
|
1009
|
-
websiteTitle: `Remapping into the project using npm`,
|
|
1010
|
-
websiteDescription: `You are trying to set a remapping whose target uses the npm/ syntax, but is within your Hardhat project.
|
|
1033
|
+
{error}`,
|
|
1034
|
+
websiteTitle: "Import resolution error",
|
|
1035
|
+
websiteDescription: `There was an error while resolving an import.
|
|
1011
1036
|
|
|
1012
|
-
Please
|
|
1013
|
-
},
|
|
1014
|
-
REMAPPING_INCORRECT_VERSION: {
|
|
1015
|
-
number: 912,
|
|
1016
|
-
messageTemplate: `The remapping "{remapping}" is trying to set the npm package "{package}" version "{expectedVersion}" as target, but found version "{actualVersion}" instead.`,
|
|
1017
|
-
websiteTitle: `Remapping into incorrect npm package version`,
|
|
1018
|
-
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.
|
|
1019
|
-
|
|
1020
|
-
Please change your remapping to match the installed version, or installed the correct one.`,
|
|
1021
|
-
},
|
|
1022
|
-
INVALID_NPM_IMPORT: {
|
|
1023
|
-
number: 913,
|
|
1024
|
-
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.`,
|
|
1025
|
-
websiteTitle: `Invalid npm import`,
|
|
1026
|
-
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.`,
|
|
1027
|
-
},
|
|
1028
|
-
ILLEGAL_PACKAGE_IMPORT: {
|
|
1029
|
-
number: 914,
|
|
1030
|
-
messageTemplate: `The import "{importPath}" in "{from}" is not a legal import as it's trying to import a file outside of its package.`,
|
|
1031
|
-
websiteTitle: `Illegal package import`,
|
|
1032
|
-
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.`,
|
|
1033
|
-
},
|
|
1034
|
-
ILEGALL_PROJECT_IMPORT: {
|
|
1035
|
-
number: 915,
|
|
1036
|
-
messageTemplate: `The import "{importPath}" in "{from}" is not a legal import as it's trying to import a file outside of the project.`,
|
|
1037
|
-
websiteTitle: `Illegal project import`,
|
|
1038
|
-
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.`,
|
|
1039
|
-
},
|
|
1040
|
-
ILLEGAL_PROJECT_IMPORT_AFTER_REMAPPING: {
|
|
1041
|
-
number: 916,
|
|
1042
|
-
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.`,
|
|
1043
|
-
websiteTitle: `Illegal project import after remapping`,
|
|
1044
|
-
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.
|
|
1045
|
-
|
|
1046
|
-
If you are trying to remap into an npm module use the npm/ syntax instead.`,
|
|
1047
|
-
},
|
|
1048
|
-
IMPORT_PATH_WITH_WINDOWS_SEPARATOR: {
|
|
1049
|
-
number: 917,
|
|
1050
|
-
messageTemplate: `The import "{importPath}" in "{from}" is not a valid import as it contains a Windows path separator.`,
|
|
1051
|
-
websiteTitle: `Import path with Windows path separator`,
|
|
1052
|
-
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.`,
|
|
1037
|
+
Please double-check your import`,
|
|
1053
1038
|
},
|
|
1054
1039
|
INVALID_SOLC_VERSION: {
|
|
1055
|
-
number:
|
|
1040
|
+
number: 903,
|
|
1056
1041
|
messageTemplate: `Solidity version {version} is invalid or hasn't been released yet.
|
|
1057
1042
|
|
|
1058
1043
|
If you are certain it has been released, run "npx hardhat clean --global" and try again`,
|
|
@@ -1061,39 +1046,8 @@ If you are certain it has been released, run "npx hardhat clean --global" and tr
|
|
|
1061
1046
|
|
|
1062
1047
|
If you are certain it has been released, run \`npx hardhat clean --global\` and try again.`,
|
|
1063
1048
|
},
|
|
1064
|
-
RESOLVE_NPM_FILE_WITH_INVALID_FORMAT: {
|
|
1065
|
-
number: 919,
|
|
1066
|
-
messageTemplate: `Couldn't resolve the npm file "{module}" because it has an invalid format.
|
|
1067
|
-
|
|
1068
|
-
Make sure that you are providing valid npm file paths (e.g. package/File.sol) in your config and programatically.`,
|
|
1069
|
-
websiteTitle: "Resolving invalid npm file",
|
|
1070
|
-
websiteDescription: `Tried to resolve an npm file directly (i.e. not imported by another file) but its format is invalid.
|
|
1071
|
-
|
|
1072
|
-
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.`,
|
|
1073
|
-
},
|
|
1074
|
-
RESOLVE_NPM_FILE_CLASHES_WITH_LOCAL_FILES: {
|
|
1075
|
-
number: 920,
|
|
1076
|
-
shouldBeReported: true,
|
|
1077
|
-
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.
|
|
1078
|
-
|
|
1079
|
-
Please try renaming the directory.`,
|
|
1080
|
-
websiteTitle: "Resolution of npm file clashes with local files",
|
|
1081
|
-
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.`,
|
|
1082
|
-
},
|
|
1083
|
-
RESOLVE_NON_EXISTENT_NPM_ROOT: {
|
|
1084
|
-
number: 921,
|
|
1085
|
-
messageTemplate: `You are tying to compile the npm file "{module}", but it doesn't exist within its package.`,
|
|
1086
|
-
websiteTitle: "Resolution of non-existent npm file",
|
|
1087
|
-
websiteDescription: `You are tying to resolve an npm file that doesn't exist within its package.`,
|
|
1088
|
-
},
|
|
1089
|
-
RESOLVE_WRONG_CASING_NPM_ROOT: {
|
|
1090
|
-
number: 922,
|
|
1091
|
-
messageTemplate: `You are tying to compile the npm file "{module}", its casing is incorrect. Please double check it in your config.`,
|
|
1092
|
-
websiteTitle: "Resolution of npm file with incorrect casing",
|
|
1093
|
-
websiteDescription: `You are tying to resolve an npm file whose casing is incorrect.`,
|
|
1094
|
-
},
|
|
1095
1049
|
DOWNLOAD_FAILED: {
|
|
1096
|
-
number:
|
|
1050
|
+
number: 904,
|
|
1097
1051
|
messageTemplate:
|
|
1098
1052
|
"Couldn't download compiler version {remoteVersion}. Please check your internet connection and try again.",
|
|
1099
1053
|
websiteTitle: "`solc` download failed",
|
|
@@ -1102,7 +1056,7 @@ Please try renaming the directory.`,
|
|
|
1102
1056
|
Please check your internet connection and try again.`,
|
|
1103
1057
|
},
|
|
1104
1058
|
VERSION_LIST_DOWNLOAD_FAILED: {
|
|
1105
|
-
number:
|
|
1059
|
+
number: 905,
|
|
1106
1060
|
messageTemplate:
|
|
1107
1061
|
"Couldn't download compiler version list. Please check your internet connection and try again.",
|
|
1108
1062
|
websiteTitle: "Couldn't obtain `solc` version list",
|
|
@@ -1111,7 +1065,7 @@ Please check your internet connection and try again.`,
|
|
|
1111
1065
|
Please check your internet connection and try again.`,
|
|
1112
1066
|
},
|
|
1113
1067
|
INVALID_DOWNLOAD: {
|
|
1114
|
-
number:
|
|
1068
|
+
number: 906,
|
|
1115
1069
|
messageTemplate: `Couldn't download compiler version {remoteVersion}: Checksum verification failed.
|
|
1116
1070
|
|
|
1117
1071
|
Please check your internet connection and try again.
|
|
@@ -1125,7 +1079,7 @@ Please check your internet connection and try again.
|
|
|
1125
1079
|
If this error persists, run \`npx hardhat clean --global\`.`,
|
|
1126
1080
|
},
|
|
1127
1081
|
CANT_RUN_NATIVE_COMPILER: {
|
|
1128
|
-
number:
|
|
1082
|
+
number: 907,
|
|
1129
1083
|
messageTemplate: `A native version of solc failed to run.
|
|
1130
1084
|
|
|
1131
1085
|
If you are running MacOS, try installing Apple Rosetta.
|
|
@@ -1139,7 +1093,7 @@ If you are running MacOS, try installing Apple Rosetta.
|
|
|
1139
1093
|
If this error persists, run "npx hardhat clean --global".`,
|
|
1140
1094
|
},
|
|
1141
1095
|
CANT_RUN_SOLCJS_COMPILER: {
|
|
1142
|
-
number:
|
|
1096
|
+
number: 908,
|
|
1143
1097
|
messageTemplate: `A wasm version of solc failed to run.
|
|
1144
1098
|
|
|
1145
1099
|
If this error persists, run "npx hardhat clean --global".`,
|
|
@@ -1151,7 +1105,7 @@ If you are running MacOS, try installing Apple Rosetta.
|
|
|
1151
1105
|
If this error persists, run "npx hardhat clean --global".`,
|
|
1152
1106
|
},
|
|
1153
1107
|
COMPILATION_JOB_CREATION_ERROR: {
|
|
1154
|
-
number:
|
|
1108
|
+
number: 909,
|
|
1155
1109
|
messageTemplate: `Failed to create compilation job for file "{rootFilePath}" using the build profile "{buildProfile}".
|
|
1156
1110
|
|
|
1157
1111
|
{reason}`,
|
|
@@ -1161,7 +1115,7 @@ If this error persists, run "npx hardhat clean --global".`,
|
|
|
1161
1115
|
This happens when your files require incompatible versions of solc or you haven't configured a version that works with them`,
|
|
1162
1116
|
},
|
|
1163
1117
|
BUILD_FAILED: {
|
|
1164
|
-
number:
|
|
1118
|
+
number: 910,
|
|
1165
1119
|
messageTemplate: "Compilation failed",
|
|
1166
1120
|
websiteTitle: "Compilation failed",
|
|
1167
1121
|
websiteDescription: `Your smart contracts failed to compile.
|
|
@@ -1169,19 +1123,13 @@ This happens when your files require incompatible versions of solc or you haven'
|
|
|
1169
1123
|
Please check Hardhat's output for more details.`,
|
|
1170
1124
|
},
|
|
1171
1125
|
INVALID_SOLCJS_COMPILER: {
|
|
1172
|
-
number:
|
|
1126
|
+
number: 911,
|
|
1173
1127
|
messageTemplate: `A wasm version of solc {version} is invalid. The compile function is not available.`,
|
|
1174
1128
|
websiteTitle: "Invalid solcjs compiler",
|
|
1175
|
-
websiteDescription: `Hardhat successfully downloaded a WASM version of solc
|
|
1176
|
-
},
|
|
1177
|
-
RESOLVE_NOT_EXPORTED_NPM_FILE: {
|
|
1178
|
-
number: 931,
|
|
1179
|
-
messageTemplate: `You are tying to resolve the npm file "{module}", but it's not exported by its package`,
|
|
1180
|
-
websiteTitle: "Resolution of not-exported npm file",
|
|
1181
|
-
websiteDescription: `You are tying to resolve an npm file that is not exported by its package.`,
|
|
1129
|
+
websiteDescription: `Hardhat successfully downloaded a WASM version of solc but it is invalid. The compile function is missing.`,
|
|
1182
1130
|
},
|
|
1183
1131
|
BUILD_PROFILE_NOT_FOUND: {
|
|
1184
|
-
number:
|
|
1132
|
+
number: 912,
|
|
1185
1133
|
messageTemplate: `The build profile "{buildProfileName}" is not defined in your Hardhat config`,
|
|
1186
1134
|
websiteTitle: "Build profile not defined",
|
|
1187
1135
|
websiteDescription: `The build profile you are trying to use is not defined in your Hardhat config.`,
|
|
@@ -1214,9 +1162,9 @@ Please use the fully qualified name of the contract to disambiguate it.`,
|
|
|
1214
1162
|
NODE: {
|
|
1215
1163
|
INVALID_NETWORK_TYPE: {
|
|
1216
1164
|
number: 1100,
|
|
1217
|
-
messageTemplate: `The provided node network type "{networkType}" for network "{networkName}" is not recognized, only 'edr' is supported.`,
|
|
1165
|
+
messageTemplate: `The provided node network type "{networkType}" for network "{networkName}" is not recognized, only 'edr-simulated' is supported.`,
|
|
1218
1166
|
websiteTitle: "Invalid node network type",
|
|
1219
|
-
websiteDescription: `The node only supports the 'edr' network type.`,
|
|
1167
|
+
websiteDescription: `The node only supports the 'edr-simulated' network type.`,
|
|
1220
1168
|
},
|
|
1221
1169
|
},
|
|
1222
1170
|
TEST_PLUGIN: {
|
|
@@ -1227,6 +1175,20 @@ Please use the fully qualified name of the contract to disambiguate it.`,
|
|
|
1227
1175
|
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.`,
|
|
1228
1176
|
},
|
|
1229
1177
|
},
|
|
1178
|
+
COVERAGE: {
|
|
1179
|
+
SOURCE_NOT_INSTRUMENTED: {
|
|
1180
|
+
number: 1300,
|
|
1181
|
+
messageTemplate: `The source file "{sourceName}" could not be instrumented for coverage.`,
|
|
1182
|
+
websiteTitle: "Source file not instrumented for coverage",
|
|
1183
|
+
websiteDescription: `The source file could not be instrumented for coverage.`,
|
|
1184
|
+
},
|
|
1185
|
+
IMPORT_PATH_ALREADY_DEFINED: {
|
|
1186
|
+
number: 1301,
|
|
1187
|
+
messageTemplate: `The import path "{importPath}" is already defined in the compilation sources`,
|
|
1188
|
+
websiteTitle: "Import path already defined in compilation sources",
|
|
1189
|
+
websiteDescription: `The import path is already defined in the compilation sources`,
|
|
1190
|
+
},
|
|
1191
|
+
},
|
|
1230
1192
|
},
|
|
1231
1193
|
IGNITION: {
|
|
1232
1194
|
GENERAL: {
|
|
@@ -1244,6 +1206,14 @@ Please use the fully qualified name of the contract to disambiguate it.`,
|
|
|
1244
1206
|
websiteTitle: "Unsupported ethers.js value",
|
|
1245
1207
|
websiteDescription: "Unsupported ethers.js value",
|
|
1246
1208
|
},
|
|
1209
|
+
ARTIFACT_MIGRATION_NEEDED: {
|
|
1210
|
+
number: 10002,
|
|
1211
|
+
messageTemplate:
|
|
1212
|
+
"Hardhat Ignition needs to migrate this deployments artifacts to the new format. Please run `npx hardhat ignition migrate {deploymentId}`",
|
|
1213
|
+
websiteTitle: "Artifact migration needed",
|
|
1214
|
+
websiteDescription:
|
|
1215
|
+
"Hardhat Ignition needs to migrate the artifacts to the new format. Please run `npx hardhat ignition migrate {deploymentId}`",
|
|
1216
|
+
},
|
|
1247
1217
|
},
|
|
1248
1218
|
INTERNAL: {
|
|
1249
1219
|
INTERNAL_ERROR: {
|
|
@@ -1534,11 +1504,11 @@ Please review the error message and try again.`,
|
|
|
1534
1504
|
},
|
|
1535
1505
|
TRANSACTION_LOST: {
|
|
1536
1506
|
number: 10410,
|
|
1537
|
-
messageTemplate: `An error
|
|
1507
|
+
messageTemplate: `An error occurred while trying to send a transaction for future {futureId}.
|
|
1538
1508
|
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:
|
|
1539
1509
|
npx hardhat ignition track-tx <txHash> <deploymentId> --network <networkName>`,
|
|
1540
1510
|
websiteTitle: "Transaction lost",
|
|
1541
|
-
websiteDescription: `An error
|
|
1511
|
+
websiteDescription: `An error occurred while trying to send a transaction`,
|
|
1542
1512
|
},
|
|
1543
1513
|
},
|
|
1544
1514
|
RECONCILIATION: {
|
|
@@ -1696,7 +1666,7 @@ npx hardhat ignition track-tx <txHash> <deploymentId> --network <networkName>`,
|
|
|
1696
1666
|
messageTemplate:
|
|
1697
1667
|
"Invalid libraries for contract {contractName}: The names '{inputName}' and '{libName}' clash with each other, please use qualified names for both.",
|
|
1698
1668
|
websiteTitle: "Conflicting library names",
|
|
1699
|
-
websiteDescription: `The
|
|
1669
|
+
websiteDescription: `The library names clash with each other`,
|
|
1700
1670
|
},
|
|
1701
1671
|
INVALID_LIBRARY_NAME: {
|
|
1702
1672
|
number: 10718,
|
|
@@ -1974,6 +1944,26 @@ Please try again later.`,
|
|
|
1974
1944
|
websiteTitle: "Unsupported type for deep copy",
|
|
1975
1945
|
websiteDescription: "Unsupported type for deep copy",
|
|
1976
1946
|
},
|
|
1947
|
+
ACCOUNTS_OF_TYPE_REMOTE: {
|
|
1948
|
+
number: 20014,
|
|
1949
|
+
messageTemplate:
|
|
1950
|
+
"Tried to obtain a private key, but the network is configured to use remote accounts.",
|
|
1951
|
+
websiteTitle: "Remote accounts are not supported",
|
|
1952
|
+
websiteDescription: "Remote accounts are not supported",
|
|
1953
|
+
},
|
|
1954
|
+
WRONG_ACCOUNTS_FORMAT: {
|
|
1955
|
+
number: 20015,
|
|
1956
|
+
messageTemplate: `The "accounts" property in your Hardhat configuration file is not set correctly.`,
|
|
1957
|
+
websiteTitle: `Invalid "accounts" property in your Hardhat configuration file`,
|
|
1958
|
+
websiteDescription: `The "accounts" property in your Hardhat configuration file is not set correctly. Please double check it and try again.`,
|
|
1959
|
+
},
|
|
1960
|
+
NO_PRIVATE_KEY_FOR_ADDRESS: {
|
|
1961
|
+
number: 20016,
|
|
1962
|
+
messageTemplate: `No private key can be associated with the address "{address}".`,
|
|
1963
|
+
websiteTitle: "Private key for the address could not be found",
|
|
1964
|
+
websiteDescription:
|
|
1965
|
+
"The private key for the address could not be found. Please double check your private keys and try again.",
|
|
1966
|
+
},
|
|
1977
1967
|
},
|
|
1978
1968
|
},
|
|
1979
1969
|
HARDHAT_MOCHA: {
|
|
@@ -1995,11 +1985,13 @@ Please try again later.`,
|
|
|
1995
1985
|
websiteTitle: "Network not found",
|
|
1996
1986
|
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:
|
|
1997
1987
|
|
|
1988
|
+
\`\`\`ts
|
|
1998
1989
|
import { someChain } from "viem/chains";
|
|
1999
1990
|
const client = await hre.viem.getPublicClient({
|
|
2000
1991
|
chain: someChain,
|
|
2001
1992
|
...
|
|
2002
1993
|
});
|
|
1994
|
+
\`\`\`
|
|
2003
1995
|
|
|
2004
1996
|
You can find a list of supported networks here: https://github.com/wevm/viem/blob/main/src/chains/index.ts`,
|
|
2005
1997
|
},
|
|
@@ -2020,12 +2012,15 @@ Please ensure you're using one of the supported networks.`,
|
|
|
2020
2012
|
|
|
2021
2013
|
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:
|
|
2022
2014
|
|
|
2015
|
+
\`\`\`ts
|
|
2023
2016
|
const networkConnection = await hre.network.connect(...);
|
|
2024
2017
|
const walletClient = await networkConnection.viem.getWalletClient(address);
|
|
2025
2018
|
|
|
2026
2019
|
await networkConnection.viem.deployContract(contractName, constructorArgs, { walletClient });
|
|
2027
2020
|
await networkConnection.viem.sendDeploymentTransaction(contractName, constructorArgs, { walletClient });
|
|
2028
|
-
await networkConnection.viem.getContractAt(contractName, address, { walletClient })
|
|
2021
|
+
await networkConnection.viem.getContractAt(contractName, address, { walletClient });
|
|
2022
|
+
\`\`\`
|
|
2023
|
+
`,
|
|
2029
2024
|
},
|
|
2030
2025
|
LINKING_CONTRACT_ERROR: {
|
|
2031
2026
|
number: 40003,
|
|
@@ -2061,6 +2056,20 @@ Please check Hardhat's output for more details.`,
|
|
|
2061
2056
|
websiteDescription:
|
|
2062
2057
|
"The password you provided is incorrect or the keystore file is corrupted.",
|
|
2063
2058
|
},
|
|
2059
|
+
CANNOT_CHANGED_PASSWORD_FOR_DEV_KEYSTORE: {
|
|
2060
|
+
number: 50001,
|
|
2061
|
+
messageTemplate: `The keystore "change-password" task cannot be used with the development keystore`,
|
|
2062
|
+
websiteTitle: "Cannot change password for dev keystore",
|
|
2063
|
+
websiteDescription: `The keystore "change-password" task cannot be used with the development keystore`,
|
|
2064
|
+
},
|
|
2065
|
+
KEY_NOT_FOUND_DURING_TESTS_WITH_DEV_KEYSTORE: {
|
|
2066
|
+
number: 50002,
|
|
2067
|
+
messageTemplate: `Key "{key}" not found in the development keystore. Run "npx hardhat keystore set {key} --dev" to set it.`,
|
|
2068
|
+
websiteTitle: "Key not found in the development keystore during tests",
|
|
2069
|
+
websiteDescription: `Key not found in the development keystore. During tests, configuration variables can only be accessed through the development keystore.
|
|
2070
|
+
|
|
2071
|
+
Run \`npx hardhat keystore set <KEY> --dev\` to set it.`,
|
|
2072
|
+
},
|
|
2064
2073
|
},
|
|
2065
2074
|
},
|
|
2066
2075
|
NETWORK_HELPERS: {
|
|
@@ -2255,9 +2264,9 @@ This might be caused by using hardhat_reset and loadFixture calls in a testcase.
|
|
|
2255
2264
|
messageTemplate:
|
|
2256
2265
|
"The .revertedWithCustomError matcher expects two arguments: the contract and the custom error name. Arguments should be asserted with the .withArgs helper.",
|
|
2257
2266
|
websiteTitle:
|
|
2258
|
-
"Invalid arguments length for the
|
|
2267
|
+
"Invalid arguments length for the .revertedWithCustomError matcher",
|
|
2259
2268
|
websiteDescription:
|
|
2260
|
-
"Invalid arguments length for the
|
|
2269
|
+
"Invalid arguments length for the .revertedWithCustomError matcher",
|
|
2261
2270
|
},
|
|
2262
2271
|
WITH_ARGS_FORBIDDEN: {
|
|
2263
2272
|
number: 70011,
|
|
@@ -2353,6 +2362,396 @@ This might be caused by using hardhat_reset and loadFixture calls in a testcase.
|
|
|
2353
2362
|
websiteDescription:
|
|
2354
2363
|
"withArgs called with both .emit and .revertedWithCustomError, but these assertions cannot be combined",
|
|
2355
2364
|
},
|
|
2365
|
+
DEPRECATED_REVERTED_MATCHER: {
|
|
2366
|
+
number: 70024,
|
|
2367
|
+
messageTemplate:
|
|
2368
|
+
"The .reverted matcher has been deprecated. Use .revert(ethers) instead.",
|
|
2369
|
+
websiteTitle: "Deprecated `reverted` matcher",
|
|
2370
|
+
websiteDescription:
|
|
2371
|
+
"The `.reverted` matcher was deprecated and you should use `.revert(ethers)` instead.",
|
|
2372
|
+
},
|
|
2373
|
+
},
|
|
2374
|
+
},
|
|
2375
|
+
HARDHAT_VERIFY: {
|
|
2376
|
+
GENERAL: {
|
|
2377
|
+
NETWORK_NOT_SUPPORTED: {
|
|
2378
|
+
number: 80000,
|
|
2379
|
+
messageTemplate: `The network "{networkName}" with chain id "{chainId}" is not supported.`,
|
|
2380
|
+
websiteTitle: "Network not supported",
|
|
2381
|
+
websiteDescription: `The network is not supported by hardhat-verify. To see the list of supported networks, run:
|
|
2382
|
+
|
|
2383
|
+
\`\`\`sh
|
|
2384
|
+
npx hardhat verify --list-networks
|
|
2385
|
+
\`\`\`
|
|
2386
|
+
|
|
2387
|
+
To add support for a new network, see https://hardhat.org/verify-custom-networks`,
|
|
2388
|
+
},
|
|
2389
|
+
EXPLORER_REQUEST_FAILED: {
|
|
2390
|
+
number: 80001,
|
|
2391
|
+
messageTemplate: `The request to {url} failed with the message "{errorMessage}". This error comes from {name}, not Hardhat.`,
|
|
2392
|
+
websiteTitle: "Explorer request failed",
|
|
2393
|
+
websiteDescription: `The request to the explorer failed.
|
|
2394
|
+
|
|
2395
|
+
- Verify that the URL is correct.
|
|
2396
|
+
- Ensure the service is up and reachable.
|
|
2397
|
+
- Check your network connection and try again.`,
|
|
2398
|
+
},
|
|
2399
|
+
EXPLORER_REQUEST_STATUS_CODE_ERROR: {
|
|
2400
|
+
number: 80002,
|
|
2401
|
+
messageTemplate: `The request to {url} returned a non-success status code {statusCode}: "{errorMessage}". (This response comes from {name}, not Hardhat.)`,
|
|
2402
|
+
websiteTitle: "Explorer request status code error",
|
|
2403
|
+
websiteDescription: `The request to the explorer returned a non-success status code.
|
|
2404
|
+
|
|
2405
|
+
- Verify that the URL is correct.
|
|
2406
|
+
- Ensure the service is up and reachable.
|
|
2407
|
+
- Check your network connection and try again.`,
|
|
2408
|
+
},
|
|
2409
|
+
SOLC_VERSION_NOT_SUPPORTED: {
|
|
2410
|
+
number: 80003,
|
|
2411
|
+
messageTemplate: `The following Solidity compiler versions are not supported by the Etherscan API: {unsupportedSolcVersions}.`,
|
|
2412
|
+
websiteTitle: "Unsupported solidity compiler version",
|
|
2413
|
+
websiteDescription: `The specified Solidity compiler version is not supported by the Etherscan API. Only versions 0.4.11 and above are supported.
|
|
2414
|
+
For a full list of supported versions, visit: https://etherscan.io/solcversions`,
|
|
2415
|
+
},
|
|
2416
|
+
DEPLOYED_BYTECODE_NOT_FOUND: {
|
|
2417
|
+
number: 80004,
|
|
2418
|
+
messageTemplate: `No bytecode found at address "{address}". Is the contract deployed on the "{networkName}" network?`,
|
|
2419
|
+
websiteTitle: "Deployed bytecode not found",
|
|
2420
|
+
websiteDescription: `No bytecode was found at the specified address. This usually means the contract is not deployed or was deployed to a different network.
|
|
2421
|
+
Please verify the address and selected network, and try again.`,
|
|
2422
|
+
},
|
|
2423
|
+
SOLC_VERSION_MISMATCH: {
|
|
2424
|
+
number: 80005,
|
|
2425
|
+
messageTemplate: `The contract deployed to the "{networkName}" network was compiled with Solidity {deployedSolcVersion}, but the configured compiler {configuredSolcVersionSummary}.`,
|
|
2426
|
+
websiteTitle: "Compiler version mismatch",
|
|
2427
|
+
websiteDescription: `The Solidity compiler version used to compile the deployed contract does not match any of the versions configured in your Hardhat project.
|
|
2428
|
+
|
|
2429
|
+
This mismatch may indicate:
|
|
2430
|
+
|
|
2431
|
+
- You're not on the same commit that was used to deploy the contract.
|
|
2432
|
+
- The compiler version in your Hardhat config is incorrect.
|
|
2433
|
+
- The address provided is not the deployed contract.
|
|
2434
|
+
- The selected network is incorrect.`,
|
|
2435
|
+
},
|
|
2436
|
+
CONTRACT_NOT_FOUND: {
|
|
2437
|
+
number: 80006,
|
|
2438
|
+
messageTemplate: `The contract "{contract}" is not present in your project's artifacts.`,
|
|
2439
|
+
websiteTitle: "Contract not found",
|
|
2440
|
+
websiteDescription: `The specified contract is not present in your project's artifacts. Please ensure the contract is compiled and the name is correct.`,
|
|
2441
|
+
},
|
|
2442
|
+
BUILD_INFO_NOT_FOUND: {
|
|
2443
|
+
number: 80007,
|
|
2444
|
+
messageTemplate: `The contract "{contract}" is present in your project, but its build info is missing.`,
|
|
2445
|
+
websiteTitle: "Build info not found",
|
|
2446
|
+
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.`,
|
|
2447
|
+
},
|
|
2448
|
+
BUILD_INFO_SOLC_VERSION_MISMATCH: {
|
|
2449
|
+
number: 80008,
|
|
2450
|
+
messageTemplate: `The contract "{contract}" build info specifies Solidity {buildInfoSolcVersion}, but the deployed bytecode on the "{networkName}" network indicates {versionDetails}.`,
|
|
2451
|
+
websiteTitle: "Build info compiler version mismatch",
|
|
2452
|
+
websiteDescription: `The compiler version in the build info does not match the version encoded in the deployed bytecode.
|
|
2453
|
+
Possible causes:
|
|
2454
|
+
|
|
2455
|
+
- Compiler settings were changed after deployment.
|
|
2456
|
+
- The contract address is incorrect.
|
|
2457
|
+
- The selected network is incorrect.`,
|
|
2458
|
+
},
|
|
2459
|
+
DEPLOYED_BYTECODE_MISMATCH: {
|
|
2460
|
+
number: 80009,
|
|
2461
|
+
messageTemplate: `The address contains a contract whose bytecode does not match {contractDescription}.`,
|
|
2462
|
+
websiteTitle: "Deployed bytecode mismatch",
|
|
2463
|
+
websiteDescription: `The bytecode at the specified address did not match the expected contract.
|
|
2464
|
+
|
|
2465
|
+
Possible causes:
|
|
2466
|
+
|
|
2467
|
+
- Your artifacts are outdated or missing; try running \`npx hardhat compile --force --buildProfile production\`.
|
|
2468
|
+
- The contract code was modified after deployment.
|
|
2469
|
+
- Compiler settings (optimizer, EVM version, etc.) changed after deployment.
|
|
2470
|
+
- The provided address is incorrect.
|
|
2471
|
+
- The selected network is incorrect.`,
|
|
2472
|
+
},
|
|
2473
|
+
DEPLOYED_BYTECODE_MULTIPLE_MATCHES: {
|
|
2474
|
+
number: 80010,
|
|
2475
|
+
messageTemplate: `More than one contract matches the deployed bytecode:
|
|
2476
|
+
{fqnList}
|
|
2477
|
+
|
|
2478
|
+
Specify the exact contract using the \`--contract\` flag.`,
|
|
2479
|
+
websiteTitle: "Multiple contract matches",
|
|
2480
|
+
websiteDescription: `The deployed bytecode matches multiple compiled contracts. Specify the exact contract using the \`--contract\` flag. For example:
|
|
2481
|
+
|
|
2482
|
+
\`\`\`sh
|
|
2483
|
+
npx hardhat verify --contract contracts/Example.sol:ExampleContract <other args>
|
|
2484
|
+
\`\`\`
|
|
2485
|
+
`,
|
|
2486
|
+
},
|
|
2487
|
+
INVALID_LIBRARY_ADDRESS: {
|
|
2488
|
+
number: 80011,
|
|
2489
|
+
messageTemplate: `The library "{library}" provided for the contract "{contract}" has an invalid address: "{address}".`,
|
|
2490
|
+
websiteTitle: "Invalid library address",
|
|
2491
|
+
websiteDescription: `The address provided for a linked library is invalid. Please make sure the address is a valid Ethereum address.`,
|
|
2492
|
+
},
|
|
2493
|
+
UNUSED_LIBRARY: {
|
|
2494
|
+
number: 80012,
|
|
2495
|
+
messageTemplate: `The library "{library}" provided for the contract "{contract}" is not used by the contract.
|
|
2496
|
+
|
|
2497
|
+
{suggestion}`,
|
|
2498
|
+
websiteTitle: "Library not found in contract",
|
|
2499
|
+
websiteDescription: `A library was specified using the "--libraries" option, but the selected contract does not use it.
|
|
2500
|
+
|
|
2501
|
+
If the contract uses external libraries, verify that the provided name matches the fully qualified name (FQN) of one of them, such as:
|
|
2502
|
+
|
|
2503
|
+
\`\`\`
|
|
2504
|
+
contracts/Math.sol:SafeMath
|
|
2505
|
+
\`\`\`
|
|
2506
|
+
`,
|
|
2507
|
+
},
|
|
2508
|
+
LIBRARY_MULTIPLE_MATCHES: {
|
|
2509
|
+
number: 80013,
|
|
2510
|
+
messageTemplate: `The library "{library}" provided for the contract "{contract}" is ambiguous.
|
|
2511
|
+
It matches multiple libraries:
|
|
2512
|
+
{fqnList}
|
|
2513
|
+
|
|
2514
|
+
To fix this, specify one of these fully qualified library names and try again.`,
|
|
2515
|
+
websiteTitle: "Library name is ambiguous",
|
|
2516
|
+
websiteDescription: `The specified library name matches multiple libraries used by the contract.
|
|
2517
|
+
|
|
2518
|
+
To resolve the ambiguity, provide the fully qualified library name in the format:
|
|
2519
|
+
|
|
2520
|
+
\`\`\`
|
|
2521
|
+
path/to/LibraryFile.sol:LibraryName
|
|
2522
|
+
\`\`\`
|
|
2523
|
+
`,
|
|
2524
|
+
},
|
|
2525
|
+
DUPLICATED_LIBRARY: {
|
|
2526
|
+
number: 80014,
|
|
2527
|
+
messageTemplate: `The library name "{library}" and its fully qualified name "{libraryFqn}" refer to the same library.
|
|
2528
|
+
|
|
2529
|
+
To fix this, remove one of them and try again.`,
|
|
2530
|
+
websiteTitle: "Duplicated library entry",
|
|
2531
|
+
websiteDescription: `The same library was specified more than once using both its short name and fully qualified name (FQN) in the \`--libraries\` option.
|
|
2532
|
+
|
|
2533
|
+
Only one form should be used for each library. Remove one of the entries and try again.`,
|
|
2534
|
+
},
|
|
2535
|
+
LIBRARY_ADDRESSES_MISMATCH: {
|
|
2536
|
+
number: 80015,
|
|
2537
|
+
messageTemplate: `The following detected library addresses differ from those you provided:
|
|
2538
|
+
{conflictList}
|
|
2539
|
+
|
|
2540
|
+
You can either fix these addresses in your libraries, or remove them to let the plugin autodetect them.`,
|
|
2541
|
+
websiteTitle: "Library address mismatch",
|
|
2542
|
+
websiteDescription: `Some libraries have conflicting addresses between what you provided and what was detected in the deployed bytecode.
|
|
2543
|
+
|
|
2544
|
+
Please ensure each library address is correct. You can remove entries from your input to use autodetection instead.`,
|
|
2545
|
+
},
|
|
2546
|
+
MISSING_LIBRARY_ADDRESSES: {
|
|
2547
|
+
number: 80016,
|
|
2548
|
+
messageTemplate: `The contract "{contract}" has one or more library addresses that cannot be detected from the deployed bytecode.
|
|
2549
|
+
This can occur if a library is only used in the contract's constructor. The missing libraries are:
|
|
2550
|
+
{missingList}`,
|
|
2551
|
+
websiteTitle: "Missing library addresses",
|
|
2552
|
+
websiteDescription: `One or more libraries required by the contract could not be detected from the deployed bytecode.
|
|
2553
|
+
|
|
2554
|
+
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.`,
|
|
2555
|
+
},
|
|
2556
|
+
INVALID_CONSTRUCTOR_ARGUMENT_TYPE: {
|
|
2557
|
+
number: 80017,
|
|
2558
|
+
messageTemplate: `The value "{value}" for a constructor parameter cannot be encoded.
|
|
2559
|
+
Reason: {reason}.`,
|
|
2560
|
+
websiteTitle: "Invalid constructor argument type",
|
|
2561
|
+
websiteDescription: `One of the arguments passed to the contract's constructor has an invalid JavaScript type.
|
|
2562
|
+
|
|
2563
|
+
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.
|
|
2564
|
+
|
|
2565
|
+
Please verify that each constructor argument is the correct JS type.`,
|
|
2566
|
+
},
|
|
2567
|
+
INVALID_CONSTRUCTOR_ARGUMENTS_LENGTH: {
|
|
2568
|
+
number: 80018,
|
|
2569
|
+
messageTemplate: `The constructor for "{contract}" has {requiredArgs} parameters but {providedArgs} arguments were provided instead.`,
|
|
2570
|
+
websiteTitle: "Invalid constructor argument count",
|
|
2571
|
+
websiteDescription: `The number of arguments provided to the contract's constructor doesn't match the number of parameters defined in its ABI.
|
|
2572
|
+
|
|
2573
|
+
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.
|
|
2574
|
+
|
|
2575
|
+
Please verify that you pass the exact number of arguments required by the constructor.`,
|
|
2576
|
+
},
|
|
2577
|
+
CONSTRUCTOR_ARGUMENT_OVERFLOW: {
|
|
2578
|
+
number: 80019,
|
|
2579
|
+
messageTemplate: `The value "{value}" is out of bounds for its Solidity type and cannot be encoded.`,
|
|
2580
|
+
websiteTitle: "Constructor argument value out of bounds",
|
|
2581
|
+
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).
|
|
2582
|
+
|
|
2583
|
+
This error occurs when a value exceeds the maximum or minimum allowed for the specified Solidity type.
|
|
2584
|
+
|
|
2585
|
+
Please ensure all argument values fit within the valid range for their respective Solidity types.`,
|
|
2586
|
+
},
|
|
2587
|
+
CONSTRUCTOR_ARGUMENTS_ENCODING_FAILED: {
|
|
2588
|
+
number: 80020,
|
|
2589
|
+
messageTemplate: `The constructor arguments for "{contract}" could not be encoded. Reason: {reason}.`,
|
|
2590
|
+
websiteTitle: "Constructor arguments encoding failed",
|
|
2591
|
+
websiteDescription: `The constructor arguments provided for the contract could not be encoded correctly.
|
|
2592
|
+
Please review the provided arguments and ensure they match the expected arguments defined in the contract's ABI.`,
|
|
2593
|
+
},
|
|
2594
|
+
CONTRACT_VERIFICATION_MISSING_BYTECODE: {
|
|
2595
|
+
number: 80021,
|
|
2596
|
+
messageTemplate: `The request to {url} failed because the address "{address}" does not have bytecode.`,
|
|
2597
|
+
websiteTitle: "Missing bytecode at address",
|
|
2598
|
+
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.
|
|
2599
|
+
|
|
2600
|
+
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.`,
|
|
2601
|
+
},
|
|
2602
|
+
CONTRACT_ALREADY_VERIFIED: {
|
|
2603
|
+
number: 80022,
|
|
2604
|
+
messageTemplate: `The contract "{contract}" at address "{address}" is already verified.`,
|
|
2605
|
+
websiteTitle: "Contract already verified",
|
|
2606
|
+
websiteDescription: `The block explorer responded that the contract is already verified.
|
|
2607
|
+
|
|
2608
|
+
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.`,
|
|
2609
|
+
},
|
|
2610
|
+
CONTRACT_VERIFICATION_REQUEST_FAILED: {
|
|
2611
|
+
number: 80023,
|
|
2612
|
+
messageTemplate: `The contract verification request failed: "{message}".`,
|
|
2613
|
+
websiteTitle: "Contract verification request failed",
|
|
2614
|
+
websiteDescription: `The block explorer returned an error when attempting to verify the contract's source code.
|
|
2615
|
+
|
|
2616
|
+
Please check the returned message for details.`,
|
|
2617
|
+
},
|
|
2618
|
+
CONTRACT_VERIFICATION_STATUS_POLLING_FAILED: {
|
|
2619
|
+
number: 80024,
|
|
2620
|
+
messageTemplate: `The contract verification status polling encountered an error: "{message}". Verification may still succeed.`,
|
|
2621
|
+
websiteTitle: "Contract verification status polling failed",
|
|
2622
|
+
websiteDescription:
|
|
2623
|
+
"The block explorer returned a failure status when checking the verification status. Verification may still succeed; please check manually.",
|
|
2624
|
+
},
|
|
2625
|
+
CONTRACT_VERIFICATION_UNEXPECTED_RESPONSE: {
|
|
2626
|
+
number: 80025,
|
|
2627
|
+
messageTemplate: `The block explorer API returned an unexpected message: "{message}". Please report this issue to the Hardhat team.`,
|
|
2628
|
+
shouldBeReported: true,
|
|
2629
|
+
websiteTitle: "Unexpected API response during contract verification",
|
|
2630
|
+
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.
|
|
2631
|
+
|
|
2632
|
+
Please report this issue to the Hardhat team.`,
|
|
2633
|
+
},
|
|
2634
|
+
CONTRACT_VERIFICATION_FAILED: {
|
|
2635
|
+
number: 80026,
|
|
2636
|
+
messageTemplate: `The contract verification failed.
|
|
2637
|
+
Reason: "{reason}".
|
|
2638
|
+
{librariesWarning}`,
|
|
2639
|
+
websiteTitle: "Contract verification failed",
|
|
2640
|
+
websiteDescription: `Unable to verify the contract on the block explorer.
|
|
2641
|
+
|
|
2642
|
+
If your contract uses libraries whose addresses cannot be detected automatically, make sure you are providing the correct address for each undetectable library.`,
|
|
2643
|
+
},
|
|
2644
|
+
BLOCK_EXPLORER_NOT_CONFIGURED: {
|
|
2645
|
+
number: 80027,
|
|
2646
|
+
messageTemplate:
|
|
2647
|
+
"No {verificationProvider} block explorer is configured for the {chainId} chain in the chain descriptors.",
|
|
2648
|
+
websiteTitle: "Block explorer not configured",
|
|
2649
|
+
websiteDescription: `
|
|
2650
|
+
Block explorer information is missing in your chain descriptor configuration.
|
|
2651
|
+
|
|
2652
|
+
To enable contract verification, add an entry for the verification provider in the blockExplorers field of the relevant chain descriptor.
|
|
2653
|
+
You can override the default chain descriptor by providing your own chainDescriptors object in the Hardhat config, with the following structure:
|
|
2654
|
+
|
|
2655
|
+
\`\`\`
|
|
2656
|
+
chainDescriptors: {
|
|
2657
|
+
<chainId>: {
|
|
2658
|
+
name: <name>,
|
|
2659
|
+
blockExplorers: {
|
|
2660
|
+
blockscout: { name: "Blockscout", url: <blockscout-url> apiUrl: <blockscout-api-url> };
|
|
2661
|
+
etherscan: { name: "Etherscan", url: <etherscan-url> apiUrl: <etherscan-api-url> };
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
\`\`\`
|
|
2666
|
+
`,
|
|
2667
|
+
},
|
|
2668
|
+
ADDRESS_NOT_A_CONTRACT: {
|
|
2669
|
+
number: 80028,
|
|
2670
|
+
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.`,
|
|
2671
|
+
websiteTitle: "Address is not a contract",
|
|
2672
|
+
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.
|
|
2673
|
+
Please verify the address and network, and try again later if necessary.`,
|
|
2674
|
+
},
|
|
2675
|
+
EXPLORER_API_KEY_EMPTY: {
|
|
2676
|
+
number: 80029,
|
|
2677
|
+
messageTemplate: `The {verificationProvider} API key is empty.`,
|
|
2678
|
+
websiteTitle: "Block explorer API key is empty",
|
|
2679
|
+
websiteDescription: `The provided API key for the block explorer is empty. This can happen in the following cases:
|
|
2680
|
+
|
|
2681
|
+
- No "apiKey" field is configured in the hardhat config.
|
|
2682
|
+
- The "apiKey" is explicitly set to an empty string in the Hardhat config.
|
|
2683
|
+
- The "apiKey" is assigned to a config variable that resolves to an empty string at runtime.
|
|
2684
|
+
|
|
2685
|
+
To resolve this, set a valid non-empty API key in your Hardhat config, then try again.`,
|
|
2686
|
+
},
|
|
2687
|
+
},
|
|
2688
|
+
VALIDATION: {
|
|
2689
|
+
INVALID_ADDRESS: {
|
|
2690
|
+
number: 80100,
|
|
2691
|
+
messageTemplate: `"{value}" is not a valid address`,
|
|
2692
|
+
websiteTitle: "Invalid address",
|
|
2693
|
+
websiteDescription: "The value is not a valid address",
|
|
2694
|
+
},
|
|
2695
|
+
MUTUALLY_EXCLUSIVE_CONSTRUCTOR_ARGS: {
|
|
2696
|
+
number: 80101,
|
|
2697
|
+
messageTemplate:
|
|
2698
|
+
"The parameters constructorArgs and constructorArgsPath are mutually exclusive.",
|
|
2699
|
+
websiteTitle: "Mutually exclusive constructor arguments",
|
|
2700
|
+
websiteDescription:
|
|
2701
|
+
"The parameters constructorArgs and constructorArgsPath are mutually exclusive. Please provide only one of them.",
|
|
2702
|
+
},
|
|
2703
|
+
INVALID_CONSTRUCTOR_ARGS_MODULE_EXPORT: {
|
|
2704
|
+
number: 80102,
|
|
2705
|
+
messageTemplate: `The module specified by "{constructorArgsPath}" must default export an array of constructor arguments.`,
|
|
2706
|
+
websiteTitle: "Invalid constructor arguments module",
|
|
2707
|
+
websiteDescription: `The module specified by the constructorArgsPath parameter must default export an array of constructor arguments.
|
|
2708
|
+
|
|
2709
|
+
Example:
|
|
2710
|
+
|
|
2711
|
+
\`\`\`ts
|
|
2712
|
+
export default ["arg1", "arg2", ...];
|
|
2713
|
+
\`\`\`
|
|
2714
|
+
`,
|
|
2715
|
+
},
|
|
2716
|
+
MODULE_NOT_FOUND: {
|
|
2717
|
+
number: 80103,
|
|
2718
|
+
messageTemplate: `The module specified by "{modulePath}" could not be found.`,
|
|
2719
|
+
websiteTitle: "Module not found",
|
|
2720
|
+
websiteDescription:
|
|
2721
|
+
"The specified module could not be found. Please check the path and try again.",
|
|
2722
|
+
},
|
|
2723
|
+
MODULE_SYNTAX_ERROR: {
|
|
2724
|
+
number: 80104,
|
|
2725
|
+
messageTemplate: `The module specified by "{modulePath}" has a syntax error: {errorMessage}`,
|
|
2726
|
+
websiteTitle: "Module syntax error",
|
|
2727
|
+
websiteDescription:
|
|
2728
|
+
"The specified module has a syntax error. Please fix the error and try again.",
|
|
2729
|
+
},
|
|
2730
|
+
IMPORT_MODULE_FAILED: {
|
|
2731
|
+
number: 80105,
|
|
2732
|
+
messageTemplate: `The module specified by "{modulePath}" could not be imported: {errorMessage}`,
|
|
2733
|
+
websiteTitle: "Import module failed",
|
|
2734
|
+
websiteDescription: "The specified module could not be imported.",
|
|
2735
|
+
},
|
|
2736
|
+
INVALID_LIBRARIES_MODULE_EXPORT: {
|
|
2737
|
+
number: 80106,
|
|
2738
|
+
messageTemplate: `The module specified by "{librariesPath}" must default export a record of libraries.`,
|
|
2739
|
+
websiteTitle: "Invalid libraries module",
|
|
2740
|
+
websiteDescription: `The module specified by the librariesPath parameter must default export a record of libraries.
|
|
2741
|
+
|
|
2742
|
+
Example:
|
|
2743
|
+
|
|
2744
|
+
\`\`\`ts
|
|
2745
|
+
export default { lib1: "0x...", lib2: "0x...", ... };
|
|
2746
|
+
\`\`\``,
|
|
2747
|
+
},
|
|
2748
|
+
INVALID_VERIFICATION_PROVIDER: {
|
|
2749
|
+
number: 80107,
|
|
2750
|
+
messageTemplate: `The verification provider "{verificationProvider}" is not supported. Supported providers are: {supportedVerificationProviders}.`,
|
|
2751
|
+
websiteTitle: "Invalid verification provider",
|
|
2752
|
+
websiteDescription:
|
|
2753
|
+
"The specified verification provider is not supported. Please use one of the supported providers.",
|
|
2754
|
+
},
|
|
2356
2755
|
},
|
|
2357
2756
|
},
|
|
2358
2757
|
} as const;
|