The contribute
function transfers SOL from the contributor to the fund account but doesn't properly update the individual contribution amount in the contribution record.
When a user contributes to a fund, the SOL is correctly transferred to the fund account and the fund's amount_raised
is properly incremented. However, the individual contribution's amount
field is only set to 0 when the contribution record is created, but is never updated when additional contributions are made:
This vulnerability has severe implications for the refund functionality. Since individual contribution amounts aren't being tracked properly, the refund function will not work as expected:
Users who have contributed multiple times will only be able to refund their first contribution
In some cases, users might not be able to get any refund at all
The calculation for refunds will be incorrect, potentially leading to some users being unable to claim their funds
This could result in permanent loss of user funds.
Manual code review
Update the contribute
function to properly track individual contribution amounts:
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.