Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Add Additional Instance of Assets Pallet to Statemint #1856

@joepetrowski

Description

@joepetrowski

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)) }

Metadata

Metadata

Assignees

No one assigned

    Labels

    J0-enhancementAn additional feature request.S1-implementIssue is in the implementation stage.T1-runtimeThis PR/Issue is related to the topic “runtime”.T5-parachainsThis PR/Issue is related to Parachains.T7-system_parachainsThis PR/Issue is related to System Parachains.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions