diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index d140b00695..b98dcae097 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -1377,119 +1377,10 @@ pub type Executive = frame_executive::Executive< Migrations, >; -parameter_types! { - pub const BlockRewardName: &'static str = "BlockReward"; -} /// All migrations that will run on the next runtime upgrade. /// /// Once done, migrations should be removed from the tuple. -pub type Migrations = ( - // The following 4 migrations should be done as part of shibuya-118 upgrade. - pallet_inflation::PalletInflationInitConfig, - pallet_dapp_staking_v3::DAppStakingV3InitConfig, - frame_support::migrations::RemovePallet< - BlockRewardName, - ::DbWeight, - >, - // This will handle new pallet storage version setting & it will put the new pallet into maintenance mode. - // But it's most important for testing with try-runtime. - pallet_dapp_staking_migration::DappStakingMigrationHandler, -); - -/// Used to initialize inflation parameters for the runtime. -pub struct InitInflationParams; -impl Get for InitInflationParams { - fn get() -> pallet_inflation::InflationParameters { - pallet_inflation::InflationParameters { - // Recalculation is done every two weeks, hence the small %. - max_inflation_rate: Perquintill::from_percent(1), - treasury_part: Perquintill::from_percent(5), - collators_part: Perquintill::from_percent(3), - dapps_part: Perquintill::from_percent(20), - base_stakers_part: Perquintill::from_percent(25), - adjustable_stakers_part: Perquintill::from_percent(35), - bonus_part: Perquintill::from_percent(12), - ideal_staking_rate: Perquintill::from_percent(20), - } - } -} - -use frame_support::BoundedVec; -use pallet_dapp_staking_v3::{EraNumber, TierParameters, TiersConfiguration}; -type NumberOfTiers = ::NumberOfTiers; -/// Used to initialize dApp staking parameters for the runtime. -pub struct InitDappStakingv3Params; -impl - Get<( - EraNumber, - TierParameters, - TiersConfiguration, - )> for InitDappStakingv3Params -{ - fn get() -> ( - EraNumber, - TierParameters, - TiersConfiguration, - ) { - // 1. Prepare init values - - // Init era of dApp staking v3 should be the next era after dApp staking v2 - let init_era = pallet_dapps_staking::CurrentEra::::get().saturating_add(1); - - // Reward portions according to the Tokenomics 2.0 report - let reward_portion = BoundedVec::try_from(vec![ - Permill::from_percent(40), - Permill::from_percent(30), - Permill::from_percent(20), - Permill::from_percent(10), - ]) - .unwrap_or_default(); - - // Tier thresholds adjusted according to numbers observed on Shibuya - let tier_thresholds = BoundedVec::try_from(vec![ - TierThreshold::DynamicTvlAmount { - amount: SBY.saturating_mul(1_000_000), - minimum_amount: SBY.saturating_mul(150_000), - }, - TierThreshold::DynamicTvlAmount { - amount: SBY.saturating_mul(100_000), - minimum_amount: SBY.saturating_mul(60_000), - }, - TierThreshold::DynamicTvlAmount { - amount: SBY.saturating_mul(50_000), - minimum_amount: SBY.saturating_mul(15_000), - }, - TierThreshold::FixedTvlAmount { - amount: SBY.saturating_mul(10_000), - }, - ]) - .unwrap_or_default(); - - // 2. Tier params - let tier_params = - TierParameters::<::NumberOfTiers> { - reward_portion: reward_portion.clone(), - slot_distribution: BoundedVec::try_from(vec![ - Permill::from_percent(10), - Permill::from_percent(20), - Permill::from_percent(30), - Permill::from_percent(40), - ]) - .unwrap_or_default(), - tier_thresholds: tier_thresholds.clone(), - }; - - // 3. Init tier config - let init_tier_config = TiersConfiguration { - number_of_slots: 100, - slots_per_tier: BoundedVec::try_from(vec![10, 20, 30, 40]).unwrap_or_default(), - reward_portion, - tier_thresholds, - }; - - (init_era, tier_params, init_tier_config) - } -} +pub type Migrations = (); type EventRecord = frame_system::EventRecord< ::RuntimeEvent,