The deadline guard in refund() uses a short-circuit && that skips enforcement when deadline == 0 (the default). Contributors can refund immediately after contributing if the creator hasn't called set_deadline() yet. Additionally, refund() never checks whether fund.amount_raised < fund.goal, so even successful campaigns can be drained by refunds after the deadline.
Two separate issues in the same guard:
Deadline bypass: fund_create() sets deadline = 0. Until the creator calls set_deadline(), the guard evaluates 0 != 0 && ... which is false, so the refund always proceeds. In a protocol where H-01 is fixed, any contributor can refund immediately after contributing, making it impossible for any campaign to accumulate funds.
Missing goal check: Even after the deadline passes, there is no check for amount_raised < goal. If a campaign succeeds (goal met), contributors can still refund after the deadline, draining the fund below the goal and breaking the creator's ability to withdraw.
Likelihood:
Deadline bypass happens on every fund before set_deadline() is called.
Missing goal check affects every fund that reaches its goal.
Impact:
In a fixed protocol, no campaign can accumulate funds before a deadline is set (contributors immediately refund).
Successful campaigns can be drained by refunds after the deadline, breaking the creator-withdrawal flow.
Replace the weak guard with strict checks:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.