The rustfund::refund function only checks if the deadline has passed before allowing refunds, but it doesn't verify if the funding goal has been met. This contradicts the documented behavior in the README, which states: "Contributors can get refunds if deadlines are reached and goals aren't met." The current implementation allows contributors to withdraw funds from successfully funded projects after the deadline passes, potentially draining the fund.
This issue creates a critical mismatch between the expected behavior and the actual implementation, undermining the entire crowdfunding mechanism by allowing contributors to withdraw from successful campaigns.
Creator creates a fund with a goal of 100 SOL and sets a deadline
Contributors collectively contribute 120 SOL, exceeding the goal
The deadline passes, making the campaign successful
Despite meeting the goal, contributors can still call rustfund::refund to withdraw their contributions
This allows draining of a successfully funded project, preventing the creator from accessing the promised funds
This approach adds a state machine to properly track the fund's status and enforces the correct refund rules based on both deadline and goal achievement.
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.