RustFund

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

Incomplete contribution amount tracking

Summary

The function fails to update the individual contributor's contribution amount, creating a discrepancy in contribution tracking.

Vulnerability Details

  • The function transfers funds and updates the total fund amount

  • Individual contributor's contribution.amount is not incremented

  • Breaks the expected behavior of tracking per-contributor contributions

Impact

  • Inability to accurately track individual contributor's specific contributions

  • Potential accounting inconsistencies when a user contributes multiple times and an incorrect refund occurs due to the current implementation.

Tools Used

  • Foundry Tests: By writing a test where user creates 2 contributions to a fund and request a refund.

  • Manual Code Review: Identified the mising update in the contribute function.

Recommendations

  • Add contribution.amount += amount; to track individual contributions at the end of contribute.

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.