UNPKG

@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) 996 B
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 GrantsManager contract at address: ${config.grantsManagerContractAddress} on network: ${config.network.name}`); const grantsManager = (await upgradeProxy("GrantsManagerV2", "GrantsManager", config.grantsManagerContractAddress, [], { version: 3, })); console.log(`GrantsManager upgraded`); // check that upgrade was successful const version = await grantsManager.version(); console.log(`New GrantsManager version: ${version}`); if (BigInt(version) !== 3n) { throw new Error(`GrantsManager version is not the expected one: ${version}`); } console.log("Execution completed"); process.exit(0); } // Execute the main function main();