Add a new instance of the Assets pallet to Statemint. This should be configured such that:
pub type ForeignAssets = pallet_assets::Instance2;
impl pallet_assets::Config<ForeignAssets> for Runtime {
// snip...
type AssetId = MultiLocation;
type CreateOrigin = ForeignCreators;
}
pub struct ForeignCreators;
impl EnsureOriginWithArg<RuntimeOrigin, MultiLocation> for ForeignCreators {
type Success = AccountId;
fn try_origin(
o: RuntimeOrigin,
a: &MultiLocation,
) -> sp_std::result::Result<Self::Success, RuntimeOrigin> {
// impl...
}
}
An example can be found in the gav-xcm-v3 branch of the XCM simulator.
This pallet will support assets from other parachains, and in XCM v3, from other consensus systems. For example:
// GLMR
asset_id = MultiLocation { parents: 1, interior: X1(Parachain(2004)) }
// xc20 token on Moonbeam
asset_id = MultiLocation { parents: 1, interior: X2(Parachain(2004), AccountId20(None, contract_address)) }
// ETH
asset_id = MultiLocation { parents: 2, interior: X1(GlobalConsensus(Ethereum)) }
Add a new instance of the Assets pallet to Statemint. This should be configured such that:
An example can be found in the gav-xcm-v3 branch of the XCM simulator.
This pallet will support assets from other parachains, and in XCM v3, from other consensus systems. For example: