@layerzerolabs/verify-contract 1.1.6 → 1.1.7
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/cli/index.js +1 -1
- package/dist/index.js +55 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -67876,7 +67876,6 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67876
67876
|
deploymentAbsolutePath
|
|
67877
67877
|
).filter((fileName) => fileName.endsWith(".json"));
|
|
67878
67878
|
return deployedContractFileNames.flatMap((fileName) => {
|
|
67879
|
-
var _a;
|
|
67880
67879
|
logger11.info(
|
|
67881
67880
|
`Inspecting deployment file ${fileName} on network ${networkName}`
|
|
67882
67881
|
);
|
|
@@ -67892,68 +67891,63 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67892
67891
|
);
|
|
67893
67892
|
}
|
|
67894
67893
|
const deployment = deploymentParseResult.data;
|
|
67895
|
-
const contractName = path.basename(fileName, ".json");
|
|
67896
67894
|
const compilationTargets = deployment.metadata.settings.compilationTarget;
|
|
67897
|
-
|
|
67898
|
-
(
|
|
67899
|
-
|
|
67900
|
-
|
|
67901
|
-
|
|
67902
|
-
|
|
67903
|
-
|
|
67904
|
-
|
|
67905
|
-
|
|
67906
|
-
|
|
67907
|
-
|
|
67908
|
-
|
|
67909
|
-
|
|
67910
|
-
|
|
67911
|
-
|
|
67912
|
-
|
|
67913
|
-
|
|
67914
|
-
|
|
67915
|
-
|
|
67916
|
-
|
|
67917
|
-
|
|
67918
|
-
|
|
67919
|
-
|
|
67920
|
-
|
|
67921
|
-
|
|
67922
|
-
|
|
67923
|
-
|
|
67924
|
-
|
|
67925
|
-
|
|
67926
|
-
|
|
67927
|
-
|
|
67895
|
+
return Object.entries(compilationTargets).flatMap(
|
|
67896
|
+
([compilationTarget, contractName]) => {
|
|
67897
|
+
var _a;
|
|
67898
|
+
const shouldVerifyHardhatDeploy = verify(
|
|
67899
|
+
contractName,
|
|
67900
|
+
compilationTarget,
|
|
67901
|
+
networkName
|
|
67902
|
+
);
|
|
67903
|
+
if (!shouldVerifyHardhatDeploy) {
|
|
67904
|
+
logger11.debug(
|
|
67905
|
+
`Not verifying ${contractName} in ${fileName} on network ${networkName}`
|
|
67906
|
+
);
|
|
67907
|
+
return [];
|
|
67908
|
+
}
|
|
67909
|
+
const source = deployment.metadata.sources[compilationTarget];
|
|
67910
|
+
if (source == null) {
|
|
67911
|
+
logger11.error(
|
|
67912
|
+
COLORS.error`Could not find source for ${contractName} (${compilationTarget})`
|
|
67913
|
+
);
|
|
67914
|
+
return [];
|
|
67915
|
+
}
|
|
67916
|
+
const licenseType = findLicenseType(source.content);
|
|
67917
|
+
const constructorArguments = encodeContructorArguments(
|
|
67918
|
+
deployment.abi,
|
|
67919
|
+
deployment.args
|
|
67920
|
+
);
|
|
67921
|
+
const solcInput = extractSolcInputFromMetadata(deployment.metadata);
|
|
67922
|
+
const submitProps = {
|
|
67923
|
+
apiUrl: networkConfig.apiUrl,
|
|
67924
|
+
apiKey: networkConfig.apiKey,
|
|
67925
|
+
address: deployment.address,
|
|
67926
|
+
contractName: `${compilationTarget}:${contractName}`,
|
|
67927
|
+
constructorArguments,
|
|
67928
|
+
licenseType,
|
|
67929
|
+
compilerVersion: deployment.metadata.compiler.version,
|
|
67930
|
+
sourceCode: JSON.stringify(solcInput),
|
|
67931
|
+
evmVersion: deployment.metadata.settings.evmVersion,
|
|
67932
|
+
optimizerRuns: (_a = deployment.metadata.settings.optimizer) == null ? void 0 : _a.runs
|
|
67933
|
+
};
|
|
67934
|
+
recordLogger({
|
|
67935
|
+
Contract: contractName,
|
|
67936
|
+
Network: networkName,
|
|
67937
|
+
Address: deployment.address,
|
|
67938
|
+
License: submitProps.licenseType,
|
|
67939
|
+
Arguments: JSON.stringify(deployment.args),
|
|
67940
|
+
Sources: Object.keys(deployment.metadata.sources),
|
|
67941
|
+
"Scan URL": submitProps.apiUrl,
|
|
67942
|
+
"Scan API Key": submitProps.apiKey ? anonymizeValue(submitProps.apiKey) : void 0
|
|
67943
|
+
});
|
|
67944
|
+
return {
|
|
67945
|
+
submitProps,
|
|
67946
|
+
networkName,
|
|
67947
|
+
networkConfig
|
|
67948
|
+
};
|
|
67949
|
+
}
|
|
67928
67950
|
);
|
|
67929
|
-
const solcInput = extractSolcInputFromMetadata(deployment.metadata);
|
|
67930
|
-
const submitProps = {
|
|
67931
|
-
apiUrl: networkConfig.apiUrl,
|
|
67932
|
-
apiKey: networkConfig.apiKey,
|
|
67933
|
-
address: deployment.address,
|
|
67934
|
-
contractName: `${compilationTarget}:${contractName}`,
|
|
67935
|
-
constructorArguments,
|
|
67936
|
-
licenseType,
|
|
67937
|
-
compilerVersion: deployment.metadata.compiler.version,
|
|
67938
|
-
sourceCode: JSON.stringify(solcInput),
|
|
67939
|
-
evmVersion: deployment.metadata.settings.evmVersion,
|
|
67940
|
-
optimizerRuns: (_a = deployment.metadata.settings.optimizer) == null ? void 0 : _a.runs
|
|
67941
|
-
};
|
|
67942
|
-
recordLogger({
|
|
67943
|
-
Contract: contractName,
|
|
67944
|
-
Network: networkName,
|
|
67945
|
-
Address: deployment.address,
|
|
67946
|
-
License: submitProps.licenseType,
|
|
67947
|
-
Arguments: JSON.stringify(deployment.args),
|
|
67948
|
-
Sources: Object.keys(deployment.metadata.sources),
|
|
67949
|
-
"Scan URL": submitProps.apiUrl,
|
|
67950
|
-
"Scan API Key": submitProps.apiKey ? anonymizeValue(submitProps.apiKey) : void 0
|
|
67951
|
-
});
|
|
67952
|
-
return {
|
|
67953
|
-
submitProps,
|
|
67954
|
-
networkName,
|
|
67955
|
-
networkConfig
|
|
67956
|
-
};
|
|
67957
67951
|
});
|
|
67958
67952
|
}
|
|
67959
67953
|
);
|