The refund
function does not subtract the refunded amount from fund.amount_raised, which causes the withdraw function to compute an inaccurate withdrawal amount.
When a user requests a refund, the refunded amount is transferred back to them correctly. However, the amount_raised
field is not updated.
Later, when the creator calls withdraw
, it calculates the amount to withdraw as:
This amount will include refunded contributions, which no longer exist in the actual fund account balance. As a result, the creator ends up withdrawing less than they actually could, or worse — the withdrawal could fail if the recorded amount is higher than the real lamports in the fund.
Creators might get less money than they should, or the withdraw might even fail if the fund balance doesn’t match what’s recorded. This makes the fund data unreliable and can break how other parts of the app work or confuse users.
Even though the numbers are wrong, no one can actually steal or lose money because of this. It doesn’t give any unfair benefit to attackers. That’s why this issue is considered Medium severity.
Manual review
Update the refund
function to subtract the refunded amount from amount_raised
:
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.