The _tokenIds array collects every token ID that receives a vote. However, it does not check for duplicates, meaning the same token ID can be pushed multiple times if it receives multiple votes.
the array _tokenIds is meant to store all tokenIds that were voted but there is no check that a tokenId is already voted for.
This can lead to gas issues as the array increases every time someone votes ( instead of everytime someone votes a token not voted before).
Visual inspection
add a mapping that is updated like below :
mapping(uint256 => bool) private _listedForVoting;
and inside voteForMartenitsa() add :
if (!_listedForVoting[tokenId]) {
_tokenIds.push(tokenId);
_listedForVoting[tokenId] = true;
}
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.