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

XCM Fungible Asset Implementation Design #384

Closed
xlc opened this issue Mar 3, 2021 · 1 comment · Fixed by #432
Closed

XCM Fungible Asset Implementation Design #384

xlc opened this issue Mar 3, 2021 · 1 comment · Fixed by #432
Assignees

Comments

@xlc
Copy link
Member

xlc commented Mar 3, 2021

See #385

  • orml-xcm-support
    • Types
      • trait OnUnknownAssetDeposit
        • fn on_unknown_asset_deposit(id: &MultiLocation, val: u128)
      • trait AssetIdConversion
        • type Error
        • fn from_multi_asset(asset: &MultiAsset) -> Result<Self, Error>
        • fn to_multi_asset(self: &Self) -> Result<MultiAsset, Error>
      • struct MultiCurrencyAdapter<MultCurrency, LocationConversion, AssetId: AssetIdConversion, OnUnknownAssetDeposit>
        • impl TransactAsset
          • use LocationConversion to get origin
          • ues AssetIdConversion to get CurrencyId
          • use MultiCurrency to deposit/withdraw
      • other helper types as needed
  • orml-unknown-tokens
    • Notes
      • handle unknown tokens
      • allow to query balance
      • allow transfer to other chain (i.e. send money back)
    • Storages
      • map AccountId, MultiLocation => u128
    • Calls
      • transfer(origin, asset: MultiLocation, amount: u128, dest: MultiLocation)
    • Module
      • impl OnUnknownAssetDeposit
      • impl
        • fn burn(who: AccountId, asset: MultiLocation, amount: u128)
          • useful to migrate Unknown asset to known one
  • orml-xtokens
    • Config
      • XcmExecutor
      • CurrencyId
      • Balance
    • Calls
      • transfer(origin, currency_id: CurrencyId, amount: Balance, dest: MultiLocation)
      • transfer_xcm(origin, asset: MultiAsset, dest: MultiLocation)
@shaunxw shaunxw self-assigned this Mar 12, 2021
@shaunxw
Copy link
Member

shaunxw commented Mar 15, 2021

Additional implementation notes:

  • In MultiCurrencyAdapter deposit asset impl, if the CurrencyId conversion failed, consider the asset as unknown asset, and deposit it via OnUnknownAssetDeposit trait.
  • While integrating the XCM related pallets, use orml-unknown-tokens pallet as OnUnknownAssetDeposit impl in MultiCurrencyAdapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants