The refund function prevents contributors from reclaiming their funds if a campaign fails but the deadline has been reached. This conflicts with the documentation, which states:
"Contributors can get refunds if deadlines are reached and goals aren't met."
Currently, the refund function only checks whether the deadline has been reached but does not check if the goal has been met. If the goal is met, refunds should not be allowed. However, if the goal is not met, contributors should still be able to get their funds back.
A creator sets up a campaign with a goal of 100 SOL and a deadline.
Contributors donate a total of 30 SOL before the deadline.
The deadline passes, but the goal was not met.
A contributor attempts to call refund() but is blocked because the function does not verify whether the goal was actually met.
Contributors cannot get refunds even if the campaign fails (i.e., does not meet the goal).
Funds remain locked, preventing contributors from reclaiming them.
This contradicts the documentation, which states that contributors can request refunds if the goal is not met and the deadline is reached.
Manual code review
Modify the refund function to ensure contributors can receive a refund if the goal was not met after the deadline:
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.