MartenitsaVoting::announceWinner
go through the all list of tokens which have at least one vote.
If too many tokens are participating the function will go over the block gas limit and would be impossible to call without reverting.
A malicious attacker can create many account and give one vote to a lot of different listed token to DoS the election if their favorite token will loose.
Likelyhood: High
Two many tokens in the competition.
Impact: High
Denial of service of announceWinner
.
Keep track of the maximum vote number for every vote and check if the vote changed this and store the new winner in a variable.
Change announceWinner
to reward the winner stored in the variable.
Avoid any loops in the code, especially if its number of iteration can be increased by users.
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.