The refund
function fails to update the amount_raised
variable in the fund account. Due to this the funds will be locked permanently.
When a contributor requests a refund, the refund
fundtion transfers the SOL from the fund account back to the contributor and resets the contributor's contribution.amount
to 0. However, the function fails to decrease the fund.amount_raised
value.
The direct impact is that the fund.amount_raised
variable becomes inconsistent with the actual SOL balance of the fund account. This discrepancy causes issues in the withdraw
function.
A fund is created with a goal of 100 SOL.
Contributors A,B and C each contribute 40 SOL, bringing the total to 120 SOL.
2.1 fund.amount_raised
is now 120 SOL.
Contributor C requests a refund of their 40 SOL.
3.1 The refund succeeds, transferring 40 SOL back to the Contributor C
3.2 The fund account now actually contains 80 SOL
3.3 However, fund.amount_raised
incorrectly remains at 120 SOL.
The fund creator attempts to withdraw funds using the withdraw
function.
4.1 The Function tries to withdraw 120 SOL (the value of fund.amount_raised
)
4.2 This fails with ProgramError::InsufficientFunds
because the account only has 80 SOL
The remaining 80 SOL becomes loced in the fund account.
High
Manual Review
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.