The rustfund::withdraw function does not verify if the funding goal has been met before allowing the creator to withdraw all contributed funds. This contradicts the documented behavior in the README, which states: "Creators can withdraw funds once their campaign succeeds." According to the README, success is defined as meeting the funding goal.
Creator creates a fund with a goal of 100 SOL and sets a deadline
Contributors collectively contribute only 50 SOL, not meeting the goal
The deadline passes (assuming this check is added to the withdraw function)
Despite not meeting the goal, the creator can still call rustfund::withdraw to withdraw all contributed funds
This violates the core principle of the crowdfunding platform where campaigns should only succeed if they meet their funding goals
This approach adds a proper state machine to track the campaign's status and enforces the correct withdrawal 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.