@layerzerolabs/verify-contract 1.4.0 → 1.5.0

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
@@ -65180,6 +65180,11 @@ var networks = {
65180
65180
  apiUrl: ETHERSCAN_V2_URL,
65181
65181
  aliases: ["stable-mainnet"]
65182
65182
  },
65183
+ "stable-testnet": {
65184
+ chainId: 2201,
65185
+ apiUrl: ETHERSCAN_V2_URL,
65186
+ aliases: ["stable-testnet"]
65187
+ },
65183
65188
  // Swellchain
65184
65189
  swellchain: {
65185
65190
  chainId: 1923,
@@ -65236,6 +65241,11 @@ var networks = {
65236
65241
  },
65237
65242
  // Non-Etherscan Networks (custom explorers)
65238
65243
  // chainId is not used for these networks
65244
+ // Codex
65245
+ codex: {
65246
+ chainId: 81224,
65247
+ apiUrl: "https://explorer.codex.xyz/"
65248
+ },
65239
65249
  // Astar
65240
65250
  astar: {
65241
65251
  chainId: 0,
@@ -77882,7 +77892,7 @@ var Interface = class {
77882
77892
 
77883
77893
  // src/common/abi.ts
77884
77894
  var parser = __toESM(require_index_cjs());
77885
- var encodeContructorArguments = (abi, args) => {
77895
+ var encodeConstructorArguments = (abi, args) => {
77886
77896
  if (args == null || args.length === 0) {
77887
77897
  return void 0;
77888
77898
  }
@@ -77890,7 +77900,7 @@ var encodeContructorArguments = (abi, args) => {
77890
77900
  const encodedConstructorArguments = iface.encodeDeploy(args);
77891
77901
  return encodedConstructorArguments.slice(2);
77892
77902
  };
77893
- var getContructorABIFromSource = (source) => {
77903
+ var getConstructorABIFromSource = (source) => {
77894
77904
  try {
77895
77905
  const ast = parser.parse(source);
77896
77906
  let constructorDefinition;
@@ -78021,7 +78031,10 @@ var verifyNonTarget = async (config, logger12) => {
78021
78031
  // If the constructor arguments are passed encoded we pass them directly
78022
78032
  typeof contract.constructorArguments === "string" ? contract.constructorArguments : (
78023
78033
  // For decoded constructor arguments we'll need to try and encoded them using the contract source
78024
- encodeContructorArguments(getContructorABIFromSource(source.content), contract.constructorArguments)
78034
+ encodeConstructorArguments(
78035
+ getConstructorABIFromSource(source.content),
78036
+ contract.constructorArguments
78037
+ )
78025
78038
  )
78026
78039
  )
78027
78040
  );
@@ -78122,7 +78135,20 @@ var verifyTarget = async (config, logger12) => {
78122
78135
  return [];
78123
78136
  }
78124
78137
  const licenseType = findLicenseType(source.content);
78125
- const constructorArguments = encodeContructorArguments(deployment.abi, deployment.args);
78138
+ let constructorArguments;
78139
+ try {
78140
+ constructorArguments = encodeConstructorArguments(deployment.abi, deployment.args);
78141
+ } catch (error) {
78142
+ try {
78143
+ const sourceBasedAbi = getConstructorABIFromSource(source.content);
78144
+ constructorArguments = encodeConstructorArguments(sourceBasedAbi, deployment.args);
78145
+ } catch (sourceError) {
78146
+ logger12.warn(
78147
+ `Skipping contract ${contractName} in ${fileName} on network ${networkName} due to constructor encoding error: ${error}. Tried fallback to source-based extraction but that also failed: ${sourceError}`
78148
+ );
78149
+ return [];
78150
+ }
78151
+ }
78126
78152
  const solcInput = extractSolcInputFromMetadata(deployment.metadata);
78127
78153
  const submitProps = {
78128
78154
  apiUrl: networkConfig.apiUrl,