Skip to content

Commit

Permalink
Merge pull request #789 from moonbeam-foundation/eshaben/update-to-as…
Browse files Browse the repository at this point in the history
…set-hub

update statemine/statemint to polkadot/kusama asset hub & list of XC-20s
  • Loading branch information
eshaben authored Nov 15, 2023
2 parents ea92a9a + 6bbba00 commit e8309f4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const getXc20s = async () => {
]) => {
const metadata = await api.query.assets.metadata(id);
console.log(`Asset ID: ${id}`);
console.log(`Metadata: ${metadata}`);
console.log(`Metadata: ${metadata.toHuman()}`);
console.log('-----');
}
);
Expand Down
8 changes: 4 additions & 4 deletions builders/build/historical-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,15 @@ This migration was executed at the following runtimes and blocks:

For more information, you can review the [relative PR on GitHub](https://github.com/moonbeam-foundation/moonbeam/pull/1114){target=_blank}.

***
***

#### Add Support for Statemine Prefix Breaking Change {: #add-support-statemine-prefix }
#### Add Support for Kusama Asset Hub (Statemine) Prefix Breaking Change {: #add-support-statemine-prefix }

The following three migrations were added to the asset manager pallet to avoid issues with [Statemine's breaking change to the way it represents assets](https://github.com/paritytech/cumulus/pull/831){target=_blank} and possible future breaking changes:
The following three migrations were added to the asset manager pallet to avoid issues with Kusama Asset Hub's (previously referred to as Statemine) [breaking change to the way it represents assets](https://github.com/paritytech/cumulus/pull/831){target=_blank} and possible future breaking changes:

- `UnitsWithAssetType` - updates the `AssetTypeUnitsPerSecond` storage item to a mapping of the `AssetType` to `units_per_second`, instead of the mapping `AssetId` to `units_per_second`. This is done to avoid additional migrations whenever a breaking change arises
- `PopulateAssetTypeIdStorage` - creates a new `AssetTypeId` storage item that holds the `AssetType` to `AssetId` mapping, which allows the decoupling of `assetIds` and `AssetTypes`
- `ChangeStateminePrefixes` - updates already registered Statemine assets to new their new form
- `ChangeStateminePrefixes` - updates already registered Kusama Asset Hub (Statemine) assets to new their new form

These migrations were executed at the following runtimes and blocks:

Expand Down
2 changes: 1 addition & 1 deletion builders/interoperability/xcm/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ The total cost is `{{ networks.moonbeam.xcm.transfer_glmr.glmr_cost }} GLMR` for

Considering the scenario with Alice sending DOT to Alith's account on Moonbeam, the fees are taken from the amount of xcDOT Alith receives. To determine how much to charge, Moonbeam uses a concept called `UnitsPerSecond`, which refers to the units of tokens that the network charges per second of XCM execution time (considering decimals). This concept is used by Moonbeam (and maybe other parachains) to determine how much to charge for XCM execution using a different asset than its reserve.

Moreover, XCM execution on Moonbeam can be paid by multiple assets ([XC-20s](/builders/interoperability/xcm/xc20/overview/){target=_blank}) that originate in the chain where the asset is coming from. For example, at the time of writing, an XCM message sent from [Statemine](https://polkadot.js.org/apps/?rpc=wss://statemine-rpc.polkadot.io#/explorer){target=_blank} can be paid in xcKSM, xcRMRK or xcUSDT. As long as that asset has an `UnitsPerSecond` set in Moonbeam/Moonriver, it can be used to pay XCM execution for an XCM message coming from that specific chain.
Moreover, XCM execution on Moonbeam can be paid by multiple assets ([XC-20s](/builders/interoperability/xcm/xc20/overview/){target=_blank}) that originate in the chain where the asset is coming from. For example, at the time of writing, an XCM message sent from [Kusama Asset Hub](https://polkadot.js.org/apps/?rpc=wss://kusama-asset-hub-rpc.polkadot.io#/explorer){target=_blank} (formerly Statemine) can be paid in xcKSM, xcRMRK or xcUSDT. As long as that asset has an `UnitsPerSecond` set in Moonbeam/Moonriver, it can be used to pay XCM execution for an XCM message coming from that specific chain.

To find out the `UnitsPerSecond` for a given asset, you can query `assetManager.assetTypeUnitsPerSecond` and pass in the multilocation of the asset in question.

Expand Down
Loading

0 comments on commit e8309f4

Please sign in to comment.