@layerzerolabs/verify-contract 1.1.7 → 1.1.8
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 +19 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -64342,13 +64342,21 @@ var source_default2 = got;
|
|
|
64342
64342
|
|
|
64343
64343
|
// src/common/etherscan.ts
|
|
64344
64344
|
var Verification = class extends EventEmitter__default.default {
|
|
64345
|
-
constructor(props) {
|
|
64345
|
+
constructor(props, logger11) {
|
|
64346
64346
|
super();
|
|
64347
64347
|
this.props = props;
|
|
64348
|
+
this.logger = logger11;
|
|
64348
64349
|
}
|
|
64349
64350
|
async verify() {
|
|
64350
64351
|
try {
|
|
64352
|
+
this.logger.verbose(
|
|
64353
|
+
`Submitting verification for ${this.props.contractName} on address ${this.props.address} to ${this.props.apiUrl}`
|
|
64354
|
+
);
|
|
64351
64355
|
const response = await this.__submit();
|
|
64356
|
+
this.logger.verbose(
|
|
64357
|
+
`Received response for ${this.props.contractName} on address ${this.props.address} to ${this.props.apiUrl}`
|
|
64358
|
+
);
|
|
64359
|
+
this.logger.verbose(JSON.stringify(response));
|
|
64352
64360
|
if (isAlreadyVerifiedResult(response.result)) {
|
|
64353
64361
|
return {
|
|
64354
64362
|
alreadyVerified: true
|
|
@@ -64413,7 +64421,7 @@ var Verification = class extends EventEmitter__default.default {
|
|
|
64413
64421
|
}
|
|
64414
64422
|
}
|
|
64415
64423
|
};
|
|
64416
|
-
var createVerification = (props) => new Verification(props);
|
|
64424
|
+
var createVerification = (props, logger11) => new Verification(props, logger11);
|
|
64417
64425
|
var isPendingResult = (result) => !!(result == null ? void 0 : result.match(/Pending/gi));
|
|
64418
64426
|
var isAlreadyVerifiedResult = (result) => !!(result == null ? void 0 : result.match(/already verified/gi));
|
|
64419
64427
|
var isApiRateLimitedResult = (result) => !!(result == null ? void 0 : result.match(/rate/));
|
|
@@ -67891,25 +67899,26 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67891
67899
|
);
|
|
67892
67900
|
}
|
|
67893
67901
|
const deployment = deploymentParseResult.data;
|
|
67902
|
+
path.basename(fileName, ".json");
|
|
67894
67903
|
const compilationTargets = deployment.metadata.settings.compilationTarget;
|
|
67895
67904
|
return Object.entries(compilationTargets).flatMap(
|
|
67896
|
-
([compilationTarget,
|
|
67905
|
+
([compilationTarget, contractName2]) => {
|
|
67897
67906
|
var _a;
|
|
67898
67907
|
const shouldVerifyHardhatDeploy = verify(
|
|
67899
|
-
|
|
67908
|
+
contractName2,
|
|
67900
67909
|
compilationTarget,
|
|
67901
67910
|
networkName
|
|
67902
67911
|
);
|
|
67903
67912
|
if (!shouldVerifyHardhatDeploy) {
|
|
67904
67913
|
logger11.debug(
|
|
67905
|
-
`Not verifying ${
|
|
67914
|
+
`Not verifying ${contractName2} in ${fileName} on network ${networkName}`
|
|
67906
67915
|
);
|
|
67907
67916
|
return [];
|
|
67908
67917
|
}
|
|
67909
67918
|
const source = deployment.metadata.sources[compilationTarget];
|
|
67910
67919
|
if (source == null) {
|
|
67911
67920
|
logger11.error(
|
|
67912
|
-
COLORS.error`Could not find source for ${
|
|
67921
|
+
COLORS.error`Could not find source for ${contractName2} (${compilationTarget})`
|
|
67913
67922
|
);
|
|
67914
67923
|
return [];
|
|
67915
67924
|
}
|
|
@@ -67923,7 +67932,7 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67923
67932
|
apiUrl: networkConfig.apiUrl,
|
|
67924
67933
|
apiKey: networkConfig.apiKey,
|
|
67925
67934
|
address: deployment.address,
|
|
67926
|
-
contractName: `${compilationTarget}:${
|
|
67935
|
+
contractName: `${compilationTarget}:${contractName2}`,
|
|
67927
67936
|
constructorArguments,
|
|
67928
67937
|
licenseType,
|
|
67929
67938
|
compilerVersion: deployment.metadata.compiler.version,
|
|
@@ -67932,7 +67941,7 @@ var verifyTarget = async (config, logger11) => {
|
|
|
67932
67941
|
optimizerRuns: (_a = deployment.metadata.settings.optimizer) == null ? void 0 : _a.runs
|
|
67933
67942
|
};
|
|
67934
67943
|
recordLogger({
|
|
67935
|
-
Contract:
|
|
67944
|
+
Contract: contractName2,
|
|
67936
67945
|
Network: networkName,
|
|
67937
67946
|
Address: deployment.address,
|
|
67938
67947
|
License: submitProps.licenseType,
|
|
@@ -67974,13 +67983,14 @@ var createVerifyAll = (logger11) => (artifacts) => {
|
|
|
67974
67983
|
paletteColor`Verifying contract ${contractName} for network ${networkName} ${counter}`
|
|
67975
67984
|
);
|
|
67976
67985
|
try {
|
|
67977
|
-
const verification = createVerification(submitProps);
|
|
67986
|
+
const verification = createVerification(submitProps, logger11);
|
|
67978
67987
|
verification.on("poll", (guid) => {
|
|
67979
67988
|
logger11.info(
|
|
67980
67989
|
paletteColor`Polling for verification status of ${contractName} for network ${networkName} (GUID ${guid}) ${counter}`
|
|
67981
67990
|
);
|
|
67982
67991
|
});
|
|
67983
67992
|
verification.on("retry", (error, attempt) => {
|
|
67993
|
+
logger11.verbose(`Received an error: ${error}`);
|
|
67984
67994
|
logger11.info(
|
|
67985
67995
|
paletteColor`Retrying failed verification attempt of ${contractName} for network ${networkName} (attempt ${attempt + 1}) ${counter}`
|
|
67986
67996
|
);
|