@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
24 lines (23 loc) • 1.05 kB
JavaScript
import { getConfig } from "@repo/config";
import { upgradeProxy } from "../../../helpers";
async function main() {
if (!process.env.NEXT_PUBLIC_APP_ENV) {
throw new Error("Missing NEXT_PUBLIC_APP_ENV");
}
const config = getConfig(process.env.NEXT_PUBLIC_APP_ENV);
console.log(`Upgrading XAllocationVoting contract at address: ${config.xAllocationVotingContractAddress} on network: ${config.network.name}`);
const xAllocationVotingV6 = (await upgradeProxy("XAllocationVotingV6", "XAllocationVotingV7", config.xAllocationVotingContractAddress, [config.b3trGovernorAddress], {
version: 7,
}));
console.log(`XAllocationVoting upgraded`);
// check that upgrade was successful
const version = await xAllocationVotingV6.version();
console.log(`New XAllocationVoting version: ${version}`);
if (parseInt(version) !== 7) {
throw new Error(`XAllocationVoting version is not 7: ${version}`);
}
console.log("Execution completed");
process.exit(0);
}
// Execute the main function
main();