contribute() adds SOL to a fund. It should reject contributions once the campaign is over (goal met, funds withdrawn, or deadline passed). The problem is that when deadline == 0 (never set), the deadline check is skipped entirely, so contribute() always succeeds — even after the creator has already called withdraw(). New contributions flow into a fund that has already been emptied, with no way to prevent it and unclear recoverability.
Likelihood:
Occurs on any fund where the deadline was never set (deadline == 0), which is the default state after fund_create.
Impact:
Contributions are accepted even after the creator withdrew, so new funds enter a fund with corrupted accounting (see amount_raised bug), and there is no clean state marking the campaign as closed.
Creator creates a fund (deadline defaults to 0, never set).
Alice contributes 5 SOL.
Creator calls withdraw and takes the funds.
Bob contributes 3 SOL — the call succeeds because deadline == 0 skips the
deadline check entirely, even though the campaign was effectively closed.
Bob's funds enter a fund with already-corrupted accounting and no clean way out.
Note: with deadline == 0 (the default), the deadline check in contribute is skipped, so contributions are accepted regardless of the fund's real lifecycle state. Running requires the Anchor test setup; the missing check is evident from the source.
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.