The reward calculation in the withdraw
function doesn't check for a zero divisor, which could lead to a division by zero error.
In the withdraw
function:
There's no check to ensure totalShares
is not zero before performing the division.
If totalShares
is zero (which could happen if all players have zero or negative scores), the function will revert due to a division by zero error.
Manual code review
Add a check for zero totalShares
:
Handle the case where all scores are zero or negative separately:
The checks related to maxScore do not account possible maxScore of zero leading to stuck funds or a division by zero error.
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.