The refund
function currently allows contributors to receive refunds even if the campaign goal has been met. This contradicts the intended behavior mentioned in project features, which states that contributors should only be able to refund if the deadline is reached and the fundraising goal is not met.
Currently, the function only checks whether the deadline has been reached:
However, it does not check whether ctx.accounts.fund.amount_raised < ctx.accounts.fund.goal
. This means contributors can claim refunds even if the campaign was successful
A campaign that successfully raised the required amount could be drained by contributors requesting refunds.
The project might not receive the expected funding despite meeting its target.
This could lead to unintended financial losses for fundraisers.
Manual code review
Modify the refund function to ensure refunds are only allowed if the deadline has passed and the goal was not met:
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.