RustFund

First Flight #36
Beginner FriendlyRust
100 EXP
View results
Submission Details
Severity: medium
Valid

No update in fund.amount_raised field after transferring funds

Summary:

Hi,

I have found out a potential bug in withdraw and refund functions of the smart contract having no update state after transfer of funds.

Vulnerability Details:

The withdraw and refund functions do not update the fund.amount_raised field after transferring funds out of the fund account. This means the amount_raised field does not accurately reflect the current balance of the fund.

Impact:

Misleading accounting can confuse users and potentially allow double-spending or incorrect refund calculations.

Tools Used:

Manual review

Recommendations:

  • In the withdraw function, reset fund.amount_raised to zero after withdrawal.

  • In the refund function, subtract the refunded amount from fund.amount_raised.

Updates

Appeal created

bube Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

`amount_raised` is not reset to 0 in `withdraw` function

`amount_raised` not updated in `refund` function

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.