diff --git a/cumulus/polkadot-parachains/statemint/src/lib.rs b/cumulus/polkadot-parachains/statemint/src/lib.rs index 61799c7ccd..ade13cc1e5 100644 --- a/cumulus/polkadot-parachains/statemint/src/lib.rs +++ b/cumulus/polkadot-parachains/statemint/src/lib.rs @@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ construct_runtime, match_type, parameter_types, - traits::{Everything, InstanceFilter, Nothing}, + traits::{Contains, Everything, InstanceFilter, Nothing}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight}, DispatchClass, IdentityFee, Weight, @@ -127,9 +127,21 @@ parameter_types! { pub const SS58Prefix: u8 = 0; } +pub struct BaseFilter; +impl Contains for BaseFilter { + fn contains(c: &Call) -> bool { + // Disable permissionless asset creation. + !matches!( + c, + Call::Assets(pallet_assets::Call::create { .. }) | + Call::Uniques(pallet_uniques::Call::create { .. }) + ) + } +} + // Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { - type BaseCallFilter = frame_support::traits::Everything; + type BaseCallFilter = BaseFilter; type BlockWeights = RuntimeBlockWeights; type BlockLength = RuntimeBlockLength; type AccountId = AccountId;