@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
26 lines (25 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = require("@repo/config");
const helpers_1 = require("../../../helpers");
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(`Upgrading XAllocationVoting contract at address: ${config.xAllocationVotingContractAddress} on network: ${config.network.name}`);
const xAllocationVotingV5 = (await (0, helpers_1.upgradeProxy)("XAllocationVotingV4", "XAllocationVotingV5", config.xAllocationVotingContractAddress, [], {
version: 5,
}));
console.log(`XAllocationVoting upgraded`);
// check that upgrade was successful
const version = await xAllocationVotingV5.version();
console.log(`New XAllocationVoting version: ${version}`);
if (parseInt(version) !== 5) {
throw new Error(`XAllocationVoting version is not 5: ${version}`);
}
console.log("Execution completed");
process.exit(0);
}
// Execute the main function
main();