-
Notifications
You must be signed in to change notification settings - Fork 19
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
Investigate fungible trait Holds and Freezes overlap #1873
Investigate fungible trait Holds and Freezes overlap #1873
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks. #themoreyouknow
Interestingly, the changes will allow to slash hold but yet we validate to prevent that. I am curious to learn what new feature makes this case useful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
Goal
The goal of this PR is to investigate the overlap of
hold
andfrozen
in the frame system account, used by the balances pallet and the fungible trait (which replaced the Currency trait).Closes #1819
Discussion
Investigation indicates that it is not currently possible to create a situation where
frozen
overlaps withhold
[currently indicated byreserved
in the frame system account] and thathold
can be slashed.Democracy
pallet to create a proposal that would result in some tokens being placed onhold
. The tokens onhold
would always be returned to the user at some point in the future, they are not able to be slashed, as near as I can tell.treasury
pallet to create a spend proposal that would result in a minimum of 100 tokens being used as a bond and placed onhold
. These tokens will be slashed if the proposal is rejected. We can simulate a rejection usingsudo
and see that the tokens are slashed.hold
.However, experimentation with
hold
shows that conditions wherehold
andfrozen
overlap cause the transactions to fail.Tests were added to make sure this behavior does not change in the future.
Changes
Two tests were added:
hold
. This transaction fails.How to Test
Checklist