@layerzerolabs/verify-contract 1.1.10 → 1.1.12

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
@@ -44501,8 +44501,9 @@ var getDefaultScanApiUrl = (networkName) => DEFAULT_SCAN_API_URLS.get(networkNam
44501
44501
  var tryGetScanBrowserUrlFromScanUrl = (scanApiUrl) => {
44502
44502
  try {
44503
44503
  const urlObject = new URL(scanApiUrl);
44504
- if (!urlObject.hostname.startsWith("api.") && !urlObject.hostname.startsWith("api-"))
44504
+ if (!urlObject.hostname.startsWith("api.") && !urlObject.hostname.startsWith("api-")) {
44505
44505
  return void 0;
44506
+ }
44506
44507
  urlObject.hostname = urlObject.hostname.replace(/^api[.-]/, "");
44507
44508
  urlObject.pathname = "/";
44508
44509
  return urlObject.toString();
@@ -44551,7 +44552,12 @@ var DEFAULT_SCAN_API_URLS = /* @__PURE__ */ new Map([
44551
44552
  ["zkconsensys", "https://api.lineascan.build/api"],
44552
44553
  ["zkconsensys-mainnet", "https://api.lineascan.build/api"],
44553
44554
  ["moonbeam", "https://api-moonbeam.moonscan.io/api"],
44554
- ["moonbeam-testnet", "https://api-moonbase.moonscan.io/api"]
44555
+ ["moonbeam-testnet", "https://api-moonbase.moonscan.io/api"],
44556
+ ["mantle", "https://explorer.mantle.xyz/api"],
44557
+ ["metis", "https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan"],
44558
+ ["scroll", "https://api.scrollscan.com/api"],
44559
+ ["fraxtal", "https://api.fraxscan.com/api"],
44560
+ ["mode", "https://explorer.mode.network/api"]
44555
44561
  ]);
44556
44562
 
44557
44563
  // src/common/logger.ts
@@ -44591,8 +44597,9 @@ var createRecordLogger = (logger11, separator = " ") => (record) => {
44591
44597
  });
44592
44598
  };
44593
44599
  var formatLoggableValue = (value) => {
44594
- if (value == null)
44600
+ if (value == null) {
44595
44601
  return "-";
44602
+ }
44596
44603
  switch (typeof value) {
44597
44604
  case "boolean":
44598
44605
  return value ? TRUE_SYMBOL : FALSE_SYMBOL;
@@ -44607,8 +44614,9 @@ var FALSE_SYMBOL = COLORS.error`⚠`;
44607
44614
  var import_chalk2 = __toESM(require_source());
44608
44615
  var parseNetworksConfig = (logger11, partialNetworksConfig) => {
44609
44616
  return Object.entries(partialNetworksConfig != null ? partialNetworksConfig : {}).reduce((networksConfig, [networkName, networkConfig]) => {
44610
- if (networkConfig == null)
44617
+ if (networkConfig == null) {
44611
44618
  return networksConfig;
44619
+ }
44612
44620
  const apiUrl = networkConfig.apiUrl || getScanApiUrlFromEnv(networkName) || getDefaultScanApiUrl(networkName);
44613
44621
  assert4(
44614
44622
  apiUrl,
@@ -44685,8 +44693,9 @@ var LicenseType = /* @__PURE__ */ ((LicenseType2) => {
44685
44693
  var findLicenseType = (sourceCode) => {
44686
44694
  const matches = sourceCode.match(/\/\/\s*SPDX-License-Identifier:\s*(.*)\s*/i);
44687
44695
  const licenseName = matches == null ? void 0 : matches[1];
44688
- if (licenseName == null)
44696
+ if (licenseName == null) {
44689
44697
  return 1 /* None */;
44698
+ }
44690
44699
  if (!(licenseName in LicenseType)) {
44691
44700
  console.warn("Found unknown SPDX license identifier: %s", licenseName);
44692
44701
  }
@@ -53681,14 +53690,16 @@ ${JSON.stringify(response)}`);
53681
53690
  this.logger.verbose(`Received raw polling response from ${this.props.apiUrl}:
53682
53691
 
53683
53692
  ${JSON.stringify(result)}`);
53684
- if (result.status === 1)
53693
+ if (result.status === 1) {
53685
53694
  return {
53686
53695
  alreadyVerified: false
53687
53696
  };
53688
- if (isAlreadyVerifiedResult(result.result))
53697
+ }
53698
+ if (isAlreadyVerifiedResult(result.result)) {
53689
53699
  return {
53690
53700
  alreadyVerified: true
53691
53701
  };
53702
+ }
53692
53703
  if (isPendingResult(result.result)) {
53693
53704
  await sleep(1e4);
53694
53705
  continue;
@@ -53754,16 +53765,21 @@ var createVerificationRequest = ({
53754
53765
  optimizationUsed: optimizerRuns > 0 ? "1" : "0",
53755
53766
  sourceCode
53756
53767
  };
53757
- if (apiKey != null)
53768
+ if (apiKey != null) {
53758
53769
  request.apikey = apiKey;
53759
- if (optimizerRuns != null)
53770
+ }
53771
+ if (optimizerRuns != null) {
53760
53772
  request.runs = String(optimizerRuns);
53761
- if (constructorArguments != null)
53773
+ }
53774
+ if (constructorArguments != null) {
53762
53775
  request.constructorArguements = constructorArguments;
53763
- if (evmVersion != null)
53776
+ }
53777
+ if (evmVersion != null) {
53764
53778
  request.evmversion = evmVersion;
53765
- if (licenseType != null)
53779
+ }
53780
+ if (licenseType != null) {
53766
53781
  request.licenseType = String(licenseType);
53782
+ }
53767
53783
  return request;
53768
53784
  };
53769
53785
  var ScanResponseSchema = z.object({
@@ -56936,8 +56952,9 @@ var Interface = class {
56936
56952
  // src/common/abi.ts
56937
56953
  var parser = __toESM(require_index_cjs());
56938
56954
  var encodeContructorArguments = (abi, args) => {
56939
- if (args == null || args.length === 0)
56955
+ if (args == null || args.length === 0) {
56940
56956
  return void 0;
56957
+ }
56941
56958
  const iface = new Interface(abi);
56942
56959
  const encodedConstructorArguments = iface.encodeDeploy(args);
56943
56960
  return encodedConstructorArguments.slice(2);
@@ -56948,8 +56965,9 @@ var getContructorABIFromSource = (source) => {
56948
56965
  let constructorDefinition;
56949
56966
  parser.visit(ast, {
56950
56967
  FunctionDefinition: (node) => {
56951
- if (node.isConstructor)
56968
+ if (node.isConstructor) {
56952
56969
  constructorDefinition = node;
56970
+ }
56953
56971
  }
56954
56972
  });
56955
56973
  assert4(constructorDefinition != null, `Could not find constructor definition`);
@@ -56986,8 +57004,9 @@ var parsePathsConfig = (partialPathsConfig) => {
56986
57004
  };
56987
57005
  };
56988
57006
  var parseFilterConfig = (filterConfig) => {
56989
- if (filterConfig == null)
57007
+ if (filterConfig == null) {
56990
57008
  return () => true;
57009
+ }
56991
57010
  switch (typeof filterConfig) {
56992
57011
  case "boolean":
56993
57012
  return () => filterConfig;