In the selectWinner function there is a potential for an overflow in the fee calculation. The contract is written in Solidity version 0.7.6, which does not automatically check for overflows. This vulnerability arises when calculating the totalAmountCollected:
Overflow Scenario: If the players.length * entranceFee is large enough, the totalAmountCollected could result in a value that exceeds the maximum for a uint256, causing an overflow.
Use SafeMath Library: Implement the use of the OpenZeppelin's SafeMath library for arithmetic operations, which includes overflow checks.
Solidity Version Upgrade: Consider upgrading the contract to a newer version of Solidity (0.8.x or later) where overflow checks are done by default.
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.