@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
27 lines (26 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = require("@repo/config");
const typechain_types_1 = require("../../typechain-types");
const hardhat_1 = require("hardhat");
const helpers_1 = require("../../test/helpers");
/**
* Starts a new round of emissions.
*
* @throws if the round cannot be started.
*/
const startRound = async () => {
const [signer] = await hardhat_1.ethers.getSigners();
const emissions = typechain_types_1.Emissions__factory.connect((0, config_1.getConfig)().emissionsContractAddress, signer);
const nextRound = await emissions.nextCycle();
console.log("Waiting for the current round to end...");
await (0, helpers_1.waitForNextCycle)();
await typechain_types_1.Emissions__factory.connect((0, config_1.getConfig)().emissionsContractAddress, signer).distribute();
console.log(`Successfully started round ${nextRound}`);
};
startRound()
.then(() => process.exit(0))
.catch(error => {
console.error("Error starting the round:", error);
process.exit(1);
});