Skip to content

Crowdload burn remaining funds#3707

Merged
ggwpez merged 5 commits intomasterfrom
oty-crowdload-provider-refs
Mar 17, 2024
Merged

Crowdload burn remaining funds#3707
ggwpez merged 5 commits intomasterfrom
oty-crowdload-provider-refs

Conversation

@ggwpez
Copy link
Copy Markdown
Member

@ggwpez ggwpez commented Mar 14, 2024

Crowdloan account should burn all funds after a crowd loan got dissolved to ensure that the account is reaped correctly.

ggwpez added 3 commits March 6, 2024 15:37
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>
@ggwpez ggwpez added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Mar 14, 2024
Copy link
Copy Markdown
Contributor

@franciscoaguirre franciscoaguirre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

ggwpez and others added 2 commits March 15, 2024 15:39

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());
Copy link
Copy Markdown
Contributor

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)?

Copy link
Copy Markdown
Contributor

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.

@ggwpez ggwpez added this pull request to the merge queue Mar 17, 2024
Merged via the queue into master with commit d2a7100 Mar 17, 2024
@ggwpez ggwpez deleted the oty-crowdload-provider-refs branch March 17, 2024 13:46
dharjeezy pushed a commit to dharjeezy/polkadot-sdk that referenced this pull request Mar 24, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants