2024-03-27 14:46:15 +03:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
|
|
|
|
#![cfg_attr(not(feature = "std"), no_std)]
|
|
|
|
|
|
2024-04-20 10:53:25 +03:00
|
|
|
#[cfg(feature = "std")]
|
|
|
|
|
use zeroize::Zeroize;
|
|
|
|
|
|
|
|
|
|
#[cfg(feature = "borsh")]
|
|
|
|
|
use borsh::{BorshSerialize, BorshDeserialize};
|
|
|
|
|
#[cfg(feature = "serde")]
|
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
|
|
|
|
|
use sp_std::vec::Vec;
|
|
|
|
|
|
|
|
|
|
use scale::{Encode, Decode, MaxEncodedLen};
|
|
|
|
|
use scale_info::TypeInfo;
|
|
|
|
|
|
2024-03-27 14:46:15 +03:00
|
|
|
use serai_primitives::*;
|
2024-04-20 10:53:25 +03:00
|
|
|
use validator_sets_primitives::ValidatorSet;
|
2024-03-27 14:46:15 +03:00
|
|
|
|
|
|
|
|
// amount of blocks in 30 days for 6s per block.
|
|
|
|
|
pub const BLOCKS_PER_MONTH: u32 = 10 * 60 * 24 * 30;
|
|
|
|
|
|
|
|
|
|
/// 180 days of blocks
|
|
|
|
|
pub const GENESIS_SRI_TRICKLE_FEED: u64 = 10 * 60 * 24 * 180;
|
|
|
|
|
|
|
|
|
|
// 100 Million SRI
|
|
|
|
|
pub const GENESIS_SRI: u64 = 100_000_000 * 10_u64.pow(8);
|
|
|
|
|
|
2024-03-29 11:38:48 +03:00
|
|
|
// This is the account to hold and manage the genesis liquidity.
|
2024-03-27 14:46:15 +03:00
|
|
|
pub const GENESIS_LIQUIDITY_ACCOUNT: SeraiAddress = system_address(b"Genesis-liquidity-account");
|
2024-04-20 10:53:25 +03:00
|
|
|
|
|
|
|
|
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, MaxEncodedLen, TypeInfo)]
|
|
|
|
|
#[cfg_attr(feature = "std", derive(Zeroize))]
|
|
|
|
|
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
|
|
|
|
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
|
|
|
|
pub struct Prices {
|
|
|
|
|
pub bitcoin: u64,
|
|
|
|
|
pub monero: u64,
|
|
|
|
|
pub ethereum: u64,
|
|
|
|
|
pub dai: u64,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// The message for the set_initial_price signature.
|
|
|
|
|
pub fn set_initial_price_message(set: &ValidatorSet, prices: &Prices) -> Vec<u8> {
|
|
|
|
|
(b"GenesisLiquidity-set_initial_price", set, prices).encode()
|
|
|
|
|
}
|