RustFund

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

Missing Contribution Amount Update

Summary

The contribute function doesn’t update contribution.amount after a contribution.

Vulnerability Details

While fund.amount_raised is updated, contribution.amount remains unchanged after initialization to 0, making it impossible to track individual contributions accurately for refunds.

Impact

Contributors cannot be properly refunded since their contribution amounts aren’t tracked.

Tools Used

Manual Code Review

Recommendations

Update the contribution amount:

contribution.amount = contribution.amount
.checked_add(amount)
.ok_or(ErrorCode::CalculationOverflow)?;
Updates

Appeal created

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

Contribution amount is not updated

Support

FAQs

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