@vechain/vebetterdao-contracts
Version:
Open-source repository that houses the smart contracts powering the decentralized VeBetterDAO on the VeChain Thor blockchain.
235 lines (231 loc) • 12.2 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createLocalConfig = createLocalConfig;
const defineConfig_1 = require("../defineConfig");
const sdk_core_1 = require("@vechain/sdk-core");
const dotenv_1 = __importDefault(require("dotenv"));
const path_1 = __importDefault(require("path"));
dotenv_1.default.config({ path: path_1.default.resolve(process.cwd(), "../../.env") });
function createLocalConfig() {
return (0, defineConfig_1.defineConfig)({
NEXT_PUBLIC_APP_ENV: "local",
B3TR_GOVERNOR_QUORUM_PERCENTAGE: 4, // 4 -> Need 4% of voters to pass
TIMELOCK_MIN_DELAY: 0, //time to wait before you can execute a queued proposal, 0 for immediate execution
B3TR_GOVERNOR_DEPOSIT_THRESHOLD: 2, // Percentage of total B3TR supply needed to be deposited to create a proposal
B3TR_GOVERNOR_MIN_VOTING_DELAY: 1, // 1 -> 1 block before the vote starts
B3TR_GOVERNOR_VOTING_THRESHOLD: BigInt("1000000000000000000"), // 1 vote
//Grants proposal types
B3TR_GOVERNOR_GRANT_DEPOSIT_THRESHOLD: 2, // Percentage of total B3TR supply needed to be deposited to create a proposal
B3TR_GOVERNOR_GRANT_VOTING_THRESHOLD: BigInt("1000000000000000000"), // 1 vote
B3TR_GOVERNOR_GRANT_QUORUM_PERCENTAGE: 2, // 2 -> Need 2% of voters to pass
//Deposit threshold cap for grants and standard proposals
B3TR_GOVERNOR_GRANT_DEPOSIT_THRESHOLD_CAP: BigInt("3500000000000000000000000"), // 3.5M B3TR
B3TR_GOVERNOR_STANDARD_DEPOSIT_THRESHOLD_CAP: BigInt("5000000000000000000000000"), // 5M B3TR
// GM weight requirements for proposal types ( for tests compatibility putting to 0 )
B3TR_GOVERNOR_STANDARD_GM_WEIGHT: 0, // 0 -> No GM weight required for standard proposals
B3TR_GOVERNOR_GRANT_GM_WEIGHT: 0, // 0 -> No GM weight required for grant proposals
/*
For ambiguous functions (functions with same name), the function signature is used to differentiate them
e.g., instead of using "setVoterRewards", we use "setVoterRewards(address)"
*/
B3TR_GOVERNOR_WHITELISTED_METHODS: {
B3TR: ["tokenDetails"],
B3TRGovernor: [
"upgradeToAndCall",
"setXAllocationVoting",
"setVoterRewards",
"setMinVotingDelay",
"setWhitelistFunction",
"setIsFunctionRestrictionEnabled",
"setProposalTypeDepositThresholdPercentage",
"setProposalTypeVotingThreshold",
"setGovernanceSkipWindowBlocks",
],
Treasury: ["transferVET", "transferB3TR"],
XAllocationVoting: [
"upgradeToAndCall",
"updateQuorumNumerator",
"setVotingPeriod",
"setEmissions",
"setVotingThreshold",
"setCitizenSkipWindowBlocks",
],
X2EarnAppsV1: ["addApp", "setVotingEligibility"],
X2EarnApps: ["setVotingEligibility"],
NavigatorRegistry: ["deactivateNavigator"],
},
EMISSIONS_CYCLE_DURATION: 24, // 24 blocks - 4 minutes.
EMISSIONS_X_ALLOCATION_DECAY_PERCENTAGE: 4, // 4% decay every x-allocation decay period
EMISSIONS_VOTE_2_EARN_DECAY_PERCENTAGE: 20, // 20% decay every vote 2 earn decay period
EMISSIONS_X_ALLOCATION_DECAY_PERIOD: 12, // every 12 cycles
EMISSIONS_VOTE_2_EARN_ALLOCATION_DECAY_PERIOD: 50, // every 50 cycles
EMISSIONS_TREASURY_PERCENTAGE: 2500, // 25% of the emissions go to the treasury
EMISSIONS_MAX_VOTE_2_EARN_DECAY_PERCENTAGE: 80,
EMISSIONS_IS_NOT_ALIGNED: true,
X_ALLOCATION_VOTING_QUORUM_PERCENTAGE: 40, // 40 -> Need 40% of total supply to succeed
X_ALLOCATION_VOTING_VOTING_THRESHOLD: BigInt("1000000000000000000"), // 1 vote
X_ALLOCATION_POOL_BASE_ALLOCATION_PERCENTAGE: 30, // % of tokens from each round that are equally distributed to all apps
X_ALLOCATION_POOL_APP_SHARES_MAX_CAP: 20, // max % votes an app can receive in a round
CHALLENGES_MAX_DURATION: 4,
CHALLENGES_MAX_SELECTED_APPS: 5,
CHALLENGES_MAX_PARTICIPANTS: 100,
CHALLENGES_MIN_BET_AMOUNT: 100000000000000000000n, // 100 B3TR
CONTRACTS_ADMIN_ADDRESS: "0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa", //1st account from mnemonic of solo network
VOTE_2_EARN_POOL_ADDRESS: "0x435933c8064b4Ae76bE665428e0307eF2cCFBD68", //2nd account from mnemonic of solo network
INITIAL_X_ALLOCATION: BigInt("2000000000000000000000000"), // 2M B3TR
GM_NFT_BASE_URI: "ipfs://bafybeicz4jdfmdksq537a3cumwprvaprfuy2unc34havamwdrl7dcnnami/metadata/", // IPFS base URI for the GM NFT
/*
Level => B3TR Required
2 (Moon) => 10,000 B3TR
3 (Mercury) => 25,000 B3TR
4 (Venus) => 50,000 B3TR
5 (Mars) => 100,000 B3TR
6 (Jupiter) => 250,000 B3TR
7 (Saturn) => 500,000 B3TR
8 (Uranus) => 2,500,000 B3TR
9 (Neptune) => 5,000,000 B3TR
10 (Galaxy) => 25,000,000 B3TR
*/
GM_NFT_B3TR_REQUIRED_TO_UPGRADE_TO_LEVEL: [
10000000000000000000000n,
25000000000000000000000n,
50000000000000000000000n,
100000000000000000000000n,
250000000000000000000000n,
500000000000000000000000n,
2500000000000000000000000n,
5000000000000000000000000n,
25000000000000000000000000n,
],
/*
Vechain Node => Free Upgrade Level
None => 1
Strength => 2
Thunder => 4
Mjolnir => 6
VeThorX => 2
StrengthX => 4
ThunderX => 6
MjolnirX => 7
*/
GM_NFT_NODE_TO_FREE_LEVEL: [1, 2, 4, 6, 2, 4, 6, 7],
GM_NFT_MAX_LEVEL: 1, // 1 -> No max level BUT this value is updated to 5 in the deployAll script
VOTER_REWARDS_LEVELS: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
/*
Level => Percentage Multiplier
2 (Moon) => 10% (1.1x)
3 (Mercury) => 20% (1.2x)
4 (Venus) => 50% (1.5x)
5 (Mars) => 100% (2x)
6 (Jupiter) => 150% (2.5x)
7 (Saturn) => 200% (3x)
8 (Uranus) => 400% (5x)
9 (Neptune) => 900% (10x)
10 (Galaxy) => 2400% (25x)
*/
VOTER_REWARDS_MULTIPLIER: [0, 10, 20, 50, 100, 150, 200, 400, 900, 2400],
XAPP_BASE_URI: "ipfs://",
/*
Token transfer limits. These values are not final and are for testing purposes only.
*/
TREASURY_TRANSFER_LIMIT_VET: BigInt("200000000000000000000000"), // 200,000 VET
TREASURY_TRANSFER_LIMIT_B3TR: BigInt("100000000000000000000000000"), // 100,000,000 B3TR
TREASURY_TRANSFER_LIMIT_VTHO: BigInt("3000000000000000000000000"), // 3,000,000 VTHO
TREASURY_TRANSFER_LIMIT_VOT3: BigInt("500000000000000000000000"), // 50,000 VOT3
// Migration
MIGRATION_ADDRESS: "0x865306084235Bf804c8Bba8a8d56890940ca8F0b", // 10th account from mnemonic of solo network
MIGRATION_AMOUNT: BigInt("3750000000000000000000000"), // 3.75 million B3TR tokens from pilot show
// Version 2
XAPP_GRACE_PERIOD: 46, // 2 cycles - 8 minutes
// X 2 Earn Rewards Pool
X_2_EARN_INITIAL_IMPACT_KEYS: [
"carbon",
"water",
"energy",
"waste_mass",
"education_time",
"timber",
"plastic",
"trees_planted",
],
// VeBetterPassport
VEPASSPORT_BOT_SIGNALING_THRESHOLD: 2,
VEPASSPORT_ROUNDS_FOR_CUMULATIVE_PARTICIPATION_SCORE: 12,
VEPASSPORT_GALAXY_MEMBER_MINIMUM_LEVEL: 2,
VEPASSPORT_BLACKLIST_THRESHOLD_PERCENTAGE: 20,
VEPASSPORT_WHITELIST_THRESHOLD_PERCENTAGE: 20,
VEPASSPORT_PASSPORT_MAX_ENTITIES: 5,
VEPASSPORT_DECAY_RATE: 0,
CREATOR_NFT_URI: "ipfs://bafybeie2onvzl3xsod5becuswpdmi63gtq7wgjqhqjecehytt7wdeg4py4/metadata/1.json",
//WARNING: Cooldown depends on the current round. If the current round is 1, the cooldown cannot be greater than 1. Otherwise the endorsement will fail.
//Check `EndorsementUtils.sol` `checkCooldown` method for more details.
X2EARN_NODE_COOLDOWN_PERIOD: 0, // 0 rounds -> UPDATED to 1 in the deployAll script
X2EARN_ENDORSEMENT_SCORE_THRESHOLD: 1,
MULTI_SIG_SIGNERS: [
"0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa",
"0x435933c8064b4Ae76bE665428e0307eF2cCFBD68",
"0x0F872421Dc479F3c11eDd89512731814D0598dB5",
],
GM_PERCENTAGE_OF_TREASURY: 2500, // 25% of the treasury will be used for GM Holder Rewards
GM_MULTIPLIERS_V2: [110, 120, 150, 200, 250, 300, 500, 1000, 2500], // GM multipiers scaled -> [1.1x, 1.2x, 1.5x, 2x, 2.5x, 3x, 5x, 10x, 25x]
VOTER_REWARDS_LEVELS_V2: [2, 3, 4, 5, 6, 7, 8, 9, 10], // Voter rewards levels for the new GM multipliers
// Rewards Multipliers (basis points, 10000 = 1x)
VOTER_REWARDS_FRESHNESS_MULTIPLIER_TIER1: 30000, // Updated this round (x3)
VOTER_REWARDS_FRESHNESS_MULTIPLIER_TIER2: 20000, // Updated within 2 rounds (x2)
VOTER_REWARDS_FRESHNESS_MULTIPLIER_TIER3: 10000, // No update >= 3 rounds (x1)
VOTER_REWARDS_INTENT_MULTIPLIER_FOR_AGAINST: 10000, // For/Against vote (x1)
VOTER_REWARDS_INTENT_MULTIPLIER_ABSTAIN: 3000, // Abstain vote (x0.30)
/*
Level => B3TR Required (halved)
2 (Moon) => 5,000 B3TR
3 (Mercury) => 12,500 B3TR
4 (Venus) => 25,000 B3TR
5 (Mars) => 50,000 B3TR
6 (Jupiter) => 125,000 B3TR
7 (Saturn) => 250,000 B3TR
8 (Uranus) => 1,250,000 B3TR
9 (Neptune) => 2,500,000 B3TR
10 (Galaxy) => 12,500,000 B3TR
*/
GM_NFT_B3TR_REQUIRED_TO_UPGRADE_TO_LEVEL_V2: [
5000000000000000000000n,
12500000000000000000000n,
25000000000000000000000n,
50000000000000000000000n,
125000000000000000000000n,
250000000000000000000000n,
1250000000000000000000000n,
2500000000000000000000000n,
12500000000000000000000000n,
],
// Stargate contracts - This needs to be deployed first before starting b3tr repo
VECHAIN_NODES_CONTRACT_ADDRESS: process.env.LOCAL_VECHAIN_NODES_CONTRACT_ADDRESS || sdk_core_1.ZERO_ADDRESS,
// Stargate and NFTs related contracts -> they are already deployed from stargate project
// See from more details: {https://github.com/vechain/stargate-contracts/blob/main/README.md }
//TODO: Fix this
STARGATE_CONTRACT_ADDRESS: sdk_core_1.ZERO_ADDRESS,
STARGATE_NFT_CONTRACT_ADDRESS: sdk_core_1.ZERO_ADDRESS,
STARGATE_DELEGATE_CONTRACT_ADDRESS: sdk_core_1.ZERO_ADDRESS,
NODE_MANAGEMENT_CONTRACT_ADDRESS: sdk_core_1.ZERO_ADDRESS,
// Milestones
MINIMUM_MILESTONE_COUNT: 2, // test-compatibility,
// XAllocationPoolV7 unallocated funds
X_ALLOCATION_POOL_UNALLOCATED_FUNDS_ROUND_IDS: [],
X_ALLOCATION_POOL_UNALLOCATED_FUNDS_V7: [],
DBA_DISTRIBUTION_START_ROUND: 1,
// Navigator Registry
NAVIGATOR_MIN_STAKE: 500n * 10n ** 18n, // 50,000 B3TR
NAVIGATOR_MAX_STAKE_PERCENTAGE: 100, // 1% of VOT3 supply
NAVIGATOR_FEE_LOCK_PERIOD: 4, // 4 rounds
NAVIGATOR_FEE_PERCENTAGE: 2000, // 20% in basis points
NAVIGATOR_EXIT_NOTICE_PERIOD: 1, // 1 round
NAVIGATOR_REPORT_INTERVAL: 2, // every 2 rounds
NAVIGATOR_MINOR_SLASH_PERCENTAGE: 500, // 5% in basis points
NAVIGATOR_PREFERENCE_CUTOFF_PERIOD: 5, // 5 blocks, around 50 seconds
XALLOCATION_CITIZEN_SKIP_WINDOW_BLOCKS: 12, // 12 blocks (~2 min)
B3TR_GOVERNOR_SKIP_WINDOW_BLOCKS: 12, // 12 blocks (~2 min)
});
}