1234567891011121314151617use frame_support::{18 match_types, parameter_types,19 traits::{Get, Everything},20};21use sp_std::{vec, vec::Vec};22use xcm::v1::{Junction::*, Junctions::*, MultiLocation};23use xcm_builder::{24 AllowKnownQueryResponses, AllowSubscriptionsFrom, TakeWeightCredit,25 AllowTopLevelPaidExecutionFrom,26};2728use crate::{29 ParachainInfo, PolkadotXcm,30 runtime_common::config::xcm::{DenyThenTry, DenyTransact, DenyExchangeWithUnknownLocation},31};3233match_types! {34 pub type ParentOrSiblings: impl Contains<MultiLocation> = {35 MultiLocation { parents: 1, interior: Here } |36 MultiLocation { parents: 1, interior: X1(_) }37 };38}3940parameter_types! {41 pub UniqueAllowedLocations: Vec<MultiLocation> = vec![42 43 MultiLocation {44 parents: 0,45 interior: Here,46 },47 48 MultiLocation {49 parents: 1,50 interior: Here,51 },52 53 MultiLocation {54 parents: 1,55 interior: X1(Parachain(2000)),56 },57 58 MultiLocation {59 parents: 1,60 interior: X1(Parachain(2004)),61 },62 63 MultiLocation {64 parents: 1,65 interior: X1(Parachain(ParachainInfo::get().into())),66 },67 ];68}6970pub type Barrier = DenyThenTry<71 (72 DenyTransact,73 DenyExchangeWithUnknownLocation<UniqueAllowedLocations>,74 ),75 (76 TakeWeightCredit,77 AllowTopLevelPaidExecutionFrom<Everything>,78 79 AllowKnownQueryResponses<PolkadotXcm>,80 81 AllowSubscriptionsFrom<ParentOrSiblings>,82 ),83>;