diff --git a/pallets/system-staking/src/lib.rs b/pallets/system-staking/src/lib.rs index 9f6f8daee3..13d32627c2 100644 --- a/pallets/system-staking/src/lib.rs +++ b/pallets/system-staking/src/lib.rs @@ -87,7 +87,7 @@ pub mod pallet { >; #[pallet::constant] - type TreasuryAccount: Get; + type BenefitReceivingAccount: Get; /// Max token length 500 #[pallet::constant] @@ -509,7 +509,7 @@ pub mod pallet { Ok(().into()) } - /// payout to treasury + /// payout to receiving account #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::payout())] pub fn payout(origin: OriginFor, token: CurrencyIdOf) -> DispatchResultWithPostInfo { @@ -539,11 +539,11 @@ pub mod pallet { token_amount, )?; - // Transfer vtoken(benefits) to TreasuryAccount + // Transfer vtoken(benefits) to BenefitReceivingAccount T::MultiCurrency::transfer( vtoken_id, &pallet_account, - &T::TreasuryAccount::get(), + &T::BenefitReceivingAccount::get(), vtoken_amount, ) .map_err(|_| Error::::PayoutFailed)?; @@ -552,7 +552,7 @@ pub mod pallet { token, vtoken: vtoken_id, from: pallet_account, - to: T::TreasuryAccount::get(), + to: T::BenefitReceivingAccount::get(), amount: vtoken_amount, vfree: vfree_amount, free: free_amount, diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index 4bd238afb6..b70453057f 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -59,6 +59,8 @@ pub const BOB: AccountId = AccountId32::new([1u8; 32]); pub const CHARLIE: AccountId = AccountId32::new([3u8; 32]); pub const TREASURY_ACCOUNT: AccountId32 = AccountId32::new([9u8; 32]); +pub const BENEFIT_RECEIVING_ACCOUNT: AccountId32 = AccountId32::new([9u8; 32]); + frame_support::construct_runtime!( pub enum Runtime { System: frame_system, @@ -79,6 +81,7 @@ type Block = frame_system::mocking::MockBlock; parameter_types! { pub const BlockHashCount: u64 = 250; + pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; } #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] @@ -296,7 +299,7 @@ impl bifrost_farming::Config for Runtime { } parameter_types! { - pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; + pub const BenefitReceivingAccount: AccountId32 = BENEFIT_RECEIVING_ACCOUNT; pub const BlocksPerRound: u32 = 5; pub const MaxTokenLen: u32 = 50; pub const MaxFarmingPoolIdLen: u32 = 100; @@ -309,7 +312,7 @@ impl system_staking::Config for Runtime { type WeightInfo = (); type FarmingInfo = Farming; type VtokenMintingInterface = VtokenMinting; - type TreasuryAccount = TreasuryAccount; + type BenefitReceivingAccount = BenefitReceivingAccount; type PalletId = SystemStakingPalletId; type BlocksPerRound = BlocksPerRound; type MaxTokenLen = MaxTokenLen; diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 8db4a7d525..e1147cb073 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -1417,7 +1417,7 @@ impl bifrost_system_staking::Config for Runtime { type WeightInfo = weights::bifrost_system_staking::BifrostWeight; type FarmingInfo = Farming; type VtokenMintingInterface = VtokenMinting; - type TreasuryAccount = BifrostTreasuryAccount; + type BenefitReceivingAccount = BifrostTreasuryAccount; type PalletId = SystemStakingPalletId; type BlocksPerRound = BlocksPerRound; type MaxTokenLen = MaxTokenLen; diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 13fbc77677..c15088ba9e 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1159,6 +1159,7 @@ parameter_types! { pub const BlocksPerRound: u32 = prod_or_fast!(1500, 50); pub const MaxTokenLen: u32 = 500; pub const MaxFarmingPoolIdLen: u32 = 100; + pub BenefitReceivingAccount: AccountId = FeeSharePalletId::get().into_account_truncating(); } impl bifrost_system_staking::Config for Runtime { @@ -1168,7 +1169,7 @@ impl bifrost_system_staking::Config for Runtime { type WeightInfo = weights::bifrost_system_staking::BifrostWeight; type FarmingInfo = Farming; type VtokenMintingInterface = VtokenMinting; - type TreasuryAccount = BifrostTreasuryAccount; + type BenefitReceivingAccount = BenefitReceivingAccount; type PalletId = SystemStakingPalletId; type BlocksPerRound = BlocksPerRound; type MaxTokenLen = MaxTokenLen; @@ -1496,7 +1497,7 @@ impl leverage_staking::Config for Runtime { parameter_types! { pub const ClearingDuration: u32 = prod_or_fast!(1 * DAYS, 10 * MINUTES); pub const NameLengthLimit: u32 = 20; - pub BifrostCommissionReceiver: AccountId = TreasuryPalletId::get().into_account_truncating(); + pub BifrostCommissionReceiver: AccountId = FeeSharePalletId::get().into_account_truncating(); } impl bifrost_channel_commission::Config for Runtime {