Open pandres95 opened 3 months ago
Quick question before proceeding with the proposed implementation: after taking a review on #236, I noticed that (at least for fungible
tokens) it is expected that holds are not overlapped with free balance, while frozen may be applied to the total balance (including held
balances).
This leads me to think the reducible_balance
for an asset account should be calculated as total - max(frozen, held)
.
Is this assumption correct @gavofyork, or does this concept only for fungible
tokens?
This issue has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/2024-05-21-technical-fellowship-opendev-call/8264/1
Quick question before proceeding with the proposed implementation: after taking a review on #236, I noticed that (at least for
fungible
tokens) it is expected that holds are not overlapped with free balance, while frozen may be applied to the total balance (includingheld
balances).This leads me to think the
reducible_balance
for an asset account should be calculated astotal - max(frozen, held)
.Is this assumption correct @gavofyork, or does this concept only for
fungible
tokens?
there is an issue explaining these relations. you should look for the PR introducing new fungible/s traits. should be linked there.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
A follow-up of #3342. The current design of
pallet-assets
doesn't implement holds, while there are multiple use cases for which it would be beneficial to support this behaviour (e.g. bonding, staking, deposits, payment holds, escrowed vesting, etc.).Request
Because of the above, it is desirable to find a way of implementing inspection and mutation of the [
fungibles::holds
]() traits.Solution
Stage 1
Pull Request:
A basic definition and implementation of a
HeldBalance
(an analogous toFrozenBalance
) that can be added as a type inpallet-assets
.Then, by using the
held_balance
method in Assets, it would be possible to subtract the free balance to obtain thereducible_balance
, and adjust to the balance components model.pallet-assets-holder
Analogous to
pallet-assets-freezer
, this proposed pallet extends the capabilities ofpallet-assets
to support holding balances.Are you willing to help with this request?
Yes!