Because of the dependencies of the contract, the Solidity version of this contract needs to be above 0.7.6 but below of 0.8.0, this posses high risks, in the release of 0.8.0 the Solidity team introduced the 'safeMath' functionality in Solidity, that checked for over and underflows in numbers
High - With the way of how the program is written the variable totalFees could overflow if enough raffles has passed and the feeAddress hasn't withdrawn, blocking funds in the smart contract for ever.
We create a function that creates multiple raffles, (In this example we are dealing with 100 players each raffle)
This test should fail at the run number 11.
Copy this code into PuppyRaffleTest.t.sol:
For any manipulation of numbers in Solidity < 0.8.0, it should be use the library SafeMath to ensure that there are no over or underflows.
Change the variable from uint64 to uint256 to minimize this problem.
With these modifications we ensure that if there's an overflow or underflow the transaction will be reverted. And by using a uint256 it will take a while until totalFees overflows.
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.