@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/dist/index.mjs CHANGED
@@ -64326,13 +64326,21 @@ var source_default2 = got;
64326
64326
 
64327
64327
  // src/common/etherscan.ts
64328
64328
  var Verification = class extends EventEmitter {
64329
- constructor(props) {
64329
+ constructor(props, logger11) {
64330
64330
  super();
64331
64331
  this.props = props;
64332
+ this.logger = logger11;
64332
64333
  }
64333
64334
  async verify() {
64334
64335
  try {
64336
+ this.logger.verbose(
64337
+ `Submitting verification for ${this.props.contractName} on address ${this.props.address} to ${this.props.apiUrl}`
64338
+ );
64335
64339
  const response = await this.__submit();
64340
+ this.logger.verbose(
64341
+ `Received response for ${this.props.contractName} on address ${this.props.address} to ${this.props.apiUrl}`
64342
+ );
64343
+ this.logger.verbose(JSON.stringify(response));
64336
64344
  if (isAlreadyVerifiedResult(response.result)) {
64337
64345
  return {
64338
64346
  alreadyVerified: true
@@ -64397,7 +64405,7 @@ var Verification = class extends EventEmitter {
64397
64405
  }
64398
64406
  }
64399
64407
  };
64400
- var createVerification = (props) => new Verification(props);
64408
+ var createVerification = (props, logger11) => new Verification(props, logger11);
64401
64409
  var isPendingResult = (result) => !!(result == null ? void 0 : result.match(/Pending/gi));
64402
64410
  var isAlreadyVerifiedResult = (result) => !!(result == null ? void 0 : result.match(/already verified/gi));
64403
64411
  var isApiRateLimitedResult = (result) => !!(result == null ? void 0 : result.match(/rate/));
@@ -67875,25 +67883,26 @@ var verifyTarget = async (config, logger11) => {
67875
67883
  );
67876
67884
  }
67877
67885
  const deployment = deploymentParseResult.data;
67886
+ basename(fileName, ".json");
67878
67887
  const compilationTargets = deployment.metadata.settings.compilationTarget;
67879
67888
  return Object.entries(compilationTargets).flatMap(
67880
- ([compilationTarget, contractName]) => {
67889
+ ([compilationTarget, contractName2]) => {
67881
67890
  var _a;
67882
67891
  const shouldVerifyHardhatDeploy = verify(
67883
- contractName,
67892
+ contractName2,
67884
67893
  compilationTarget,
67885
67894
  networkName
67886
67895
  );
67887
67896
  if (!shouldVerifyHardhatDeploy) {
67888
67897
  logger11.debug(
67889
- `Not verifying ${contractName} in ${fileName} on network ${networkName}`
67898
+ `Not verifying ${contractName2} in ${fileName} on network ${networkName}`
67890
67899
  );
67891
67900
  return [];
67892
67901
  }
67893
67902
  const source = deployment.metadata.sources[compilationTarget];
67894
67903
  if (source == null) {
67895
67904
  logger11.error(
67896
- COLORS.error`Could not find source for ${contractName} (${compilationTarget})`
67905
+ COLORS.error`Could not find source for ${contractName2} (${compilationTarget})`
67897
67906
  );
67898
67907
  return [];
67899
67908
  }
@@ -67907,7 +67916,7 @@ var verifyTarget = async (config, logger11) => {
67907
67916
  apiUrl: networkConfig.apiUrl,
67908
67917
  apiKey: networkConfig.apiKey,
67909
67918
  address: deployment.address,
67910
- contractName: `${compilationTarget}:${contractName}`,
67919
+ contractName: `${compilationTarget}:${contractName2}`,
67911
67920
  constructorArguments,
67912
67921
  licenseType,
67913
67922
  compilerVersion: deployment.metadata.compiler.version,
@@ -67916,7 +67925,7 @@ var verifyTarget = async (config, logger11) => {
67916
67925
  optimizerRuns: (_a = deployment.metadata.settings.optimizer) == null ? void 0 : _a.runs
67917
67926
  };
67918
67927
  recordLogger({
67919
- Contract: contractName,
67928
+ Contract: contractName2,
67920
67929
  Network: networkName,
67921
67930
  Address: deployment.address,
67922
67931
  License: submitProps.licenseType,
@@ -67958,13 +67967,14 @@ var createVerifyAll = (logger11) => (artifacts) => {
67958
67967
  paletteColor`Verifying contract ${contractName} for network ${networkName} ${counter}`
67959
67968
  );
67960
67969
  try {
67961
- const verification = createVerification(submitProps);
67970
+ const verification = createVerification(submitProps, logger11);
67962
67971
  verification.on("poll", (guid) => {
67963
67972
  logger11.info(
67964
67973
  paletteColor`Polling for verification status of ${contractName} for network ${networkName} (GUID ${guid}) ${counter}`
67965
67974
  );
67966
67975
  });
67967
67976
  verification.on("retry", (error, attempt) => {
67977
+ logger11.verbose(`Received an error: ${error}`);
67968
67978
  logger11.info(
67969
67979
  paletteColor`Retrying failed verification attempt of ${contractName} for network ${networkName} (attempt ${attempt + 1}) ${counter}`
67970
67980
  );