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

Implement holds and freezes in orml-tokens. #911

Open
TorstenStueber opened this issue May 4, 2023 · 4 comments
Open

Implement holds and freezes in orml-tokens. #911

TorstenStueber opened this issue May 4, 2023 · 4 comments

Comments

@TorstenStueber
Copy link

The latest Polkadot release (v0.9.42) added two new traits to the Fungibles family: hold and freeze (which has been added in paritytech/substrate#12951).

It would be very helpful if the tokens pallet also implement this additional Fungibles traits. At least for the hold trait it should be possible to use the underlying reserve mechanism.

@Chralt98
Copy link
Contributor

Chralt98 commented Jul 5, 2023

Regarding holds and freezes: Will anything change for the interface of orml_currencies? Or is it completely abstracted away and we can use reserve_named and unreserve_named and set_lock, extend_lock and remove_lock in the future?

@xlc
Copy link
Member

xlc commented Jul 6, 2023

fungibles traits are implemented

Current interface is not impacted.

@xlc xlc closed this as completed Jul 6, 2023
@TorstenStueber
Copy link
Author

fungibles traits are implemented

@xlc This issue is specifically about Fungibles::InspectFreeze, Fungibles::InspectHold, etc. (three more, see here).

To my knowledge they are not implemented yet.

@xlc xlc reopened this Jul 13, 2023
@wischli
Copy link
Contributor

wischli commented Oct 31, 2023

I'd like to add that the fn reducible_balance impl of orml-tokens seems to diverge from frame (both for fungible, i.e. pallet-balances as well as fungibles, i.e. pallet-assets:

For orml-tokens, the only case considering subtracting ED from the liquid funds is Preservation::Protect whereas in frame this can also occur for other preservations with Preservation::Preserve being the most protected one:

orml-tokens

if frame_system::Pallet::<T>::can_dec_provider(who) && !matches!(preservation, Preservation::Protect) {

pallet-balances

https://github.com/paritytech/polkadot-sdk/blob/3ae86ae075ac5eb9b80f89f09bd7f4a63f97c582/substrate/frame/balances/src/impl_fungible.rs#L57-L67

pallet-assets

https://github.com/paritytech/polkadot-sdk/blob/3ae86ae075ac5eb9b80f89f09bd7f4a63f97c582/substrate/frame/assets/src/impl_fungibles.rs#L58-L59

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

No branches or pull requests

4 participants