RustFund

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

Contributor amount is always zero after contributions

Summary

The contributor's contribution account does not get updated after a successful contribution

Vulnerability Details

Contributors are allowed to contribute to a particular fund account multiple times, however the amount they have contributed is not recorded to their contribution account

Impact

This means that contributors are not able to get refunds on their accounts whenever the goal is not met because the amount they contributed was never updated in the first place.

Tools Used

Manual

POC

Add this to rustfund.ts#L86

console.log("Contributed amount", contributionAccount.amount.toNumber()); // This outputs 0

Recommendations

Ensure the contributors amount is updated after each contribution
Add this in contribute

contribution.amount += amount;
Updates

Appeal created

bube Lead Judge 2 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.