UNPKG

@vechain/vebetterdao-contracts

Version:

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

32 lines (31 loc) 1.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @deprecated Superseded by `relayer-rewards-pool-v3.ts`. * Upgrades proxies from RelayerRewardsPoolV1 (version "1") to RelayerRewardsPoolV2 (version "2"). * After this, run `relayer-rewards-pool-v3.ts` to reach version "3". */ 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); const deployer = (await hardhat_1.ethers.getSigners())[0]; const relayerRewardsPoolV1 = await hardhat_1.ethers.getContractAt("RelayerRewardsPoolV1", config.relayerRewardsPoolContractAddress); const currentVersion = await relayerRewardsPoolV1.version(); console.log("Current contract version:", currentVersion); console.log(`Upgrading RelayerRewardsPool V1 → V2 at ${config.relayerRewardsPoolContractAddress} on ${config.network.name} with ${deployer.address}`); const relayerRewardsPoolV2 = (await (0, helpers_1.upgradeProxy)("RelayerRewardsPoolV1", "RelayerRewardsPoolV2", config.relayerRewardsPoolContractAddress, [], { version: 2 })); console.log("RelayerRewardsPool upgraded to V2"); const version = await relayerRewardsPoolV2.version(); console.log(`New RelayerRewardsPool version: ${version}`); if (version !== "2") { throw new Error(`RelayerRewardsPool version is not 2: ${version}`); } console.log("Execution completed — now run relayer-rewards-pool-v3.ts"); process.exit(0); } main();