The contribute function adds to amount_raised without overflow protection.
The line :
lacks checked arithmetic, which could theoretically overflow u64 (though the limit is very high: 2^64-1).
If {amount_raised + amount }exceeds {u64::MAX}, it will wrap around, corrupting the fund's state and potentially allowing unintended behavior.
Manual Code Review
Use checked addition:
The max value of u64 is: 18,446,744,073,709,551,615 or around 18.4 billion SOL, given that the total supply of SOL on Solana is 512.50M, the scenario when the `contribute` function will revert due to overflow is very very unlikely to happen. Therefore, this is informational finding.
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.