Skip to main content

ve3_shared/
constants.rs

1// AT = Address Type
2pub const AT_DELEGATION_CONTROLLER: &str = "DELEGATION_CONTROLLER";
3pub const AT_ASSET_WHITELIST_CONTROLLER: &str = "ASSET_WHITELIST_CONTROLLER";
4pub const AT_BRIBE_WHITELIST_CONTROLLER: &str = "BRIBE_WHITELIST_CONTROLLER";
5pub const AT_VE_GUARDIAN: &str = "VE_GUARDIAN";
6
7pub const AT_VOTING_ESCROW: &str = "VOTING_ESCROW";
8pub const AT_ASSET_GAUGE: &str = "ASSET_GAUGE";
9pub const AT_BRIBE_MANAGER: &str = "BRIBE_MANAGER";
10
11pub const AT_FREE_BRIBES: &str = "FREE_BRIBES";
12pub const AT_TAKE_RECIPIENT: &str = "TAKE_RECIPIENT";
13pub const AT_FEE_COLLECTOR: &str = "FEE_COLLECTOR";
14pub const AT_TEAM_WALLET: &str = "TEAM_WALLET";
15pub const AT_MINT_PROXY: &str = "MINT_PROXY";
16
17const AT_ASSET_STAKING: &str = "ASSET_STAKING";
18pub fn at_asset_staking(gauge: &str) -> String {
19  format!("{AT_ASSET_STAKING}__{gauge}")
20}
21const AT_CONNECTOR: &str = "CONNECTOR";
22pub fn at_connector(gauge: &str) -> String {
23  format!("{AT_CONNECTOR}__{gauge}")
24}
25
26pub const DEFAULT_LIMIT: u32 = 30;
27pub const DEFAULT_PERIODS_LIMIT: u64 = 20;
28pub const MAX_LIMIT: u32 = 100;
29
30pub const SECONDS_PER_YEAR: u64 = 60 * 60 * 24 * 365;
31
32// VOTING ESCROW
33// Seconds in one week. It is intended for period number calculation.
34// mainnet: 7 * 86400
35// testnet: 60 * 60
36pub const SECONDS_PER_WEEK: u64 = 7 * 86400;
37/// Seconds in 2 years which is the maximum lock period.
38pub const MAX_LOCK_TIME: u64 = 2 * 365 * 86400;
39// 2 years (104 weeks)
40pub const MAX_LOCK_PERIODS: u64 = 104;
41/// Funds need to be at least locked for 3 weeks.
42pub const MIN_LOCK_PERIODS: u64 = 1;
43/// Monday, October 31, 2022 12:00:00 AM
44pub const EPOCH_START: u64 = 1667174400;