_getWinnerShares function uses an unbounded for loop which can cause denial of service.The _getWinnerShares function uses an unbounded loop, this can hit a gas limit for a transaction when the length of usersAddress is too large considering that the array can contain duplicates. Since the _getWinnerShares internal function is called by the setWinner function for the admin to set the winner, this can cause denial of service.
Likelihood:
This happens when the usersAddress array is too large.
Impact:
Causes denial of service
Bound the loop to a maximum number to avoid reverts in case the array is long.
The _getWinnerShares() function is intended to iterate through all users and sum their shares for the winning country, returning the total.
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.