diff --git a/precompiles/pallet-xcm/XcmInterface.sol b/precompiles/pallet-xcm/XcmInterface.sol index d657a2b9..96638aae 100644 --- a/precompiles/pallet-xcm/XcmInterface.sol +++ b/precompiles/pallet-xcm/XcmInterface.sol @@ -41,6 +41,20 @@ interface XCM { /// @param dest The destination chain. /// @param beneficiary The actual account that will receive the tokens on dest. /// @param assets The combination (array) of assets to send in Location format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the feeAssetItem. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param feeAssetItem The index of the asset that will be used to pay for fees. function transferAssetsLocation( Location memory dest, @@ -55,6 +69,20 @@ interface XCM { /// @param paraId The para-id of the destination chain. /// @param beneficiary The actual account that will receive the tokens on paraId destination. /// @param assets The combination (array) of assets to send in Address format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the feeAssetItem. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param feeAssetItem The index of the asset that will be used to pay for fees. function transferAssetsToPara20( uint32 paraId, @@ -69,6 +97,20 @@ interface XCM { /// @param paraId The para-id of the destination chain. /// @param beneficiary The actual account that will receive the tokens on paraId destination. /// @param assets The combination (array) of assets to send in Address format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the feeAssetItem. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param feeAssetItem The index of the asset that will be used to pay for fees. function transferAssetsToPara32( uint32 paraId, @@ -82,6 +124,20 @@ interface XCM { /// @custom:selector 6521cc2c /// @param beneficiary The actual account that will receive the tokens on the relay chain. /// @param assets The combination (array) of assets to send in Address format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the feeAssetItem. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param feeAssetItem The index of the asset that will be used to pay for fees. function transferAssetsToRelay( bytes32 beneficiary, @@ -97,6 +153,20 @@ interface XCM { /// @custom:selector 8425d893 /// @param dest The destination chain. /// @param assets The combination (array) of assets to send in Location format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the remoteFeesIdIndex. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param assetsTransferType The TransferType corresponding to assets being sent. /// @param remoteFeesIdIndex The index of the asset (inside assets array) to use as fees. /// @param feesTransferType The TransferType corresponding to the asset used as fees. @@ -115,6 +185,20 @@ interface XCM { /// @custom:selector fc19376c /// @param dest The destination chain. /// @param assets The combination (array) of assets to send in Location format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the remoteFeesIdIndex. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param remoteFeesIdIndex The index of the asset (inside assets array) to use as fees. /// @param customXcmOnDest The XCM message to execute on destination chain (SCALE encoded). /// @param remoteReserve The remote reserve corresponding for assets and fees. They MUST @@ -135,6 +219,20 @@ interface XCM { /// @custom:selector 998093ee /// @param dest The destination chain. /// @param assets The combination (array) of assets to send in Address format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the remoteFeesIdIndex. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param assetsTransferType The TransferType corresponding to assets being sent. /// @param remoteFeesIdIndex The index of the asset (inside assets array) to use as fees. /// @param feesTransferType The TransferType corresponding to the asset used as fees. @@ -153,6 +251,20 @@ interface XCM { /// @custom:selector aaecfc62 /// @param dest The destination chain. /// @param assets The combination (array) of assets to send in Address format. + /// Assets MUST be sorted, otherwise there may be discrepancies with the remoteFeesIdIndex. + /// + /// Example a) of sorted assets (native asset and para 1000 asset): + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// + /// Example b) of sorted assets: (native asset and relay asset) + /// 1st - Location { parents: 0, interior: [PalletInstance(3)]} + /// 2nd - Location { parents: 1, interior: Here} + /// + /// Example c) of sorted assets: (relay asset and para 1000 asset) + /// 1st - Location { parents: 1, interior: Here} + /// 2nd - Location { parents: 1, interior: [Parachain(1000), PalletInstance(3)]} + /// /// @param remoteFeesIdIndex The index of the asset (inside assets array) to use as fees. /// @param customXcmOnDest The XCM message to execute on destination chain (SCALE encoded). /// @param remoteReserve The remote reserve corresponding for assets and fees. They MUST