@layerzerolabs/verify-contract 1.1.9 → 1.1.11

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.js CHANGED
@@ -44517,8 +44517,9 @@ var getDefaultScanApiUrl = (networkName) => DEFAULT_SCAN_API_URLS.get(networkNam
44517
44517
  var tryGetScanBrowserUrlFromScanUrl = (scanApiUrl) => {
44518
44518
  try {
44519
44519
  const urlObject = new URL(scanApiUrl);
44520
- if (!urlObject.hostname.startsWith("api.") && !urlObject.hostname.startsWith("api-"))
44520
+ if (!urlObject.hostname.startsWith("api.") && !urlObject.hostname.startsWith("api-")) {
44521
44521
  return void 0;
44522
+ }
44522
44523
  urlObject.hostname = urlObject.hostname.replace(/^api[.-]/, "");
44523
44524
  urlObject.pathname = "/";
44524
44525
  return urlObject.toString();
@@ -44607,8 +44608,9 @@ var createRecordLogger = (logger11, separator = " ") => (record) => {
44607
44608
  });
44608
44609
  };
44609
44610
  var formatLoggableValue = (value) => {
44610
- if (value == null)
44611
+ if (value == null) {
44611
44612
  return "-";
44613
+ }
44612
44614
  switch (typeof value) {
44613
44615
  case "boolean":
44614
44616
  return value ? TRUE_SYMBOL : FALSE_SYMBOL;
@@ -44623,8 +44625,9 @@ var FALSE_SYMBOL = COLORS.error`⚠`;
44623
44625
  var import_chalk2 = __toESM(require_source());
44624
44626
  var parseNetworksConfig = (logger11, partialNetworksConfig) => {
44625
44627
  return Object.entries(partialNetworksConfig != null ? partialNetworksConfig : {}).reduce((networksConfig, [networkName, networkConfig]) => {
44626
- if (networkConfig == null)
44628
+ if (networkConfig == null) {
44627
44629
  return networksConfig;
44630
+ }
44628
44631
  const apiUrl = networkConfig.apiUrl || getScanApiUrlFromEnv(networkName) || getDefaultScanApiUrl(networkName);
44629
44632
  assert4__default.default(
44630
44633
  apiUrl,
@@ -44701,8 +44704,9 @@ var LicenseType = /* @__PURE__ */ ((LicenseType2) => {
44701
44704
  var findLicenseType = (sourceCode) => {
44702
44705
  const matches = sourceCode.match(/\/\/\s*SPDX-License-Identifier:\s*(.*)\s*/i);
44703
44706
  const licenseName = matches == null ? void 0 : matches[1];
44704
- if (licenseName == null)
44707
+ if (licenseName == null) {
44705
44708
  return 1 /* None */;
44709
+ }
44706
44710
  if (!(licenseName in LicenseType)) {
44707
44711
  console.warn("Found unknown SPDX license identifier: %s", licenseName);
44708
44712
  }
@@ -53697,14 +53701,16 @@ ${JSON.stringify(response)}`);
53697
53701
  this.logger.verbose(`Received raw polling response from ${this.props.apiUrl}:
53698
53702
 
53699
53703
  ${JSON.stringify(result)}`);
53700
- if (result.status === 1)
53704
+ if (result.status === 1) {
53701
53705
  return {
53702
53706
  alreadyVerified: false
53703
53707
  };
53704
- if (isAlreadyVerifiedResult(result.result))
53708
+ }
53709
+ if (isAlreadyVerifiedResult(result.result)) {
53705
53710
  return {
53706
53711
  alreadyVerified: true
53707
53712
  };
53713
+ }
53708
53714
  if (isPendingResult(result.result)) {
53709
53715
  await sleep(1e4);
53710
53716
  continue;
@@ -53770,16 +53776,21 @@ var createVerificationRequest = ({
53770
53776
  optimizationUsed: optimizerRuns > 0 ? "1" : "0",
53771
53777
  sourceCode
53772
53778
  };
53773
- if (apiKey != null)
53779
+ if (apiKey != null) {
53774
53780
  request.apikey = apiKey;
53775
- if (optimizerRuns != null)
53781
+ }
53782
+ if (optimizerRuns != null) {
53776
53783
  request.runs = String(optimizerRuns);
53777
- if (constructorArguments != null)
53784
+ }
53785
+ if (constructorArguments != null) {
53778
53786
  request.constructorArguements = constructorArguments;
53779
- if (evmVersion != null)
53787
+ }
53788
+ if (evmVersion != null) {
53780
53789
  request.evmversion = evmVersion;
53781
- if (licenseType != null)
53790
+ }
53791
+ if (licenseType != null) {
53782
53792
  request.licenseType = String(licenseType);
53793
+ }
53783
53794
  return request;
53784
53795
  };
53785
53796
  var ScanResponseSchema = z.object({
@@ -56952,8 +56963,9 @@ var Interface = class {
56952
56963
  // src/common/abi.ts
56953
56964
  var parser = __toESM(require_index_cjs());
56954
56965
  var encodeContructorArguments = (abi, args) => {
56955
- if (args == null || args.length === 0)
56966
+ if (args == null || args.length === 0) {
56956
56967
  return void 0;
56968
+ }
56957
56969
  const iface = new Interface(abi);
56958
56970
  const encodedConstructorArguments = iface.encodeDeploy(args);
56959
56971
  return encodedConstructorArguments.slice(2);
@@ -56964,8 +56976,9 @@ var getContructorABIFromSource = (source) => {
56964
56976
  let constructorDefinition;
56965
56977
  parser.visit(ast, {
56966
56978
  FunctionDefinition: (node) => {
56967
- if (node.isConstructor)
56979
+ if (node.isConstructor) {
56968
56980
  constructorDefinition = node;
56981
+ }
56969
56982
  }
56970
56983
  });
56971
56984
  assert4__default.default(constructorDefinition != null, `Could not find constructor definition`);
@@ -57002,8 +57015,9 @@ var parsePathsConfig = (partialPathsConfig) => {
57002
57015
  };
57003
57016
  };
57004
57017
  var parseFilterConfig = (filterConfig) => {
57005
- if (filterConfig == null)
57018
+ if (filterConfig == null) {
57006
57019
  return () => true;
57020
+ }
57007
57021
  switch (typeof filterConfig) {
57008
57022
  case "boolean":
57009
57023
  return () => filterConfig;