UNPKG

@vechain/vebetterdao-contracts

Version:

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

29 lines (28 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const config_1 = require("@repo/config"); const helpers_1 = require("../../../helpers"); const hardhat_1 = require("hardhat"); async function main() { if (!process.env.NEXT_PUBLIC_APP_ENV) { throw new Error("Missing NEXT_PUBLIC_APP_ENV"); } const config = (0, config_1.getConfig)(process.env.NEXT_PUBLIC_APP_ENV); console.log("Hardhat network name:", hardhat_1.network.name); console.log(`Upgrading GalaxyMember contract at address: ${config.galaxyMemberContractAddress} on network: ${config.network.name}`); console.log(`StargateNFT contract address: ${config.stargateNFTContractAddress}`); const galaxyMemberV6 = (await (0, helpers_1.upgradeProxy)("GalaxyMemberV5", "GalaxyMember", config.galaxyMemberContractAddress, [config.stargateNFTContractAddress], { version: 6, })); console.log(`GalaxyMember upgraded`); // check that upgrade was successful const version = await galaxyMemberV6.version(); console.log(`New GalaxyMember version: ${version}`); if (parseInt(version) !== 6) { throw new Error(`GalaxyMember version is not 6: ${version}`); } console.log("Execution completed"); process.exit(0); } // Execute the main function main();