The withdraw
function currently allows creators to withdraw all raised funds without verifying whether the campaign goal has been met. This contradicts the intended behavior as per the documentation, which states that creators should only be able to withdraw funds if their campaign succeeds.
Currently, the function does not check whether amount_raised
has reached the required goal
before allowing withdrawals. This means a creator can withdraw funds even if the fundraising goal has not been met.
There is no condition in withdraw
ensuring that ctx.accounts.fund.amount_raised >= ctx.accounts.fund.goal
before funds are withdrawn.
Campaigns may fail to meet their objectives, but creators can still withdraw funds
Fund owners can rug pull contributors without meeting campaign goal
Manual code review
Modify the withdraw
function to ensure funds can only be withdrawn if the goal is 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.