UNPKG

@vechain/vebetterdao-contracts

Version:

Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.

50 lines (49 loc) 2.43 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const config_1 = require("@repo/config"); const hardhat_1 = require("hardhat"); const verify_utils_1 = require("./verify-utils"); async function main() { if (!process.env.NEXT_PUBLIC_APP_ENV) { throw new Error("Missing NEXT_PUBLIC_APP_ENV environment variable"); } const config = (0, config_1.getConfig)(process.env.NEXT_PUBLIC_APP_ENV); const network = await hardhat_1.ethers.provider.getNetwork(); console.log(`\n${config.network.name} (Chain ID: ${network.chainId})\n`); const contracts = (0, verify_utils_1.getAllContracts)(config); const contractsInfo = []; console.log("Checking verification status...\n"); for (const contract of contracts) { const implementation = await (0, verify_utils_1.getImplementationAddress)(contract.proxy); const libraryAddresses = await (0, verify_utils_1.getLibraryAddresses)(contract.name, implementation); const status = await (0, verify_utils_1.getVerificationStatus)(contract.proxy, implementation, libraryAddresses, network.chainId); contractsInfo.push({ Contract: contract.name, Proxy: contract.proxy, Implementation: implementation || "Not found", Libraries: (0, verify_utils_1.hasLibraries)(contract.name), Status: status, }); } console.table(contractsInfo); const failed = contractsInfo.filter(c => c.Implementation === "Not found").length; const fullyVerified = contractsInfo.filter(c => c.Status === "Fully Verified").length; const partiallyVerified = contractsInfo.filter(c => c.Status === "Partially Verified").length; const notVerified = contractsInfo.filter(c => c.Status === "Not Verified").length; console.log(`\n${"=".repeat(80)}`); console.log("SUMMARY"); console.log("=".repeat(80)); console.log(`Total Contracts: ${contractsInfo.length}`); console.log(`Implementations Found: ${contractsInfo.length - failed}/${contractsInfo.length}`); console.log(`Fully Verified: ${fullyVerified}`); console.log(`Partially Verified: ${partiallyVerified}`); console.log(`Not Verified: ${notVerified}`); console.log("=".repeat(80) + "\n"); if (failed > 0 || notVerified > 0) { process.exit(1); } } main().catch(error => { console.error("Error:", error.message); process.exit(1); });