2

I am currently successfully able to transfer ROC from Rococo to a parachain using a Reserve Asset Transfer. However when I want to transfer some of the ROC from our parachain back to Rococo but when I use ReserveAssetTransfer the following happens

  • The asset balance gets reduced for the account but the total balance on the parachain stays the same (I assume it is stored on a Sovereign Account)
  • Message seems to be processed successfully on both the parachain and Rococo but the ROC balance on Rococo has not been updated

A similar issue occurs when I am trying to Teleport the asset - the balance on Rococo does not update but the balance on the parachain is burned this time.

Here is a copy of the parachain current xcm_executor config:

pub type LocalAssetTransactor = CurrencyAdapter<
    Balances,
    IsConcrete<SelfLocation>,
    LocationToAccountId,
    AccountId,
    (),
>;

pub type TrustBackedAssetsConvertedConcreteId =
    assets_common::TrustBackedAssetsConvertedConcreteId<AssetsPalletLocation, Balance>;

pub type FungiblesTransactor = FungiblesAdapter<
    Assets,
    ConvertedRegisteredAssetId<
        AssetIdForTrustBackedAssets,
        Balance,
        AsAssetMultiLocation<AssetIdForTrustBackedAssets, AssetRegistry>,
        JustTry,
    >,
    LocationToAccountId,
    AccountId,
    NoChecking,
    PlaceholderAccount,
>;

pub type AssetTransactors = (LocalAssetTransactor, FungiblesTransactor);

pub type Barrier = TrailingSetTopicAsId<(
    TakeWeightCredit,
    AllowKnownQueryResponses<PolkadotXcm>,
    WithComputedOrigin<
        (
            AllowTopLevelPaidExecutionFrom<Everything>,
            AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
            AllowSubscriptionsFrom<ParentOrSiblings>,
        ),
        UniversalLocation,
        ConstU32<8>,
    >,
)>;    

pub type Traders = (
    FixedRateOfFungible<RUsdtPerSecond, ()>,
    FixedRateOfFungible<RUsdPerSecond, ()>,
    FixedRateOfFungible<RocPerSecond, ()>,
    UsingComponents<WeightToFee, SelfReserve, AccountId, Balances, ToAuthor<Runtime>>,
);
pub type Reserves = (NativeAsset, ReserveAssetsFrom<AssetHubLocation>);
pub type TrustedTeleporters = (xcm_builder::Case<AssetHubTrustedTeleporter>,);

pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
    type Aliasers = Nothing;
    type AssetClaims = PolkadotXcm;
    type AssetExchanger = ();
    type AssetLocker = ();
    type AssetTransactor = AssetTransactors;
    type AssetTrap = PolkadotXcm;
    type Barrier = Barrier;
    type CallDispatcher = RuntimeCall;
    type FeeManager = ();
    type IsReserve = Reserves;
    type IsTeleporter = TrustedTeleporters;
    type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
    type MessageExporter = ();
    type OriginConverter = XcmOriginToTransactDispatchOrigin;
    type PalletInstancesInfo = AllPalletsWithSystem;
    type ResponseHandler = PolkadotXcm;
    type RuntimeCall = RuntimeCall;
    type SafeCallFilter = Everything;
    type SubscriptionService = PolkadotXcm;
    type Trader = Traders;
    type UniversalAliases = Nothing;
    type UniversalLocation = UniversalLocation;
    type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
    type XcmSender = XcmRouter;
}

Any guidance on how to update the balance on the relaychain?

3
  • Quick feedback: - The teleport case is expected to fail. General parachains are not meant to be trusted teleporters of the relay chain native asset. - Can you give more details of the prcessing of the XCM message at Rococo side? What are the emitted events? - If you are simply using polkadot_XCM pallet's ReserveAssetTransfer call from the parachain, it is not going to work. This call is meant to work when the origin chain is the reserve of the transferred asset.
    – Iker
    Commented Nov 27, 2023 at 9:58
  • @Iker Yeah, teleports not working makes sense. Also yes, I am using ReserveAssetTransfer call from the parachain. What would be the correct message that I need to execute on the parachain to transfer ROC back to the relaychain?
    – chexware
    Commented Nov 29, 2023 at 6:00
  • You will need to build a specific XCM program with the right instructions. Have a look at pallet xTokens in certain production parachains, this pallet have it implemented: github.com/open-web3-stack/open-runtime-module-library/blob/…
    – Iker
    Commented Nov 29, 2023 at 10:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.