The contribute instruction is designed for contributors to fund a campaign up to its stated goal, with the expectation that contributions are refundable if the goal is not met.
contribute accepts new contributions even after fund.amount_raised >= fund.goal with no cap. Late contributors who push the total above the goal have no mechanism to recover their excess — the creator withdraws the full pot including the excess, and refund eligibility requires the goal to not be met, so over-funded amounts are permanently non-refundable.
Likelihood:
A late contributor who sends SOL to a campaign that has already reached its goal enters this state automatically — no special conditions are required beyond contributing after the goal is met.
Popular campaigns where the goal is reached quickly are most exposed, as many contributors may arrive after the goal is already visible as met.
Impact:
Late contributors who push the total above the goal lose their entire contribution with no recourse — the creator withdraws the full pot including the excess, and the refund path is permanently closed for over-funded amounts.
The protocol makes an implicit promise that unmet-goal contributions are refundable, but over-funded contributions are silently non-refundable under the current logic.
Place this test in tests/ and run anchor test. The test demonstrates that a late contributor can send SOL to an already-funded campaign with no cap, losing their contribution permanently since refunds require the goal to not be met.
Add a require! check at the top of contribute() that ensures fund.amount_raised + amount <= fund.goal, preventing contributions once the campaign goal is reached.
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.