-
Notifications
You must be signed in to change notification settings - Fork 660
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
Crowdload burn remaining funds #3707
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
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.
Makes sense
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
@@ -576,7 +577,10 @@ pub mod pallet { | |||
// can take care of that. | |||
debug_assert!(Self::contribution_iterator(fund.fund_index).count().is_zero()); | |||
|
|||
frame_system::Pallet::<T>::dec_providers(&Self::fund_account_id(fund.fund_index))?; | |||
// Crowdloan over, burn all funds. | |||
let _imba = CurrencyOf::<T>::make_free_balance_be(&pot, Zero::zero()); |
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.
dq but I don't get why this is needed; a CL is dissolve-able only when all funds are already returned, no? if not, I think it should be like this.
seems to be checked as a part of let can_dissolve = permitted && fund.raised.is_zero();
So the invariant is fund.raised
should always be equal to CurrencyOf::<T>::free_balance(&pot)
?
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.
Ahh okay, reading the test I realize that this is catering for the cases where a manual transfer happens to the fund account.
Crowdloan account should burn all funds after a crowd loan got dissolved to ensure that the account is reaped correctly. --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Crowdloan account should burn all funds after a crowd loan got dissolved to ensure that the account is reaped correctly.