The withdraw function currently allows the creator to withdraw funds at any time, even if the campaign has not yet reached its deadline or the funding goal. This behavior may contradict the intended logic of RustFund.
The documentation states:
"Creators can withdraw funds after successful campaigns."
This suggests that a campaign must be "successful" before withdrawal is possible. However, the current implementation does not enforce any deadline or goal checks, allowing fund creators to withdraw early, even if the campaign has not concluded.
The withdraw function does not verify if the funding goal is met before allowing the creator to withdraw.
The function also does not check if the campaign has reached its deadline, meaning funds can be withdrawn mid-campaign.
This directly contradicts the documentation, which states that funds should only be withdrawn after a "successful" campaign.
If the campaign is supposed to follow a goal-based model, then allowing early withdrawals breaks the funding logic and reduces contributor trust.
No check if the funding goal was met before allowing withdrawals.
No check if the deadline has passed, meaning withdrawals can happen mid-campaign.
Funds can be drained at any time, breaking contributor expectations.
Creators can withdraw funds early, even before reaching the goal.
Backers may lose trust, knowing creators can cash out mid-campaign without delivering results.
Potential fund misuse, where a creator starts a campaign, withdraws early, and abandons the project.
Contradicts RustFund’s intended funding model if it follows a goal-based system like Kickstarter.
Manual Code Review
To enforce goal-based withdrawals, the function should check:
1. If the campaign’s deadline has passed.
2. If the funding goal has been met.
Modify the function to only allow withdrawals if the campaign is successful:
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.