When a contributor requests a refund, the refunded amount is not deducted from the amount_raised
field in the fund account. This inconsistency in state management lead to incorrect reporting of the campaign’s total raised funds, potential operational issues, and misinformed decision-making for both contributors and campaign creators.
When a contributor requests a refund, the contract transfers the specified amount from the fund account back to the contributor's account. However, the contract does not update the amount_raised
field, which continues to reflect the original total contributions. This leads to a discrepancy between the actual lamport balance held in the fund account and the recorded amount_raised
.
Code Behavior:
The refund
function deducts lamports from the fund account and credits the contributor's account, but it does not modify the amount_raised
field:
This means that even after a refund, the internal state does not accurately reflect the current funds raised.
State Inconsistency:
The inaccurate amount_raised
value lead to an erroneous representation of the campaign's financial state. Any subsequent logic that relies on this variable (such as determining campaign success or calculating additional refunds) produce incorrect results.
Misleading Information:
Contributors and campaign creators might be misled regarding the actual amount of funds available or raised. This could affect decision-making, reporting, and overall trust in the platform.
Manual Review
Modify the refund function to deduct the refunded amount from the amount_raised
field.
ensuring that the internal state reflects the new balance after refunds.
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.