@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
886 lines (885 loc) • 66.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOrDeployContractInstances = exports.multipliers = exports.levels = exports.DEFAULT_MAX_MINTABLE_LEVEL = exports.NFT_SYMBOL = exports.NFT_NAME = void 0;
const local_1 = require("@repo/config/contracts/envs/local");
const hardhat_1 = require("hardhat");
const helpers_1 = require("../../scripts/helpers");
const libraries_1 = require("../../scripts/libraries");
const whitelistGovernance_1 = require("./whitelistGovernance");
const x2EarnLibraries_1 = require("../../scripts/libraries/x2EarnLibraries");
const navigatorRegistryLibraries_1 = require("../../scripts/libraries/navigatorRegistryLibraries");
const setup_1 = require("../../scripts/deploy/setup");
const xAllocationVotingLibraries_1 = require("../../scripts/libraries/xAllocationVotingLibraries");
const deployStargate_1 = require("../../scripts/deploy/mocks/deployStargate");
const common_1 = require("./common");
exports.NFT_NAME = "GalaxyMember";
exports.NFT_SYMBOL = "GM";
exports.DEFAULT_MAX_MINTABLE_LEVEL = 1;
// // Voter Rewards
exports.levels = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; // Galaxy Member contract levels
exports.multipliers = [0, 10, 20, 50, 100, 150, 200, 400, 900, 2400]; // Galaxy Member contract percentage multipliers (in basis points)
let cachedDeployInstance = {};
const getOrDeployContractInstances = async ({ forceDeploy = false, config = (0, local_1.createLocalConfig)(), maxMintableLevel = exports.DEFAULT_MAX_MINTABLE_LEVEL, bootstrapAndStartEmissions = false, deployMocks = false, }) => {
if (!forceDeploy && Object.keys(cachedDeployInstance).length > 0) {
return cachedDeployInstance;
}
// Contracts are deployed using the first signer/account by default
const [owner, otherAccount, minterAccount, timelockAdmin, ...otherAccounts] = await hardhat_1.ethers.getSigners();
const creators = otherAccounts.slice(0, setup_1.APPS.length); // otherAcounts[1]...otherAccounts[8] reserved for creators
// ---------------------- Deploy Libraries ----------------------
const {
// V1
GovernorClockLogicLibV1, GovernorConfiguratorLibV1, GovernorDepositLogicLibV1, GovernorFunctionRestrictionsLogicLibV1, GovernorGovernanceLogicLibV1, GovernorProposalLogicLibV1, GovernorQuorumLogicLibV1, GovernorVotesLogicLibV1, GovernorStateLogicLibV1,
// V3
GovernorClockLogicLibV3, GovernorConfiguratorLibV3, GovernorFunctionRestrictionsLogicLibV3, GovernorGovernanceLogicLibV3, GovernorQuorumLogicLibV3, GovernorProposalLogicLibV3, GovernorVotesLogicLibV3, GovernorDepositLogicLibV3, GovernorStateLogicLibV3,
// V4
GovernorClockLogicLibV4, GovernorConfiguratorLibV4, GovernorFunctionRestrictionsLogicLibV4, GovernorGovernanceLogicLibV4, GovernorQuorumLogicLibV4, GovernorProposalLogicLibV4, GovernorVotesLogicLibV4, GovernorDepositLogicLibV4, GovernorStateLogicLibV4,
// V5
GovernorClockLogicLibV5, GovernorConfiguratorLibV5, GovernorFunctionRestrictionsLogicLibV5, GovernorGovernanceLogicLibV5, GovernorQuorumLogicLibV5, GovernorProposalLogicLibV5, GovernorVotesLogicLibV5, GovernorDepositLogicLibV5, GovernorStateLogicLibV5,
// V6
GovernorClockLogicLibV6, GovernorConfiguratorLibV6, GovernorDepositLogicLibV6, GovernorFunctionRestrictionsLogicLibV6, GovernorGovernanceLogicLibV6, GovernorProposalLogicLibV6, GovernorQuorumLogicLibV6, GovernorStateLogicLibV6, GovernorVotesLogicLibV6,
// V7
GovernorClockLogicLibV7, GovernorConfiguratorLibV7, GovernorDepositLogicLibV7, GovernorFunctionRestrictionsLogicLibV7, GovernorGovernanceLogicLibV7, GovernorProposalLogicLibV7, GovernorQuorumLogicLibV7, GovernorStateLogicLibV7, GovernorVotesLogicLibV7,
// V8
GovernorClockLogicLibV8, GovernorConfiguratorLibV8, GovernorDepositLogicLibV8, GovernorFunctionRestrictionsLogicLibV8, GovernorProposalLogicLibV8, GovernorQuorumLogicLibV8, GovernorStateLogicLibV8, GovernorVotesLogicLibV8, GovernorGovernanceLogicLibV8,
// (latest)
GovernorClockLogicLib, GovernorConfiguratorLib, GovernorDepositLogicLib, GovernorFunctionRestrictionsLogicLib, GovernorGovernanceLogicLib, GovernorProposalLogicLib, GovernorQuorumLogicLib, GovernorVotesLogicLib, GovernorStateLogicLib, } = await (0, libraries_1.governanceLibraries)({ logOutput: false, latestVersionOnly: false });
// Deploy Passport Libraries
const {
// V3
PassportChecksLogicV3, PassportConfiguratorV3, PassportEntityLogicV3, PassportDelegationLogicV3, PassportPersonhoodLogicV3, PassportPoPScoreLogicV3, PassportSignalingLogicV3, PassportWhitelistAndBlacklistLogicV3,
// V2
PassportChecksLogicV2, PassportConfiguratorV2, PassportEntityLogicV2, PassportDelegationLogicV2, PassportPersonhoodLogicV2, PassportPoPScoreLogicV2, PassportSignalingLogicV2, PassportWhitelistAndBlacklistLogicV2,
// V1
PassportChecksLogicV1, PassportConfiguratorV1, PassportEntityLogicV1, PassportDelegationLogicV1, PassportPersonhoodLogicV1, PassportPoPScoreLogicV1, PassportSignalingLogicV1, PassportWhitelistAndBlacklistLogicV1,
// V4
PassportChecksLogicV4, PassportConfiguratorV4, PassportEntityLogicV4, PassportDelegationLogicV4, PassportPersonhoodLogicV4, PassportPoPScoreLogicV4, PassportSignalingLogicV4, PassportWhitelistAndBlacklistLogicV4,
// V5 (latest)
PassportChecksLogic, PassportConfigurator, PassportEntityLogic, PassportDelegationLogic, PassportPersonhoodLogic, PassportPoPScoreLogic, PassportSignalingLogic, PassportWhitelistAndBlacklistLogic, } = await (0, libraries_1.passportLibraries)({ logOutput: false, latestVersionOnly: false });
// Deploy X2Earn AppLibraries
const {
// Latest
AdministrationUtils, EndorsementUtils, VoteEligibilityUtils, AppStorageUtils,
// V2
AdministrationUtilsV2, EndorsementUtilsV2, VoteEligibilityUtilsV2,
// V3
AdministrationUtilsV3, EndorsementUtilsV3, VoteEligibilityUtilsV3,
// V4
AdministrationUtilsV4, EndorsementUtilsV4, VoteEligibilityUtilsV4,
// V5
AdministrationUtilsV5, EndorsementUtilsV5, VoteEligibilityUtilsV5,
// V6
AdministrationUtilsV6, EndorsementUtilsV6, VoteEligibilityUtilsV6,
// V7
AdministrationUtilsV7, EndorsementUtilsV7, VoteEligibilityUtilsV7, } = await (0, x2EarnLibraries_1.x2EarnLibraries)({ logOutput: false, latestVersionOnly: false });
// Deploy XAllocationVoting Libraries
const AutoVotingLogicV8Lib = await (await hardhat_1.ethers.getContractFactory("AutoVotingLogicV8")).deploy();
await AutoVotingLogicV8Lib.waitForDeployment();
const xAllocLibs = await (0, xAllocationVotingLibraries_1.xAllocationVotingLibraries)();
// Deploy NavigatorRegistry Libraries
const navigatorLibs = await (0, navigatorRegistryLibraries_1.navigatorRegistryLibraries)();
const navigatorLibraryAddresses = {
NavigatorStakingUtils: await navigatorLibs.NavigatorStakingUtils.getAddress(),
NavigatorDelegationUtils: await navigatorLibs.NavigatorDelegationUtils.getAddress(),
NavigatorVotingUtils: await navigatorLibs.NavigatorVotingUtils.getAddress(),
NavigatorFeeUtils: await navigatorLibs.NavigatorFeeUtils.getAddress(),
NavigatorSlashingUtils: await navigatorLibs.NavigatorSlashingUtils.getAddress(),
NavigatorLifecycleUtils: await navigatorLibs.NavigatorLifecycleUtils.getAddress(),
};
// Deploy NavigatorRegistry proxy only (address needed for cross-contract wiring, initialized later)
const navigatorRegistryProxyAddress = await (0, helpers_1.deployProxyWithoutInitialization)("NavigatorRegistry", navigatorLibraryAddresses);
const { ChallengeCoreLogic: challengeCoreLogic, ChallengeSettlementLogic: challengeSettlementLogic } = await (0, libraries_1.challengesLibraries)({ logOutput: false });
// ---------------------- Deploy Mocks ----------------------
// deploy Mocks
const TokenAuctionLock = await hardhat_1.ethers.getContractFactory("TokenAuction");
const vechainNodesMock = await TokenAuctionLock.deploy();
await vechainNodesMock.waitForDeployment();
const ClockAuctionLock = await hardhat_1.ethers.getContractFactory("ClockAuction");
const clockAuctionContract = await ClockAuctionLock.deploy(await vechainNodesMock.getAddress(), await owner.getAddress());
await vechainNodesMock.setSaleAuctionAddress(await clockAuctionContract.getAddress());
await vechainNodesMock.addOperator(await owner.getAddress());
// deploy Stargate Mocks
// Deploy VTHO token
const VTHOFactory = await hardhat_1.ethers.getContractFactory("MyERC20");
const vthoTokenMock = await VTHOFactory.deploy(owner.address, owner.address);
await vthoTokenMock.waitForDeployment();
const vthoAddress = await vthoTokenMock.getAddress();
const { stargateNFT: stargateNftMock, stargate: stargateMock } = await (0, deployStargate_1.deployStargateMock)({
logOutput: false,
legacyNodesContractAddress: await vechainNodesMock.getAddress(),
vthoTokenAddress: await vthoTokenMock.getAddress(),
});
// Add stargateNftMock as operator to vechainNodesMock, so that it can destroy legacy nodes
await vechainNodesMock.addOperator(await stargateNftMock.getAddress());
const nodeManagementMock = (await (0, helpers_1.deployAndUpgrade)(["NodeManagementV1", "NodeManagementV2", "NodeManagementV3"], [[await vechainNodesMock.getAddress(), owner.address, owner.address], [], [await stargateNftMock.getAddress()]], {
versions: [undefined, 2, 3],
logOutput: false,
}));
let myErc1155, myErc721;
if (deployMocks) {
const MyERC721 = await hardhat_1.ethers.getContractFactory("MyERC721");
myErc721 = await MyERC721.deploy(owner.address);
await myErc721.waitForDeployment();
const MyERC1155 = await hardhat_1.ethers.getContractFactory("MyERC1155");
myErc1155 = await MyERC1155.deploy(owner.address);
await myErc1155.waitForDeployment();
}
// ---------------------- Deploy MultiSig ----------------------
const B3TRMultiSig = await hardhat_1.ethers.getContractFactory("B3TRMultiSig");
const b3trMultiSig = await B3TRMultiSig.deploy([owner.address, otherAccount.address, minterAccount.address], 2);
// ---------------------- Deploy Contracts ----------------------
// Deploy B3TR
const B3trContract = await hardhat_1.ethers.getContractFactory("B3TR");
const b3tr = await B3trContract.deploy(owner, minterAccount, owner);
// Deploy VOT3 V1 -> V2
let vot3 = (await (0, helpers_1.deployAndUpgrade)(["VOT3V1", "VOT3"], [[owner.address, owner.address, owner.address, await b3tr.getAddress()], [navigatorRegistryProxyAddress]], {
versions: [undefined, 2],
logOutput: false,
}));
// Deploy TimeLock
const timeLock = (await (0, helpers_1.deployProxy)("TimeLock", [
config.TIMELOCK_MIN_DELAY, //0 seconds delay for immediate execution
[],
[],
timelockAdmin.address,
timelockAdmin.address,
]));
// Deploy Treasury
const treasury = (await (0, helpers_1.deployProxy)("Treasury", [
await b3tr.getAddress(),
await vot3.getAddress(),
await timeLock.getAddress(), // timelock address
owner.address, // admin
owner.address, // proxy admin
owner.address, // pauser
config.TREASURY_TRANSFER_LIMIT_VET,
config.TREASURY_TRANSFER_LIMIT_B3TR,
config.TREASURY_TRANSFER_LIMIT_VOT3,
config.TREASURY_TRANSFER_LIMIT_VTHO,
]));
const x2EarnCreator = (await (0, helpers_1.deployAndUpgrade)(["X2EarnCreatorV1", "X2EarnCreator"], [[config.CREATOR_NFT_URI, owner.address], [true]], {
versions: [undefined, 2],
logOutput: false,
}));
// Deploy NodeManagement - deprecating...
// const nodeManagementV1 = (await deployProxy("NodeManagementV1", [
// await vechainNodesMock.getAddress(),
// owner.address,
// owner.address,
// ])) as NodeManagementV1
// const nodeManagement = (await upgradeProxy(
// "NodeManagementV1",
// "NodeManagement",
// await nodeManagementV1.getAddress(),
// [],
// {
// version: 2,
// },
// )) as NodeManagement
const galaxyMember = (await (0, helpers_1.deployAndUpgrade)(["GalaxyMemberV1", "GalaxyMemberV2", "GalaxyMemberV3", "GalaxyMemberV4", "GalaxyMemberV5", "GalaxyMember"], [
[
{
name: exports.NFT_NAME,
symbol: exports.NFT_SYMBOL,
admin: owner.address,
upgrader: owner.address,
pauser: owner.address,
minter: owner.address,
contractsAddressManager: owner.address,
maxLevel: maxMintableLevel,
baseTokenURI: config.GM_NFT_BASE_URI,
b3trToUpgradeToLevel: config.GM_NFT_B3TR_REQUIRED_TO_UPGRADE_TO_LEVEL,
b3tr: await b3tr.getAddress(),
treasury: await treasury.getAddress(),
},
],
[
await vechainNodesMock.getAddress(),
await nodeManagementMock.getAddress(),
owner.address,
config.GM_NFT_NODE_TO_FREE_LEVEL,
],
[],
[],
[],
[await stargateNftMock.getAddress()],
], {
versions: [undefined, 2, 3, 4, 5, 6],
}));
// Initialization requires the address of the x2EarnRewardsPool, for this reason we will initialize it after
const veBetterPassportContractAddress = await (0, helpers_1.deployProxyOnly)("VeBetterPassportV1", {
PassportChecksLogicV1: await PassportChecksLogicV1.getAddress(),
PassportConfiguratorV1: await PassportConfiguratorV1.getAddress(),
PassportEntityLogicV1: await PassportEntityLogicV1.getAddress(),
PassportDelegationLogicV1: await PassportDelegationLogicV1.getAddress(),
PassportPersonhoodLogicV1: await PassportPersonhoodLogicV1.getAddress(),
PassportPoPScoreLogicV1: await PassportPoPScoreLogicV1.getAddress(),
PassportSignalingLogicV1: await PassportSignalingLogicV1.getAddress(),
PassportWhitelistAndBlacklistLogicV1: await PassportWhitelistAndBlacklistLogicV1.getAddress(),
});
// Set a temporary address for the xAllocationGovernor
const xAllocationGovernor = otherAccounts[10].address;
// Set a temporary address for the x2EarnRewardsPool to then set the correct address in x2EarnApps
const x2EarnRewardsPoolAddress = otherAccounts[11].address;
// Deploy up to V7
const x2EarnAppsV7 = (await (0, helpers_1.deployAndUpgrade)(["X2EarnAppsV1", "X2EarnAppsV2", "X2EarnAppsV3", "X2EarnAppsV4", "X2EarnAppsV5", "X2EarnAppsV6", "X2EarnAppsV7"], [
["ipfs://", [await timeLock.getAddress(), owner.address], owner.address, owner.address],
[
config.XAPP_GRACE_PERIOD,
await nodeManagementMock.getAddress(),
veBetterPassportContractAddress,
await x2EarnCreator.getAddress(),
],
[config.X2EARN_NODE_COOLDOWN_PERIOD, xAllocationGovernor],
[x2EarnRewardsPoolAddress], // Setting temporary address for the x2EarnRewardsPool
[],
[],
[await stargateNftMock.getAddress()],
], {
versions: [undefined, 2, 3, 4, 5, 6, 7],
libraries: [
undefined,
{
AdministrationUtilsV2: await AdministrationUtilsV2.getAddress(),
EndorsementUtilsV2: await EndorsementUtilsV2.getAddress(),
VoteEligibilityUtilsV2: await VoteEligibilityUtilsV2.getAddress(),
},
{
AdministrationUtilsV3: await AdministrationUtilsV3.getAddress(),
EndorsementUtilsV3: await EndorsementUtilsV3.getAddress(),
VoteEligibilityUtilsV3: await VoteEligibilityUtilsV3.getAddress(),
},
{
AdministrationUtilsV4: await AdministrationUtilsV4.getAddress(),
EndorsementUtilsV4: await EndorsementUtilsV4.getAddress(),
VoteEligibilityUtilsV4: await VoteEligibilityUtilsV4.getAddress(),
},
{
AdministrationUtilsV5: await AdministrationUtilsV5.getAddress(),
EndorsementUtilsV5: await EndorsementUtilsV5.getAddress(),
VoteEligibilityUtilsV5: await VoteEligibilityUtilsV5.getAddress(),
},
{
AdministrationUtilsV6: await AdministrationUtilsV6.getAddress(),
EndorsementUtilsV6: await EndorsementUtilsV6.getAddress(),
VoteEligibilityUtilsV6: await VoteEligibilityUtilsV6.getAddress(),
},
{
AdministrationUtilsV7: await AdministrationUtilsV7.getAddress(),
EndorsementUtilsV7: await EndorsementUtilsV7.getAddress(),
VoteEligibilityUtilsV7: await VoteEligibilityUtilsV7.getAddress(),
},
],
}));
const x2EarnRewardsPool = (await (0, helpers_1.deployAndUpgrade)([
"X2EarnRewardsPoolV1",
"X2EarnRewardsPoolV2",
"X2EarnRewardsPoolV3",
"X2EarnRewardsPoolV4",
"X2EarnRewardsPoolV5",
"X2EarnRewardsPoolV6",
"X2EarnRewardsPoolV7",
"X2EarnRewardsPool",
], [
[owner.address, owner.address, owner.address, await b3tr.getAddress(), await x2EarnAppsV7.getAddress()],
[owner.address, config.X_2_EARN_INITIAL_IMPACT_KEYS],
[veBetterPassportContractAddress],
[],
[],
[],
[],
[],
], {
versions: [undefined, 2, 3, 4, 5, 6, 7, 8],
}));
const xAllocationPool = (await (0, helpers_1.deployAndUpgrade)([
"XAllocationPoolV1",
"XAllocationPoolV2",
"XAllocationPoolV3",
"XAllocationPoolV4",
"XAllocationPoolV5",
"XAllocationPoolV6",
"XAllocationPool",
], [
[
owner.address,
owner.address,
owner.address,
await b3tr.getAddress(),
await treasury.getAddress(),
await x2EarnAppsV7.getAddress(),
await x2EarnRewardsPool.getAddress(),
],
[],
[],
[],
[],
[],
[[], []],
], {
versions: [undefined, 2, 3, 4, 5, 6, 7],
}));
const X_ALLOCATIONS_ADDRESS = await xAllocationPool.getAddress();
const VOTE_2_EARN_ADDRESS = otherAccounts[10].address;
const emissions = (await (0, helpers_1.deployAndUpgrade)(["EmissionsV1", "EmissionsV2", "Emissions"], [
[
{
minter: minterAccount.address,
admin: owner.address,
upgrader: owner.address,
contractsAddressManager: owner.address,
decaySettingsManager: owner.address,
b3trAddress: await b3tr.getAddress(),
destinations: [
X_ALLOCATIONS_ADDRESS,
VOTE_2_EARN_ADDRESS,
await treasury.getAddress(),
config.MIGRATION_ADDRESS,
],
initialXAppAllocation: config.INITIAL_X_ALLOCATION,
cycleDuration: config.EMISSIONS_CYCLE_DURATION,
decaySettings: [
config.EMISSIONS_X_ALLOCATION_DECAY_PERCENTAGE,
config.EMISSIONS_VOTE_2_EARN_DECAY_PERCENTAGE,
config.EMISSIONS_X_ALLOCATION_DECAY_PERIOD,
config.EMISSIONS_VOTE_2_EARN_ALLOCATION_DECAY_PERIOD,
],
treasuryPercentage: config.EMISSIONS_TREASURY_PERCENTAGE,
maxVote2EarnDecay: config.EMISSIONS_MAX_VOTE_2_EARN_DECAY_PERCENTAGE,
migrationAmount: config.MIGRATION_AMOUNT,
},
],
[],
[config.GM_PERCENTAGE_OF_TREASURY],
], {
versions: [undefined, 2, 3],
logOutput: false,
}));
let voterRewards = (await (0, helpers_1.deployAndUpgrade)(["VoterRewardsV1", "VoterRewardsV2", "VoterRewardsV3", "VoterRewardsV4", "VoterRewardsV5"], [
[
owner.address, // admin
owner.address, // upgrader
owner.address, // contractsAddressManager
await emissions.getAddress(),
await galaxyMember.getAddress(),
await b3tr.getAddress(),
exports.levels,
exports.multipliers,
],
[],
[],
[],
[[], []],
], {
versions: [undefined, 2, 3, 4, 5],
}));
// Set vote 2 earn (VoterRewards deployed contract) address in emissions
await emissions.connect(owner).setVote2EarnAddress(await voterRewards.getAddress());
const tempB3trGovernorAddress = owner.address;
const xAllocationVoting = (await (0, helpers_1.deployAndUpgrade)([
"XAllocationVotingV1",
"XAllocationVotingV2",
"XAllocationVotingV3",
"XAllocationVotingV4",
"XAllocationVotingV5",
"XAllocationVotingV6",
"XAllocationVotingV7",
"XAllocationVotingV8",
"XAllocationVotingV9",
"XAllocationVoting",
], [
[
{
vot3Token: await vot3.getAddress(),
quorumPercentage: config.X_ALLOCATION_VOTING_QUORUM_PERCENTAGE, // quorum percentage
initialVotingPeriod: config.EMISSIONS_CYCLE_DURATION - 1, // X Alloc voting period
timeLock: await timeLock.getAddress(),
voterRewards: await voterRewards.getAddress(),
emissions: await emissions.getAddress(),
admins: [await timeLock.getAddress(), owner.address],
upgrader: owner.address,
contractsAddressManager: owner.address,
x2EarnAppsAddress: await x2EarnAppsV7.getAddress(),
baseAllocationPercentage: config.X_ALLOCATION_POOL_BASE_ALLOCATION_PERCENTAGE,
appSharesCap: config.X_ALLOCATION_POOL_APP_SHARES_MAX_CAP,
votingThreshold: config.X_ALLOCATION_VOTING_VOTING_THRESHOLD,
},
],
[],
[],
[],
[],
[],
[],
[],
[navigatorRegistryProxyAddress, config.XALLOCATION_CITIZEN_SKIP_WINDOW_BLOCKS], // V9: set NavigatorRegistry + skip window
[], // V10: no reinitializer needed
], {
versions: [undefined, 2, 3, 4, 5, 6, 7, 8, 9, 10],
libraries: [
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
{ AutoVotingLogicV8: await AutoVotingLogicV8Lib.getAddress() },
{
AutoVotingLogic: await xAllocLibs.AutoVotingLogic.getAddress(),
ExternalContractsUtils: await xAllocLibs.ExternalContractsUtils.getAddress(),
VotingSettingsUtils: await xAllocLibs.VotingSettingsUtils.getAddress(),
VotesUtils: await xAllocLibs.VotesUtils.getAddress(),
VotesQuorumFractionUtils: await xAllocLibs.VotesQuorumFractionUtils.getAddress(),
RoundEarningsSettingsUtils: await xAllocLibs.RoundEarningsSettingsUtils.getAddress(),
RoundFinalizationUtils: await xAllocLibs.RoundFinalizationUtils.getAddress(),
RoundsStorageUtils: await xAllocLibs.RoundsStorageUtils.getAddress(),
RoundVotesCountingUtils: await xAllocLibs.RoundVotesCountingUtils.getAddress(),
},
{
AutoVotingLogic: await xAllocLibs.AutoVotingLogic.getAddress(),
ExternalContractsUtils: await xAllocLibs.ExternalContractsUtils.getAddress(),
VotingSettingsUtils: await xAllocLibs.VotingSettingsUtils.getAddress(),
VotesUtils: await xAllocLibs.VotesUtils.getAddress(),
VotesQuorumFractionUtils: await xAllocLibs.VotesQuorumFractionUtils.getAddress(),
RoundEarningsSettingsUtils: await xAllocLibs.RoundEarningsSettingsUtils.getAddress(),
RoundFinalizationUtils: await xAllocLibs.RoundFinalizationUtils.getAddress(),
RoundsStorageUtils: await xAllocLibs.RoundsStorageUtils.getAddress(),
RoundVotesCountingUtils: await xAllocLibs.RoundVotesCountingUtils.getAddress(),
},
],
logOutput: false,
}));
const veBetterPassportV1 = (await (0, helpers_1.initializeProxy)(veBetterPassportContractAddress, "VeBetterPassportV1", [
{
x2EarnApps: await x2EarnAppsV7.getAddress(),
xAllocationVoting: await xAllocationVoting.getAddress(),
galaxyMember: await galaxyMember.getAddress(),
signalingThreshold: config.VEPASSPORT_BOT_SIGNALING_THRESHOLD, //signalingThreshold
roundsForCumulativeScore: config.VEPASSPORT_ROUNDS_FOR_CUMULATIVE_PARTICIPATION_SCORE, //roundsForCumulativeScore
minimumGalaxyMemberLevel: config.VEPASSPORT_GALAXY_MEMBER_MINIMUM_LEVEL, //galaxyMemberMinimumLevel
blacklistThreshold: config.VEPASSPORT_BLACKLIST_THRESHOLD_PERCENTAGE, //blacklistThreshold
whitelistThreshold: config.VEPASSPORT_WHITELIST_THRESHOLD_PERCENTAGE, //whitelistThreshold
maxEntitiesPerPassport: config.VEPASSPORT_PASSPORT_MAX_ENTITIES, //maxEntitiesPerPassport
decayRate: config.VEPASSPORT_DECAY_RATE, //decayRate
},
{
admin: owner.address, // admin
botSignaler: owner.address, // botSignaler
upgrader: owner.address, // upgrader
settingsManager: owner.address, // settingsManager
roleGranter: owner.address, // roleGranter
blacklister: owner.address, // blacklister
whitelister: owner.address, // whitelistManager
actionRegistrar: owner.address, // actionRegistrar
actionScoreManager: owner.address, // actionScoreManager
},
], {
PassportChecksLogicV1: await PassportChecksLogicV1.getAddress(),
PassportConfiguratorV1: await PassportConfiguratorV1.getAddress(),
PassportEntityLogicV1: await PassportEntityLogicV1.getAddress(),
PassportDelegationLogicV1: await PassportDelegationLogicV1.getAddress(),
PassportPersonhoodLogicV1: await PassportPersonhoodLogicV1.getAddress(),
PassportPoPScoreLogicV1: await PassportPoPScoreLogicV1.getAddress(),
PassportSignalingLogicV1: await PassportSignalingLogicV1.getAddress(),
PassportWhitelistAndBlacklistLogicV1: await PassportWhitelistAndBlacklistLogicV1.getAddress(),
}));
const veBetterPassportV2 = (await (0, helpers_1.upgradeProxy)("VeBetterPassportV1", "VeBetterPassportV2", await veBetterPassportV1.getAddress(), // Proxy address remains the same
[], {
version: 2,
libraries: {
PassportChecksLogicV2: await PassportChecksLogicV2.getAddress(),
PassportConfiguratorV2: await PassportConfiguratorV2.getAddress(),
PassportEntityLogicV2: await PassportEntityLogicV2.getAddress(),
PassportDelegationLogicV2: await PassportDelegationLogicV2.getAddress(),
PassportPersonhoodLogicV2: await PassportPersonhoodLogicV2.getAddress(),
PassportPoPScoreLogicV2: await PassportPoPScoreLogicV2.getAddress(),
PassportSignalingLogicV2: await PassportSignalingLogicV2.getAddress(),
PassportWhitelistAndBlacklistLogicV2: await PassportWhitelistAndBlacklistLogicV2.getAddress(),
},
}));
const veBetterPassportV3 = (await (0, helpers_1.upgradeProxy)("VeBetterPassportV2", "VeBetterPassportV3", await veBetterPassportV1.getAddress(), // Proxy address remains the same
[], {
version: 3,
libraries: {
PassportChecksLogicV3: await PassportChecksLogicV3.getAddress(),
PassportConfiguratorV3: await PassportConfiguratorV3.getAddress(),
PassportEntityLogicV3: await PassportEntityLogicV3.getAddress(),
PassportDelegationLogicV3: await PassportDelegationLogicV3.getAddress(),
PassportPersonhoodLogicV3: await PassportPersonhoodLogicV3.getAddress(),
PassportPoPScoreLogicV3: await PassportPoPScoreLogicV3.getAddress(),
PassportSignalingLogicV3: await PassportSignalingLogicV3.getAddress(),
PassportWhitelistAndBlacklistLogicV3: await PassportWhitelistAndBlacklistLogicV3.getAddress(),
},
}));
// V4 (intermediate)
const veBetterPassportV4 = (await (0, helpers_1.upgradeProxy)("VeBetterPassportV3", "VeBetterPassportV4", await veBetterPassportV1.getAddress(), // Proxy address remains the same
[config.CONTRACTS_ADMIN_ADDRESS], // initializeV4: resetSignaler address
{
version: 4,
libraries: {
PassportChecksLogicV4: await PassportChecksLogicV4.getAddress(),
PassportConfiguratorV4: await PassportConfiguratorV4.getAddress(),
PassportEntityLogicV4: await PassportEntityLogicV4.getAddress(),
PassportDelegationLogicV4: await PassportDelegationLogicV4.getAddress(),
PassportPersonhoodLogicV4: await PassportPersonhoodLogicV4.getAddress(),
PassportPoPScoreLogicV4: await PassportPoPScoreLogicV4.getAddress(),
PassportSignalingLogicV4: await PassportSignalingLogicV4.getAddress(),
PassportWhitelistAndBlacklistLogicV4: await PassportWhitelistAndBlacklistLogicV4.getAddress(),
},
}));
// V5 (latest version)
const veBetterPassport = (await (0, helpers_1.upgradeProxy)("VeBetterPassportV4", "VeBetterPassport", await veBetterPassportV1.getAddress(), // Proxy address remains the same
[], {
version: 5,
libraries: {
PassportChecksLogic: await PassportChecksLogic.getAddress(),
PassportConfigurator: await PassportConfigurator.getAddress(),
PassportEntityLogic: await PassportEntityLogic.getAddress(),
PassportDelegationLogic: await PassportDelegationLogic.getAddress(),
PassportPersonhoodLogic: await PassportPersonhoodLogic.getAddress(),
PassportPoPScoreLogic: await PassportPoPScoreLogic.getAddress(),
PassportSignalingLogic: await PassportSignalingLogic.getAddress(),
PassportWhitelistAndBlacklistLogic: await PassportWhitelistAndBlacklistLogic.getAddress(),
},
}));
// Set the TEMP governor address before deploying the governor
const TEMP_GOVERNOR_ADDRESS = owner.address;
// Deploy GrantsManager V1 first
const grantsManagerV1 = (await (0, helpers_1.deployProxy)("GrantsManagerV1", [
// ← Change to GrantsManagerV1
TEMP_GOVERNOR_ADDRESS, // governor address
await treasury.getAddress(), // treasury address
owner.address, // admin
await b3tr.getAddress(), // b3tr address
config.MINIMUM_MILESTONE_COUNT, // minimum milestone count
]));
// Grant UPGRADER_ROLE to deployer
await grantsManagerV1.connect(owner).grantRole(await grantsManagerV1.UPGRADER_ROLE(), owner.address);
// Upgrade V1 → V2
await (0, helpers_1.upgradeProxy)("GrantsManagerV1", "GrantsManagerV2", await grantsManagerV1.getAddress(), [], {
version: 2,
libraries: {},
});
// Upgrade V2 → V3 (widens updateMilestoneMetadataURI access to grants receiver + approver role)
const grantsManager = (await (0, helpers_1.upgradeProxy)("GrantsManagerV2", "GrantsManager", await grantsManagerV1.getAddress(), [], {
version: 3,
libraries: {},
}));
const relayerRewardsPool = (await (0, helpers_1.deployAndUpgrade)(["RelayerRewardsPoolV1", "RelayerRewardsPoolV2", "RelayerRewardsPool"], [
[
owner.address, // admin
owner.address, // upgrader
await b3tr.getAddress(), // b3trAddress
await emissions.getAddress(), // emissionsAddress
await xAllocationVoting.getAddress(), // xAllocationVotingAddress
],
[],
[],
], {
versions: [undefined, 2, 3],
logOutput: false,
}));
const governor = (await (0, helpers_1.deployAndUpgrade)([
"B3TRGovernorV1",
"B3TRGovernorV2",
"B3TRGovernorV3",
"B3TRGovernorV4",
"B3TRGovernorV5",
"B3TRGovernorV6",
"B3TRGovernorV7",
"B3TRGovernorV8",
"B3TRGovernorV9",
"B3TRGovernor",
], [
[
{
vot3Token: await vot3.getAddress(),
timelock: await timeLock.getAddress(),
xAllocationVoting: await xAllocationVoting.getAddress(),
b3tr: await b3tr.getAddress(),
quorumPercentage: config.B3TR_GOVERNOR_QUORUM_PERCENTAGE,
initialDepositThreshold: config.B3TR_GOVERNOR_DEPOSIT_THRESHOLD,
initialMinVotingDelay: config.B3TR_GOVERNOR_MIN_VOTING_DELAY,
initialVotingThreshold: config.B3TR_GOVERNOR_VOTING_THRESHOLD,
voterRewards: await voterRewards.getAddress(),
isFunctionRestrictionEnabled: true,
},
{
governorAdmin: owner.address, // admin
pauser: owner.address, // botSignaler
contractsAddressManager: owner.address, // upgrader
proposalExecutor: owner.address, // settingsManager
governorFunctionSettingsRoleAddress: owner.address, // roleGranter
},
],
[],
[],
[await veBetterPassport.getAddress()],
[],
[],
[
{
grantDepositThreshold: config.B3TR_GOVERNOR_GRANT_DEPOSIT_THRESHOLD, //Grant deposit threshold
grantVotingThreshold: config.B3TR_GOVERNOR_GRANT_VOTING_THRESHOLD, //Grant voting threshold
grantQuorum: config.B3TR_GOVERNOR_GRANT_QUORUM_PERCENTAGE, //Grant quorum percentage
grantDepositThresholdCap: config.B3TR_GOVERNOR_GRANT_DEPOSIT_THRESHOLD_CAP, //Grant deposit threshold cap
standardDepositThresholdCap: config.B3TR_GOVERNOR_STANDARD_DEPOSIT_THRESHOLD_CAP, //Standard deposit threshold cap
standardGMWeight: config.B3TR_GOVERNOR_STANDARD_GM_WEIGHT, //Standard GM weight
grantGMWeight: config.B3TR_GOVERNOR_GRANT_GM_WEIGHT, //Grant GM weight
galaxyMember: await galaxyMember.getAddress(), //GalaxyMember contract
grantsManager: await grantsManager.getAddress(), //GrantsManager contract
},
], // [levels, config.GM_MULTIPLIERS_V2] -> Will revert if emissions is not bootstrapped
[], // Reserved for future configuration parameters; currently no values required
[], // v9
[navigatorRegistryProxyAddress, await relayerRewardsPool.getAddress(), config.B3TR_GOVERNOR_SKIP_WINDOW_BLOCKS], // v10
], {
versions: [undefined, 2, 3, 4, 5, 6, 7, 8, 9, 10],
libraries: [
{
GovernorClockLogicV1: await GovernorClockLogicLibV1.getAddress(),
GovernorConfiguratorV1: await GovernorConfiguratorLibV1.getAddress(),
GovernorDepositLogicV1: await GovernorDepositLogicLibV1.getAddress(),
GovernorFunctionRestrictionsLogicV1: await GovernorFunctionRestrictionsLogicLibV1.getAddress(),
GovernorProposalLogicV1: await GovernorProposalLogicLibV1.getAddress(),
GovernorQuorumLogicV1: await GovernorQuorumLogicLibV1.getAddress(),
GovernorStateLogicV1: await GovernorStateLogicLibV1.getAddress(),
GovernorVotesLogicV1: await GovernorVotesLogicLibV1.getAddress(),
},
{
GovernorClockLogicV1: await GovernorClockLogicLibV1.getAddress(),
GovernorConfiguratorV1: await GovernorConfiguratorLibV1.getAddress(),
GovernorDepositLogicV1: await GovernorDepositLogicLibV1.getAddress(),
GovernorFunctionRestrictionsLogicV1: await GovernorFunctionRestrictionsLogicLibV1.getAddress(),
GovernorProposalLogicV1: await GovernorQuorumLogicLibV1.getAddress(),
GovernorQuorumLogicV1: await GovernorQuorumLogicLibV1.getAddress(),
GovernorStateLogicV1: await GovernorStateLogicLibV1.getAddress(),
GovernorVotesLogicV1: await GovernorVotesLogicLibV1.getAddress(),
},
{
GovernorClockLogicV3: await GovernorClockLogicLibV3.getAddress(),
GovernorConfiguratorV3: await GovernorConfiguratorLibV3.getAddress(),
GovernorDepositLogicV3: await GovernorDepositLogicLibV3.getAddress(),
GovernorFunctionRestrictionsLogicV3: await GovernorFunctionRestrictionsLogicLibV3.getAddress(),
GovernorProposalLogicV3: await GovernorProposalLogicLibV3.getAddress(),
GovernorQuorumLogicV3: await GovernorQuorumLogicLibV3.getAddress(),
GovernorStateLogicV3: await GovernorStateLogicLibV3.getAddress(),
GovernorVotesLogicV3: await GovernorVotesLogicLibV3.getAddress(),
},
{
GovernorClockLogicV4: await GovernorClockLogicLibV4.getAddress(),
GovernorConfiguratorV4: await GovernorConfiguratorLibV4.getAddress(),
GovernorDepositLogicV4: await GovernorDepositLogicLibV4.getAddress(),
GovernorFunctionRestrictionsLogicV4: await GovernorFunctionRestrictionsLogicLibV4.getAddress(),
GovernorProposalLogicV4: await GovernorProposalLogicLibV4.getAddress(),
GovernorQuorumLogicV4: await GovernorQuorumLogicLibV4.getAddress(),
GovernorStateLogicV4: await GovernorStateLogicLibV4.getAddress(),
GovernorVotesLogicV4: await GovernorVotesLogicLibV4.getAddress(),
},
{
GovernorClockLogicV5: await GovernorClockLogicLibV5.getAddress(),
GovernorConfiguratorV5: await GovernorConfiguratorLibV5.getAddress(),
GovernorDepositLogicV5: await GovernorDepositLogicLibV5.getAddress(),
GovernorFunctionRestrictionsLogicV5: await GovernorFunctionRestrictionsLogicLibV5.getAddress(),
GovernorQuorumLogicV5: await GovernorQuorumLogicLibV5.getAddress(),
GovernorProposalLogicV5: await GovernorProposalLogicLibV5.getAddress(),
GovernorStateLogicV5: await GovernorStateLogicLibV5.getAddress(),
GovernorVotesLogicV5: await GovernorVotesLogicLibV5.getAddress(),
},
{
GovernorClockLogicV6: await GovernorClockLogicLibV6.getAddress(),
GovernorConfiguratorV6: await GovernorConfiguratorLibV6.getAddress(),
GovernorDepositLogicV6: await GovernorDepositLogicLibV6.getAddress(),
GovernorFunctionRestrictionsLogicV6: await GovernorFunctionRestrictionsLogicLibV6.getAddress(),
GovernorProposalLogicV6: await GovernorProposalLogicLibV6.getAddress(),
GovernorQuorumLogicV6: await GovernorQuorumLogicLibV6.getAddress(),
GovernorStateLogicV6: await GovernorStateLogicLibV6.getAddress(),
GovernorVotesLogicV6: await GovernorVotesLogicLibV6.getAddress(),
},
{
GovernorClockLogicV7: await GovernorClockLogicLibV7.getAddress(),
GovernorConfiguratorV7: await GovernorConfiguratorLibV7.getAddress(),
GovernorDepositLogicV7: await GovernorDepositLogicLibV7.getAddress(),
GovernorFunctionRestrictionsLogicV7: await GovernorFunctionRestrictionsLogicLibV7.getAddress(),
GovernorProposalLogicV7: await GovernorProposalLogicLibV7.getAddress(),
GovernorQuorumLogicV7: await GovernorQuorumLogicLibV7.getAddress(),
GovernorStateLogicV7: await GovernorStateLogicLibV7.getAddress(),
GovernorVotesLogicV7: await GovernorVotesLogicLibV7.getAddress(),
},
{
GovernorClockLogicV8: await GovernorClockLogicLibV8.getAddress(),
GovernorConfiguratorV8: await GovernorConfiguratorLibV8.getAddress(),
GovernorDepositLogicV8: await GovernorDepositLogicLibV8.getAddress(),
GovernorFunctionRestrictionsLogicV8: await GovernorFunctionRestrictionsLogicLibV8.getAddress(),
GovernorProposalLogicV8: await GovernorProposalLogicLibV8.getAddress(),
GovernorQuorumLogicV8: await GovernorQuorumLogicLibV8.getAddress(),
GovernorStateLogicV8: await GovernorStateLogicLibV8.getAddress(),
GovernorVotesLogicV8: await GovernorVotesLogicLibV8.getAddress(),
},
{
GovernorClockLogicV9: await GovernorClockLogicLib.getAddress(),
GovernorConfiguratorV9: await GovernorConfiguratorLib.getAddress(),
GovernorDepositLogicV9: await GovernorDepositLogicLib.getAddress(),
GovernorFunctionRestrictionsLogicV9: await GovernorFunctionRestrictionsLogicLib.getAddress(),
GovernorProposalLogicV9: await GovernorProposalLogicLib.getAddress(),
GovernorQuorumLogicV9: await GovernorQuorumLogicLib.getAddress(),
GovernorStateLogicV9: await GovernorStateLogicLib.getAddress(),
GovernorVotesLogicV9: await GovernorVotesLogicLib.getAddress(),
},
{
GovernorClockLogic: await GovernorClockLogicLib.getAddress(),
GovernorConfigurator: await GovernorConfiguratorLib.getAddress(),
GovernorDepositLogic: await GovernorDepositLogicLib.getAddress(),
GovernorFunctionRestrictionsLogic: await GovernorFunctionRestrictionsLogicLib.getAddress(),
GovernorProposalLogic: await GovernorProposalLogicLib.getAddress(),
GovernorQuorumLogic: await GovernorQuorumLogicLib.getAddress(),
GovernorStateLogic: await GovernorStateLogicLib.getAddress(),
GovernorVotesLogic: await GovernorVotesLogicLib.getAddress(),
},
],
}));
// Upgrade VoterRewards V5 -> V6 (needs xAllocationVoting + relayerRewardsPool)
voterRewards = (await (0, helpers_1.upgradeProxy)("VoterRewardsV5", "VoterRewardsV6", await voterRewards.getAddress(), [await xAllocationVoting.getAddress(), await relayerRewardsPool.getAddress()], {
version: 6,
}));
// Upgrade VoterRewards V6 -> V7 (needs navigator params)
voterRewards = (await (0, helpers_1.upgradeProxy)("VoterRewardsV6", "VoterRewards", await voterRewards.getAddress(), [
0, // roundStartTimepoint — no active round during initial deploy, 0 ensures values take effect immediately
10000, // freshnessT1 — x1 (neutral for existing tests; dedicated multiplier tests set their own values)
10000, // freshnessT2 — x1
10000, // freshnessT3 — x1
10000, // intentFA — x1
10000, // intentAb — x1 (neutral for existing tests)
navigatorRegistryProxyAddress,
], {
version: 7,
}));
// Deploy DBAPool V1
const dbaPoolV1 = (await (0, helpers_1.deployProxy)("DBAPoolV1", [
{
admin: owner.address,
x2EarnApps: await x2EarnAppsV7.getAddress(),
xAllocationPool: await xAllocationPool.getAddress(),
x2earnRewardsPool: await x2EarnRewardsPool.getAddress(),
b3tr: await b3tr.getAddress(),
distributionStartRound: 1,
},
]));
// Grant UPGRADER_ROLE to owner so we can upgrade
const UPGRADER_ROLE = await dbaPoolV1.UPGRADER_ROLE();
const grantRoleTx = await dbaPoolV1.connect(owner).grantRole(UPGRADER_ROLE, owner.address);
await grantRoleTx.wait();
// Upgrade to V2
const dbaPoolV2 = (await (0, helpers_1.upgradeProxy)("DBAPoolV1", "DBAPoolV2", await dbaPoolV1.getAddress(), [], {
version: 2,
logOutput: false,
}));
// Upgrade to V3
const dynamicBaseAllocationPool = (await (0, helpers_1.upgradeProxy)("DBAPoolV2", "DBAPool", await dbaPoolV2.getAddress(), [owner.address], // treasuryAddress
{
version: 3,
logOutput: false,
}));
// Upgrade to X2EarnAppsV8
// This is done here because in versions > 7 the setters have been removed.
// Setup the X2EarnApps XAllocationVote address
await x2EarnAppsV7.connect(owner).setXAllocationVotingGovernor(await xAllocationVoting.getAddress());
// Set up the X2EarnRewardsPool contract in x2EarnApps
await x2EarnAppsV7.connect(owner).setX2EarnRewardsPoolContract(await x2EarnRewardsPool.getAddress());
await x2EarnAppsV7
.connect(owner)
.setVeBetterPassportContract(await veBetterPassport.getAddress())
.then(async (tx) => await tx.wait());
// V8 flexible endorsement caps: 49 per node per app, 110 total per app
const x2EarnApps = (await (0, helpers_1.upgradeProxy)("X2EarnAppsV7", "X2EarnApps", await x2EarnAppsV7.getAddress(), [49, 110], {
version: 8,
libraries: {
AdministrationUtils: await AdministrationUtils.getAddress(),
EndorsementUtils: await EndorsementUtils.getAddress(),
VoteEligibilityUtils: await VoteEligibilityUtils.getAddress(),
AppStorageUtils: await AppStorageUtils.getAddress(),
},
}));
// Initialize NavigatorRegistry proxy (deployed early, initialized now that all dependencies are ready)
const navigatorRegistry = (await (0, helpers_1.initializeProxy)(navigatorRegistryProxyAddress, "NavigatorRegistry", [
{
admin: owner.address,
upgrader: owner.address,
governance: owner.address,
b3trToken: await b3tr.getAddress(),
vot3Token: await vot3.getAddress(),
treasury: await treasury.getAddress(),
minStake: config.NAVIGATOR_MIN_STAKE,
maxStakePercentage: config.NAVIGATOR_MAX_STAKE_PERCENTAGE,
feeLockPeriod: config.NAVIGATOR_FEE_LOCK_PERIOD,
feePercentage: config.NAVIGATOR_FEE_PERCENTAGE,
exitNoticePeriod: config.NAVIGATOR_EXIT_NOTICE_PERIOD,
reportInterval: config.NAVIGATOR_REPORT_INTERVAL,
minorSlashPercentage: config.NAVIGATOR_MINOR_SLASH_PERCENTAGE,
preferenceCutoffPeriod: config.NAVIGATOR_PREFERENCE_CUTOFF_PERIOD,
voterRewards: await voterRewards.getAddress(),
xAllocationVoting: await xAllocationVoting.getAddress(),
relayerRewardsPool: await relayerRewardsPool.getAddress(),
},
], navigatorLibraryAddresses));
const b3trChallenges = (await (0, helpers_1.deployProxy)("B3TRChallenges", [
{
b3trAddress: await b3tr.getAddress(),
veBetterPassportAddress: await veBetterPassport.getAddress(),
xAllocationVotingAddress: await xAllocationVoting.getAddress(),
x2EarnAppsAddress: await x2EarnApps.getAddress(),
maxChallengeDuration: config.CHALLENGES_MAX_DURATION,
maxSelectedApps: config.CHALLENGES_MAX_SELECTED_APPS,
maxParticipants: config.CHALLENGES_MAX_PARTICIPANTS,
minBetAmount: config.CHALLENGES_MIN_BET_AMOUNT,
},
{
admin: owner.address,
upgrader: owner.address,
contractsAddressManager: owner.address,
settingsManager: owner.address,
},
], {
ChallengeCoreLogic: await challengeCoreLogic.getAddress(),
ChallengeSettlementLogic: await challengeSettlementLogic.getAddress(),
}));
const contractAddresses = {
B3TR: await b3tr.getAddress(),
VoterRewards: await voterRewards.getAddress(),
Treasury: await treasury.getAddress(),
XAllocationVoting: await xAllocationVoting.getAddress(),
Emissions: await emissions.getAddress(),
GalaxyMember: await galaxyMember.getAddress(),
TimeLock: await timeLock.getAddress(),
VOT3: await vot3.getAddress(),
XAllocationPool: await xAllocationPool.getAddress(),
B3TRGovernor: await governor.getAddress(),
X2EarnApps: await x2EarnApps.getAddress(),
VeBetterPassport: veBetterPassportContractAddress,
B3TRChallenges: await b3trChallenges.getAddress(),
StargateNFT: await stargateNftMock.getAddress(),
DynamicBaseAllocationPool: await dynamicBaseAllocationPool.getAddress(),
NavigatorRegistry: await navigatorRegistry.getAddress(),
};
const libraries = {
B3TRGovernor: {
GovernorClockLogic: await GovernorClockLogicLib.getAddress(),
GovernorConfigurator: await GovernorConfiguratorLib.getAddress(),
GovernorDepositLogic: await GovernorDepositLogicLib.getAddress(),
GovernorFunctionRestrictionsLogic: await GovernorFunctionRestrictionsLogicLib.getAddress(),
GovernorProposalLogic: await GovernorProposalLogicLib.getAddress(),
GovernorQuorumLogic: await GovernorQuorumLogicLib.getAddress(),
GovernorStateLogic: await GovernorStateLogicLib.getAddress(),
GovernorVotesLogic: await GovernorVotesLogicLib.getAddress(),
},
X2EarnApps: {
EndorsementUtils: await EndorsementUtils.getAddress(),
AdministrationUtils: await AdministrationUtils.getAddress(),
VoteEligibilityUtils: await VoteEligibilityUtils.getAddress(),
AppStorageUtils: await AppStorageUtils.getAddress(),
},
XAllocationVoting: {
AutoVotingLogic: await xAllocLibs.AutoVotingLogic.getAddress(),
ExternalContractsUtils: await xAllocLibs.ExternalContractsUtils.getAddress(),
VotingSettingsUtils: await xAllocLibs.VotingSettingsUtils.getAddress(),