diff --git a/pallets/proof-of-stake/src/lib.rs b/pallets/proof-of-stake/src/lib.rs index de8bec341..e9c0a0e51 100644 --- a/pallets/proof-of-stake/src/lib.rs +++ b/pallets/proof-of-stake/src/lib.rs @@ -172,7 +172,7 @@ use sp_runtime::traits::AccountIdConversion; use frame_support::{ pallet_prelude::*, - traits::{tokens::currency::MultiTokenCurrency, ExistenceRequirement, Get}, + traits::{tokens::currency::MultiTokenCurrency, Contains, ExistenceRequirement, Get}, transactional, }; @@ -446,6 +446,9 @@ pub mod pallet { type WeightInfo: WeightInfo; type ValuationApi: ValutationApiTrait; + + /// Tokens which cannot be transfered by extrinsics/user or use in pool, unless foundation override + type NontransferableTokens: Contains>; } #[pallet::error] @@ -483,6 +486,8 @@ pub mod pallet { NoThirdPartyPartyRewardsToClaim, // cannot promote solo token SoloTokenPromotionForbiddenError, + /// Asset cannot be used for rewards + NontransferableToken, } #[pallet::event] @@ -770,6 +775,12 @@ pub mod pallet { schedule_end: SessionId, ) -> DispatchResult { let sender = ensure_signed(origin)?; + + ensure!( + !T::NontransferableTokens::contains(&token_id), + Error::::NontransferableToken + ); + Self::reward_pool_impl(sender, pool, token_id, amount, schedule_end) } @@ -792,6 +803,11 @@ pub mod pallet { ) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; + ensure!( + !T::NontransferableTokens::contains(&reward_token), + Error::::NontransferableToken + ); + Self::activate_liquidity_for_3rdparty_rewards_impl( sender, liquidity_token_id, diff --git a/rollup/runtime/src/lib.rs b/rollup/runtime/src/lib.rs index 01a9aa3fb..3882a79cb 100644 --- a/rollup/runtime/src/lib.rs +++ b/rollup/runtime/src/lib.rs @@ -363,6 +363,7 @@ impl pallet_proof_of_stake::Config for Runtime { type Min3rdPartyRewardVolume = cfg::pallet_proof_of_stake::Min3rdPartyRewardVolume; type SchedulesPerBlock = cfg::pallet_proof_of_stake::SchedulesPerBlock; type ValuationApi = Xyk; + type NontransferableTokens = tokens::NontransferableTokens; } impl pallet_bootstrap::BootstrapBenchmarkingConfig for Runtime {}