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: Proper Asset Checking #487

Open
Tracked by #925
gavofyork opened this issue Oct 7, 2022 · 0 comments
Open
Tracked by #925

XCM: Proper Asset Checking #487

gavofyork opened this issue Oct 7, 2022 · 0 comments
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework. T6-XCM This PR/Issue is related to XCM.

Comments

@gavofyork
Copy link
Member

gavofyork commented Oct 7, 2022

Right now an account is used to represent all assets teleported to other chains (in the case that the assets are minted on the local chain) and to represent all assets teleported in from other chains (in the case that the assets are minted on a remote chain).

In the first case this is a somewhat harmless abuse of the account model, which is useful since a) it's an easy way of managing bookkeeping and b) total issuance is updated naturally to include foreign-held assets.

In the second case it is quite problematic since total issuance double-counts assets held locally as they're teleported in (once in owner's account and a second time in the checking account).

Instead, we should introduce and use a new feature in assets, uniques and balances pallets, exposed by new traits. Other pallets (e.g. ORML) which would want to be fully compatible with the teleportation system can also implement these traits.

The new trait introduces four new functions:

  • fn import(checking: AccountId, ... /* asset id, amount &c */): to be called after mint. Note internally that the asset has been imported. Any transfers/burn-and-mints should not alter this mark - the only way to alter the mark should be through the unimport call.
  • fn unimport(checking: AccountId, ... /* asset id, amount &c */) -> Result<(), ()>: to be called before burn; return an Err if no outstanding imported asset matches the asset given. Otherwise remove mark as imported.
  • fn export(checking: AccountId, ... /* asset id, amount &c */): to be called after burn. Note internally that an asset exists in a foreign system. If total issuance is tracked then it should be increased accordingly. Any transfers/burn-and-mints should not alter this mark.
  • fn unexport(checking: AccountId, dest: AccountId, ... /* asset id, amount &c */) -> Result<(), ()>: Remove a mark/note previously placed on an asset by export. If there is no outstanding exported asset, then return an Err.
@gavofyork gavofyork mentioned this issue Oct 7, 2022
30 tasks
@gavofyork gavofyork changed the title XCM: Asset Checking Pallet. XCM: Asset Checking Pallet Oct 7, 2022
@gavofyork gavofyork mentioned this issue Oct 7, 2022
27 tasks
@gavofyork gavofyork changed the title XCM: Asset Checking Pallet XCM: Proper Asset Checking Oct 7, 2022
@KiChjang KiChjang added the T6-XCM This PR/Issue is related to XCM. label Apr 24, 2023
@juangirini juangirini transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. and removed J0-enhancement labels Aug 25, 2023
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* fixed client used in headers maintain

* fmt
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* fixed client used in headers maintain

* fmt
bkchr pushed a commit that referenced this issue Apr 10, 2024
* fixed client used in headers maintain

* fmt
@acatangiu acatangiu added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework. T6-XCM This PR/Issue is related to XCM.
Projects
Status: Backlog
Development

No branches or pull requests

4 participants