Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Statemint as Combinations of (Location, Asset) pairs which Pendulum trust as reserves. #174

Closed
RustNinja opened this issue Mar 17, 2023 · 0 comments · Fixed by #192
Closed
Assignees
Labels

Comments

@RustNinja
Copy link
Contributor

RustNinja commented Mar 17, 2023

Need to add configuration of Combination of (Location, Asset) to pendulum xcm_config.rs

Reproduce step:
here is extrinsic for Stetemint to check reserve transfer assets for Statemint USDT to Pendulum chain.

encoded call data
0x1f0801010100b92001000101004e5d80a091a712b727ecbb00882bb28d4d64a6e7f6c87654b3243c489623f5100104000002043205011f0002093d000000000000

Here is the pendulum block details where xcmpQueue pallet emit Fail event with error UntrustedReserveLocation
error description

IsReserve is configuration for trustable chain as reserve chain for assets. link to polkadot repo

Now pendulum support only Native assets in xcm_executor config

https://github.com/pendulum-chain/pendulum/blob/main/runtime/pendulum/src/xcm_config.rs#L243

pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
	...
	type IsReserve = NativeAsset;
	...
}

need update configuration to following:

/// A `FilterAssetLocation` implementation. Filters multi native assets whose
/// reserve is same with `origin`.
pub struct MultiNativeAsset<ReserveProvider>(PhantomData<ReserveProvider>);
impl<ReserveProvider> FilterAssetLocation for MultiNativeAsset<ReserveProvider>
where
	ReserveProvider: Reserve,
{
	fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool {
		if let Some(ref reserve) = ReserveProvider::reserve(asset) {
			if reserve == origin {
				return true;
			}
		}
		false
	}
}

type IsReserve = MultiNativeAsset<RelativeReserveProvider>;

@ebma ebma added the priority:medium Do it soon label Mar 20, 2023
@erasmus erasmus changed the title Add Satemint as Combinations of (Location, Asset) pairs which Pendulum trust as reserves. Add Statemint as Combinations of (Location, Asset) pairs which Pendulum trust as reserves. Mar 21, 2023
@RustNinja RustNinja self-assigned this Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment