The MartenitsaVoting::announceWinner()
function loops through _tokenIds
array to get the winnerTokenId
.
The longer the _tokenIds
array is, the more gas is consumed.
Large arrays potentially can lead to denial of service. The gas cost increases exponentially with the number of tokenIds
.
Manual Review
The loop should be optimized to avoid iterating over all the tokenIds
. Potential optimization: store the tokenId
with the highest votes.
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.