-
Notifications
You must be signed in to change notification settings - Fork 814
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
Fungible and fungibles adapters should allow account death like burns and mints #7039
Comments
Very much needed |
I would like to work on this one. |
@dhirajs0 Thank you for wanting to work on this! Let me know if everything is understood or if you have any questions. I'm here to help. |
We can change the Preservation of
If we add |
Yes, we should do exactly this.
We can't add a new Hint now because XCMv5 is already frozen, released in stable2412. But for XCMv6 for example, we can add a hint |
Thanks for the clarification! I’ve raised a PR to address this issue. Would greatly appreciate it if you could review it and share your feedback when you have a moment. |
# Description Fixes #7039 The Preservation of transfer method of fungible and fungibles adapters is changed from Preserve to Expendable. So the behavior of the TransferAsset will be consistent with the WithdrawAsset function, as in [fungible](https://github.com/paritytech/polkadot-sdk/blob/f3ab3854e1df9e0498599f01ba4f9f152426432a/polkadot/xcm/xcm-builder/src/fungible_adapter.rs#L217) and [fungibles](https://github.com/paritytech/polkadot-sdk/issues/url) adapter. This pull request includes changes to the `fungible_adapter.rs` and `fungibles_adapter.rs` files in the `polkadot/xcm/xcm-builder` directory. The main change involves modifying the transfer method to use the `Expendable` strategy instead of the `Preserve` strategy. Changes to transfer strategy: * [`polkadot/xcm/xcm-builder/src/fungible_adapter.rs`](diffhunk://#diff-6ebd77385441f2c8b023c480e818a01c4b43ae892c73ca30144cd64ee960bd66L67-R67): Changed the transfer method to use `Expendable` instead of `Preserve`. * [`polkadot/xcm/xcm-builder/src/fungibles_adapter.rs`](diffhunk://#diff-82221429de4c4c88be3d2976ece6475ef4fa56a32abc70290911bd47191f8e17L61-R61): Changed the transfer method to use `Expendable` instead of `Preserve`. --------- Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Adrian Catangiu <adrian@parity.io>
# Description Fixes #7039 The Preservation of transfer method of fungible and fungibles adapters is changed from Preserve to Expendable. So the behavior of the TransferAsset will be consistent with the WithdrawAsset function, as in [fungible](https://github.com/paritytech/polkadot-sdk/blob/f3ab3854e1df9e0498599f01ba4f9f152426432a/polkadot/xcm/xcm-builder/src/fungible_adapter.rs#L217) and [fungibles](https://github.com/paritytech/polkadot-sdk/issues/url) adapter. This pull request includes changes to the `fungible_adapter.rs` and `fungibles_adapter.rs` files in the `polkadot/xcm/xcm-builder` directory. The main change involves modifying the transfer method to use the `Expendable` strategy instead of the `Preserve` strategy. Changes to transfer strategy: * [`polkadot/xcm/xcm-builder/src/fungible_adapter.rs`](diffhunk://#diff-6ebd77385441f2c8b023c480e818a01c4b43ae892c73ca30144cd64ee960bd66L67-R67): Changed the transfer method to use `Expendable` instead of `Preserve`. * [`polkadot/xcm/xcm-builder/src/fungibles_adapter.rs`](diffhunk://#diff-82221429de4c4c88be3d2976ece6475ef4fa56a32abc70290911bd47191f8e17L61-R61): Changed the transfer method to use `Expendable` instead of `Preserve`. --------- Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Adrian Catangiu <adrian@parity.io> (cherry picked from commit f96da6f)
# Description Fixes #7039 The Preservation of transfer method of fungible and fungibles adapters is changed from Preserve to Expendable. So the behavior of the TransferAsset will be consistent with the WithdrawAsset function, as in [fungible](https://github.com/paritytech/polkadot-sdk/blob/f3ab3854e1df9e0498599f01ba4f9f152426432a/polkadot/xcm/xcm-builder/src/fungible_adapter.rs#L217) and [fungibles](https://github.com/paritytech/polkadot-sdk/issues/url) adapter. This pull request includes changes to the `fungible_adapter.rs` and `fungibles_adapter.rs` files in the `polkadot/xcm/xcm-builder` directory. The main change involves modifying the transfer method to use the `Expendable` strategy instead of the `Preserve` strategy. Changes to transfer strategy: * [`polkadot/xcm/xcm-builder/src/fungible_adapter.rs`](diffhunk://#diff-6ebd77385441f2c8b023c480e818a01c4b43ae892c73ca30144cd64ee960bd66L67-R67): Changed the transfer method to use `Expendable` instead of `Preserve`. * [`polkadot/xcm/xcm-builder/src/fungibles_adapter.rs`](diffhunk://#diff-82221429de4c4c88be3d2976ece6475ef4fa56a32abc70290911bd47191f8e17L61-R61): Changed the transfer method to use `Expendable` instead of `Preserve`. --------- Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Adrian Catangiu <adrian@parity.io> (cherry picked from commit f96da6f)
# Description Fixes #7039 The Preservation of transfer method of fungible and fungibles adapters is changed from Preserve to Expendable. So the behavior of the TransferAsset will be consistent with the WithdrawAsset function, as in [fungible](https://github.com/paritytech/polkadot-sdk/blob/f3ab3854e1df9e0498599f01ba4f9f152426432a/polkadot/xcm/xcm-builder/src/fungible_adapter.rs#L217) and [fungibles](https://github.com/paritytech/polkadot-sdk/issues/url) adapter. This pull request includes changes to the `fungible_adapter.rs` and `fungibles_adapter.rs` files in the `polkadot/xcm/xcm-builder` directory. The main change involves modifying the transfer method to use the `Expendable` strategy instead of the `Preserve` strategy. Changes to transfer strategy: * [`polkadot/xcm/xcm-builder/src/fungible_adapter.rs`](diffhunk://#diff-6ebd77385441f2c8b023c480e818a01c4b43ae892c73ca30144cd64ee960bd66L67-R67): Changed the transfer method to use `Expendable` instead of `Preserve`. * [`polkadot/xcm/xcm-builder/src/fungibles_adapter.rs`](diffhunk://#diff-82221429de4c4c88be3d2976ece6475ef4fa56a32abc70290911bd47191f8e17L61-R61): Changed the transfer method to use `Expendable` instead of `Preserve`. --------- Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> Co-authored-by: Adrian Catangiu <adrian@parity.io> (cherry picked from commit f96da6f)
The fungible and fungibles adapters set the preservation of the burn operation to
Expendable
: here and here.This allows accounts to transfer all their funds (and getting reaped because of it) out of their account.
However, this only works if they're using the
WithdrawAsset
andDepositAsset
instructions, which correspond toburn_from
andmint_into
.If
TransferAsset
is used, as is the case with limited_reserve_assets_transfer, then thetransfer
function will be called withPreserve
.This distinction is arbitrary and we should change the way
TransferAsset
is handled to also allow transferring all the funds of an account. It results in confusing errors for users.If needed, we could add a Hint for changing the default of ALL operations from
Expendable
toPreserve
.The text was updated successfully, but these errors were encountered: