5

The docs on the traits ReservableCurrency and NamedReservableCurrency currency are the same, although they clearly have subtle differences between them. When should someone use ReservableCurrency vs NamedReservableCurrency, and how do they differ?

https://docs.substrate.io/rustdocs/latest/frame_support/traits/trait.ReservableCurrency.html

https://paritytech.github.io/substrate/master/frame_support/traits/trait.NamedReservableCurrency.html

1 Answer 1

5

The context for NamedReserveableCurrency can be found here:

Basically, this was a feature added later in the balances pallet where users could have a reserved balance which is indexed under a certain "name". (usually the pallet which is reserving the balance)

This allows that you are able to see how much balance each pallet has individually reserved, rather than having a single reserved balance which mixes all the balances together.

This can also help prevent an error in one pallet from causing issues in another pallet, for example incorrectly accounting for the reserved balance of a user, and thus taking from a shared pot of reserved balances.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.