@@ -438,7 +438,7 @@ impl xcm_executor::Config for XcmConfig {
438438 type MessageExporter = ( ) ;
439439 type UniversalAliases = ( bridging:: to_polkadot:: UniversalAliases , ) ;
440440 type CallDispatcher = RuntimeCall ;
441- type SafeCallFilter = Everything ;
441+ type SafeCallFilter = SafeCallFilter ;
442442 type Aliasers = TrustedAliasers ;
443443 type TransactionalProcessor = FrameTransactionalProcessor ;
444444 type HrmpNewChannelOpenRequestHandler = ( ) ;
@@ -447,6 +447,69 @@ impl xcm_executor::Config for XcmConfig {
447447 type XcmEventEmitter = PolkadotXcm ;
448448}
449449
450+ pub struct SafeCallFilter ;
451+ impl Contains < RuntimeCall > for SafeCallFilter {
452+ fn contains ( call : & RuntimeCall ) -> bool {
453+ match call {
454+ RuntimeCall :: Balances ( pallet_balances:: Call :: transfer_keep_alive { .. } ) => true ,
455+ // Foreign assets instance
456+ RuntimeCall :: ForeignAssets ( pallet_assets:: Call :: <
457+ Runtime ,
458+ crate :: ForeignAssetsInstance ,
459+ > :: create {
460+ ..
461+ } ) => true ,
462+ RuntimeCall :: ForeignAssets ( pallet_assets:: Call :: <
463+ Runtime ,
464+ crate :: ForeignAssetsInstance ,
465+ > :: force_set_metadata {
466+ ..
467+ } ) => true ,
468+ RuntimeCall :: ForeignAssets ( pallet_assets:: Call :: <
469+ Runtime ,
470+ crate :: ForeignAssetsInstance ,
471+ > :: set_metadata {
472+ ..
473+ } ) => true ,
474+ RuntimeCall :: ForeignAssets ( pallet_assets:: Call :: <
475+ Runtime ,
476+ crate :: ForeignAssetsInstance ,
477+ > :: set_team {
478+ ..
479+ } ) => true ,
480+ RuntimeCall :: ForeignAssets ( pallet_assets:: Call :: <
481+ Runtime ,
482+ crate :: ForeignAssetsInstance ,
483+ > :: touch {
484+ ..
485+ } ) => true ,
486+ RuntimeCall :: Nfts ( pallet_nfts:: Call :: create { .. } ) => true ,
487+ RuntimeCall :: PolkadotXcm ( pallet_xcm:: Call :: force_subscribe_version_notify {
488+ ..
489+ } ) => true ,
490+ RuntimeCall :: PolkadotXcm ( pallet_xcm:: Call :: force_xcm_version { .. } ) => true ,
491+ // Allow staking stuff through XCM
492+ RuntimeCall :: Staking ( pallet_staking_async:: Call :: bond_extra { .. } ) => true ,
493+ RuntimeCall :: Staking ( pallet_staking_async:: Call :: rebond { .. } ) => true ,
494+ RuntimeCall :: Staking ( pallet_staking_async:: Call :: unbond { .. } ) => true ,
495+ RuntimeCall :: Staking ( pallet_staking_async:: Call :: withdraw_unbonded { .. } ) => true ,
496+ RuntimeCall :: System ( frame_system:: Call :: authorize_upgrade { .. } ) => true ,
497+ RuntimeCall :: System ( frame_system:: Call :: set_storage { .. } ) => true ,
498+ RuntimeCall :: ToPolkadotXcmRouter ( pallet_xcm_bridge_hub_router:: Call :: <
499+ Runtime ,
500+ crate :: ToPolkadotXcmRouterInstance ,
501+ > :: report_bridge_status {
502+ ..
503+ } ) => true ,
504+ RuntimeCall :: Utility ( pallet_utility:: Call :: as_derivative { .. } ) => true ,
505+ RuntimeCall :: Utility ( pallet_utility:: Call :: batch_all { .. } ) => true ,
506+ RuntimeCall :: Utility ( pallet_utility:: Call :: force_batch { .. } ) => true ,
507+ RuntimeCall :: Whitelist ( pallet_whitelist:: Call :: whitelist_call { .. } ) => true ,
508+ _ => false ,
509+ }
510+ }
511+ }
512+
450513parameter_types ! {
451514 // StakingAdmin pluralistic body.
452515 pub const StakingAdminBodyId : BodyId = BodyId :: Defense ;
0 commit comments