-
Notifications
You must be signed in to change notification settings - Fork 2.7k
A Vision for More Friendly Balances and Currencies #8285
Comments
A version without imbalance will be useful. We have already made one in ORML: https://github.com/open-web3-stack/open-runtime-module-library/blob/92db458616cae0da1cc55fa90962e2ed16d45279/traits/src/currency.rs#L187 Also some multi currency support is needed like https://github.com/open-web3-stack/open-runtime-module-library/blob/92db458616cae0da1cc55fa90962e2ed16d45279/traits/src/currency.rs#L16 pallet-assets should also implement some of those new traits. |
Yes to all of the above. Very happy to steal from you all as much as it makes sense so we can avoid duplication of work. For example, in your BasicCurrency, I wouldn't include withdraw / deposit / slash. Do you think there is reason to have them in the minimal currency? |
A version without withdraw / deposit / slash will be useful for a fixed supply token to enforce no mint / burn. |
Exactly. Yeah, then seems we are very much aligned here. 👍 |
It seems #8435 is related to this issue. |
To make traits minimal, I think they don't have to inherit from the base trait pub trait Config: frame_system::Config {
type ReservableCurrency: Currency + Reservable;
} |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
This will be addressed as part of paritytech/polkadot-sdk#327 |
The entire FRAME ecosystem revolves around the Balances pallet. In fact, nearly every pallet in FRAME uses the Currency trait, which currently is only implemented by our Balances pallet.
The Currency trait itself is not very well designed imo. It exposes functions which are implementation details of how the Balances pallet works, for example Negative/Positive imbalance.
It also assumes that every pallet needs extreme access to a currency, for example to be able to mint it, burn it, set anyone's balance, etc...
I think that we can turn the Currency pallet into a bunch of smaller, more ergonomic traits, and also reduce the trait requirements of many of our FRAME pallets. This would make them MUCH more friendly to alternative implementations of Balances-like pallets, especially when keeping in mind the need for multi-currenty chains of the future.
This is a meta issue to track the following independent tasks:
Currency
requirements where possible across existing pallets.Some ideas:
etc...
The text was updated successfully, but these errors were encountered: