@@ -672,14 +672,31 @@ impl sp_runtime::traits::Convert<AccountId, H160> for AccountIdToH160 {
672
672
}
673
673
}
674
674
675
+ pub struct EvmForeignAssetIdFilter ;
676
+ impl frame_support:: traits:: Contains < AssetId > for EvmForeignAssetIdFilter {
677
+ fn contains ( asset_id : & AssetId ) -> bool {
678
+ use xcm_primitives:: AssetTypeGetter as _;
679
+ // We should return true only if the AssetId doesn't exist in AssetManager
680
+ AssetManager :: get_asset_type ( * asset_id) . is_none ( )
681
+ }
682
+ }
683
+
684
+ pub type ForeignAssetManagerOrigin = EitherOfDiverse <
685
+ EnsureRoot < AccountId > ,
686
+ EitherOfDiverse <
687
+ pallet_collective:: EnsureProportionMoreThan < AccountId , OpenTechCommitteeInstance , 5 , 9 > ,
688
+ governance:: custom_origins:: FastGeneralAdmin ,
689
+ > ,
690
+ > ;
691
+
675
692
impl pallet_moonbeam_foreign_assets:: Config for Runtime {
676
693
type AccountIdToH160 = AccountIdToH160 ;
677
- type AssetIdFilter = Nothing ;
694
+ type AssetIdFilter = EvmForeignAssetIdFilter ;
678
695
type EvmRunner = EvmRunnerPrecompileOrEthXcm < MoonbeamCall , Self > ;
679
- type ForeignAssetCreatorOrigin = frame_system :: EnsureNever < AccountId > ;
680
- type ForeignAssetFreezerOrigin = frame_system :: EnsureNever < AccountId > ;
681
- type ForeignAssetModifierOrigin = frame_system :: EnsureNever < AccountId > ;
682
- type ForeignAssetUnfreezerOrigin = frame_system :: EnsureNever < AccountId > ;
696
+ type ForeignAssetCreatorOrigin = ForeignAssetManagerOrigin ;
697
+ type ForeignAssetFreezerOrigin = ForeignAssetManagerOrigin ;
698
+ type ForeignAssetModifierOrigin = ForeignAssetManagerOrigin ;
699
+ type ForeignAssetUnfreezerOrigin = ForeignAssetManagerOrigin ;
683
700
type OnForeignAssetCreated = ( ) ;
684
701
type MaxForeignAssets = ConstU32 < 256 > ;
685
702
type RuntimeEvent = RuntimeEvent ;
0 commit comments