The lib.rs::contribute() function fails to update the contributor’s contribution.amount after a contribution is made. This creates a critical inconsistency where the recorded contribution does not match the actual amount sent, potentially not allowing contributors to get refund of their contributions.
fund.amount_raised += amount;
//This is missing contribution.amount + = amount
In the FundContribute function, only fund.amount_raised is updated:
However, the contribution.amount field is not updated accordingly. Since refunds rely on this field to determine how much a contributor can get refund, no contrubutor can get the refunds.
Contributors may be able to get refund of their contribution.
The contract fails to track individual contributions correctly, causing inconsistencies in refund calculations.
Manual Review
Ensure that the contribution.amount is updated alongside fund.amount_raised to reflect the contributor’s actual contribution
This prevents contributors from claiming refunds exceeding their actual contributions.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.