@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.mjs
CHANGED
|
@@ -67860,7 +67860,6 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67860
67860
|
deploymentAbsolutePath
|
|
67861
67861
|
).filter((fileName) => fileName.endsWith(".json"));
|
|
67862
67862
|
return deployedContractFileNames.flatMap((fileName) => {
|
|
67863
|
-
var _a;
|
|
67864
67863
|
logger11.info(
|
|
67865
67864
|
`Inspecting deployment file ${fileName} on network ${networkName}`
|
|
67866
67865
|
);
|
|
@@ -67876,68 +67875,63 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67876
67875
|
);
|
|
67877
67876
|
}
|
|
67878
67877
|
const deployment = deploymentParseResult.data;
|
|
67879
|
-
const contractName = basename(fileName, ".json");
|
|
67880
67878
|
const compilationTargets = deployment.metadata.settings.compilationTarget;
|
|
67881
|
-
|
|
67882
|
-
(
|
|
67883
|
-
|
|
67884
|
-
|
|
67885
|
-
|
|
67886
|
-
|
|
67887
|
-
|
|
67888
|
-
|
|
67889
|
-
|
|
67890
|
-
|
|
67891
|
-
|
|
67892
|
-
|
|
67893
|
-
|
|
67894
|
-
|
|
67895
|
-
|
|
67896
|
-
|
|
67897
|
-
|
|
67898
|
-
|
|
67899
|
-
|
|
67900
|
-
|
|
67901
|
-
|
|
67902
|
-
|
|
67903
|
-
|
|
67904
|
-
|
|
67905
|
-
|
|
67906
|
-
|
|
67907
|
-
|
|
67908
|
-
|
|
67909
|
-
|
|
67910
|
-
|
|
67911
|
-
|
|
67879
|
+
return Object.entries(compilationTargets).flatMap(
|
|
67880
|
+
([compilationTarget, contractName]) => {
|
|
67881
|
+
var _a;
|
|
67882
|
+
const shouldVerifyHardhatDeploy = verify(
|
|
67883
|
+
contractName,
|
|
67884
|
+
compilationTarget,
|
|
67885
|
+
networkName
|
|
67886
|
+
);
|
|
67887
|
+
if (!shouldVerifyHardhatDeploy) {
|
|
67888
|
+
logger11.debug(
|
|
67889
|
+
`Not verifying ${contractName} in ${fileName} on network ${networkName}`
|
|
67890
|
+
);
|
|
67891
|
+
return [];
|
|
67892
|
+
}
|
|
67893
|
+
const source = deployment.metadata.sources[compilationTarget];
|
|
67894
|
+
if (source == null) {
|
|
67895
|
+
logger11.error(
|
|
67896
|
+
COLORS.error`Could not find source for ${contractName} (${compilationTarget})`
|
|
67897
|
+
);
|
|
67898
|
+
return [];
|
|
67899
|
+
}
|
|
67900
|
+
const licenseType = findLicenseType(source.content);
|
|
67901
|
+
const constructorArguments = encodeContructorArguments(
|
|
67902
|
+
deployment.abi,
|
|
67903
|
+
deployment.args
|
|
67904
|
+
);
|
|
67905
|
+
const solcInput = extractSolcInputFromMetadata(deployment.metadata);
|
|
67906
|
+
const submitProps = {
|
|
67907
|
+
apiUrl: networkConfig.apiUrl,
|
|
67908
|
+
apiKey: networkConfig.apiKey,
|
|
67909
|
+
address: deployment.address,
|
|
67910
|
+
contractName: `${compilationTarget}:${contractName}`,
|
|
67911
|
+
constructorArguments,
|
|
67912
|
+
licenseType,
|
|
67913
|
+
compilerVersion: deployment.metadata.compiler.version,
|
|
67914
|
+
sourceCode: JSON.stringify(solcInput),
|
|
67915
|
+
evmVersion: deployment.metadata.settings.evmVersion,
|
|
67916
|
+
optimizerRuns: (_a = deployment.metadata.settings.optimizer) == null ? void 0 : _a.runs
|
|
67917
|
+
};
|
|
67918
|
+
recordLogger({
|
|
67919
|
+
Contract: contractName,
|
|
67920
|
+
Network: networkName,
|
|
67921
|
+
Address: deployment.address,
|
|
67922
|
+
License: submitProps.licenseType,
|
|
67923
|
+
Arguments: JSON.stringify(deployment.args),
|
|
67924
|
+
Sources: Object.keys(deployment.metadata.sources),
|
|
67925
|
+
"Scan URL": submitProps.apiUrl,
|
|
67926
|
+
"Scan API Key": submitProps.apiKey ? anonymizeValue(submitProps.apiKey) : void 0
|
|
67927
|
+
});
|
|
67928
|
+
return {
|
|
67929
|
+
submitProps,
|
|
67930
|
+
networkName,
|
|
67931
|
+
networkConfig
|
|
67932
|
+
};
|
|
67933
|
+
}
|
|
67912
67934
|
);
|
|
67913
|
-
const solcInput = extractSolcInputFromMetadata(deployment.metadata);
|
|
67914
|
-
const submitProps = {
|
|
67915
|
-
apiUrl: networkConfig.apiUrl,
|
|
67916
|
-
apiKey: networkConfig.apiKey,
|
|
67917
|
-
address: deployment.address,
|
|
67918
|
-
contractName: `${compilationTarget}:${contractName}`,
|
|
67919
|
-
constructorArguments,
|
|
67920
|
-
licenseType,
|
|
67921
|
-
compilerVersion: deployment.metadata.compiler.version,
|
|
67922
|
-
sourceCode: JSON.stringify(solcInput),
|
|
67923
|
-
evmVersion: deployment.metadata.settings.evmVersion,
|
|
67924
|
-
optimizerRuns: (_a = deployment.metadata.settings.optimizer) == null ? void 0 : _a.runs
|
|
67925
|
-
};
|
|
67926
|
-
recordLogger({
|
|
67927
|
-
Contract: contractName,
|
|
67928
|
-
Network: networkName,
|
|
67929
|
-
Address: deployment.address,
|
|
67930
|
-
License: submitProps.licenseType,
|
|
67931
|
-
Arguments: JSON.stringify(deployment.args),
|
|
67932
|
-
Sources: Object.keys(deployment.metadata.sources),
|
|
67933
|
-
"Scan URL": submitProps.apiUrl,
|
|
67934
|
-
"Scan API Key": submitProps.apiKey ? anonymizeValue(submitProps.apiKey) : void 0
|
|
67935
|
-
});
|
|
67936
|
-
return {
|
|
67937
|
-
submitProps,
|
|
67938
|
-
networkName,
|
|
67939
|
-
networkConfig
|
|
67940
|
-
};
|
|
67941
67935
|
});
|
|
67942
67936
|
}
|
|
67943
67937
|
);
|