Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Register Trappist native token on Rococo Asset Hub, and do some Foreign Assets examples #248

Open
gautamdhameja opened this issue Jul 6, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@gautamdhameja
Copy link
Collaborator

We need some examples for foreign asset functionality.
Now that Trappist is on Rococo, let's try this out.

@gautamdhameja gautamdhameja added the enhancement New feature or request label Jul 6, 2023
@stiiifff stiiifff added this to the Trappist M2 / XCM v3 milestone Jul 6, 2023
@joepetrowski
Copy link
Contributor

joepetrowski commented Jul 6, 2023

Main paths to cover:

  • Open an HRMP channel with Asset Hub.
  • Create the native token (TRAP?) on AH. You will need to construct a create call and send it using Trappist governance so that it comes from the Sovereign origin. Will need some ROC to cover the creation deposit.
  • Set the metadata for the asset. Again will need to come via governance (unless you set the admin to some other account in create, but let's consider that the "wrong" way of going about this). Again need some ROC for metadata deposit.
  • Teleport TRAP to and from AH 🎉
  • Use reserve backed transfers to send TRAP to other parachains, with AH acting as a reserve location.
  • Get another parachain on Rococo to copy you and send their PARA token to Trappist using reserve backed transfers. Demonstrate in Trappist how you handle a multi-reserve system: i.e. Trappist should recognize both AH and the PARA parachain as reserve locations for PARA.

Extra Credit:

@hbulgarini hbulgarini self-assigned this Jul 7, 2023
@hbulgarini
Copy link
Contributor

This is perfectly doable. Below my thoughts:

  • Open an HRMP channel with Asset Hub.
  • Create the native token (TRAP?) on AH. You will need to construct a create call and send it using Trappist governance so that it comes from the Sovereign origin. Will need some ROC to cover the creation deposit.
  • Set the metadata for the asset. Again will need to come via governance (unless you set the admin to some other account in create, but let's consider that the "wrong" way of going about this). Again need some ROC for metadata deposit.

Ok! the native token of Trappist is HOP :)

Teleport TRAP to and from AH

For this we need to define a proper type over the IsTeleporter XCM config where Trappist recognize AH as a trusted teleporter. We might get the inspiration from the IsForeignConcreteAsset that is actually set on AH.

  • Use reserve backed transfers to send TRAP to other parachains, with AH acting as a reserve location.
  • Get another parachain on Rococo to copy you and send their PARA token to Trappist using reserve backed transfers. Demonstrate in Trappist how you handle a multi-reserve system: i.e. Trappist should recognize both AH and the PARA parachain as reserve locations for PARA.

Trappist project contains another runtime called Stout that can be used for this purpose, however we would need to deploy this one as well. Taking into account that the major amount of work for having a proper deployment of the parachain was already done for Trappist, deploying Stout on Rococo shouldn't be so time consuming.

Something interesting is that Stout (as well Trappist) recognize AH as an asset reserve : https://github.com/paritytech/trappist/blob/main/runtime/stout/src/xcm_config.rs#L205:L221

Also Stout contains a DEX, so we could go further and create a liquidity pool composed by the reserved HOP on AH and Rockmine USD (id: 1984). We might want also to define some showcases with more advanced cross-chain interactions by leveraging the Transact instruction.

@joepetrowski
Copy link
Contributor

Also Stout contains a DEX

So does AH.

@hbulgarini
Copy link
Contributor

hbulgarini commented Jul 11, 2023

So does AH.

  • Get another parachain on Rococo to copy you and send their PARA token to Trappist using reserve backed transfers. Demonstrate in Trappist how you handle a multi-reserve system: i.e. Trappist should recognize both AH and the PARA parachain as reserve locations for PARA.

The usage of the DEX on Stout specifically would fill that item, is not intended to replace any interaction with the asset convertion pallet on AH which would be done as well.

@joepetrowski
Copy link
Contributor

What does that point have to do with a DEX? They are completely unrelated.

@hbulgarini hbulgarini removed their assignment Jul 11, 2023
@stiiifff
Copy link
Contributor

@hbulgarini Let's not bring another DEX into the conversation .. that's a bit confusing.
@joepetrowski Looks like we've got all that's needed to build this example on "Trappist on Rococo". Let's have a quick sync internally to align, and we'll then proceed with this 🥳️🚀️

@metricaez
Copy link
Collaborator

Hi! As an update on this we have already covered from the registration to the teleport in and there is currently a HOP/ROC pool created on AH.

  [
    [
      [
        {
          parents: 1
          interior: Here
        }
        {
          parents: 1
          interior: {
            X1: {
              Parachain: 1,836
            }
          }
        }
      ]
    ]
    {
      lpToken: 11
    }
  ]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants