UNPKG

@vechain/vebetterdao-contracts

Version:

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

37 lines (36 loc) 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setupSignalingFixture = setupSignalingFixture; const hardhat_1 = require("hardhat"); const helpers_1 = require("../helpers"); const xnodes_1 = require("../helpers/xnodes"); async function setupSignalingFixture() { const contracts = await (0, helpers_1.getOrDeployContractInstances)({ forceDeploy: true, }); const veBetterPassport = contracts.veBetterPassport; const owner = contracts.owner; const otherAccounts = contracts.otherAccounts; const x2EarnApps = contracts.x2EarnApps; // Create an app const appAdmin = otherAccounts[0]; await x2EarnApps.connect(owner).submitApp(otherAccounts[0].address, appAdmin, otherAccounts[0].address, "metadataURI"); const appId = hardhat_1.ethers.keccak256(hardhat_1.ethers.toUtf8Bytes(otherAccounts[0].address)); await (0, xnodes_1.endorseApp)(appId, otherAccounts[0]); // Setup signalers const regularSignaler = otherAccounts[1]; await veBetterPassport.connect(appAdmin).assignSignalerToAppByAppAdmin(appId, regularSignaler.address); await veBetterPassport.connect(owner).grantRole(await veBetterPassport.SIGNALER_ROLE(), owner.address); // Setup for registering actions await veBetterPassport.connect(owner).grantRole(await veBetterPassport.ACTION_REGISTRAR_ROLE(), owner.address); await veBetterPassport.connect(owner).setAppSecurity(appId, 1); // Set security to LOW return { veBetterPassport, owner, otherAccounts, x2EarnApps, appId, appAdmin, regularSignaler, }; }