MartenitsaVoting::voteForMartenitsa
misses to enforce that users can only vote after the voting has actually started. Consequently, users can start voting before the protocol owner would officially kick of voting by calling MartenitsaVoting::startVoting
.
MartenitsaEvent::voteForMartenitsa
is supposed to enable users to vote for listed Martenitsa NFTs within a predefined voting period. Voting period starts when the protocol owner calls MartenitsaVoting::startVoting
. In this same call, the duration and, hence, the end of the period is also defined.
MartenitsaEvent::voteForMartenitsa
correctly check whether the voting period has already ended or not, and if ended, does not allow more votes. It is, however, misses to check whether the voting period has actually started and, hence, users can start voting any time right after the creation of the contract.
This is demonstarted in the proof of code below:
Users can start voting before the start of the actual voting period.
Martentisa NFT owners noticing and exploiting this bug can get an unfair advantage in the voting: they will have more time to get and/or generate votes for their own listed NFTs. With this unfair advantage they can get the healthToken
rewards reserved for the winner of the vote.
Manual review, Foundry.
Implement a check in MartenitsaVoting::voteForMartenitsa
so that users will not be able to vote before the voting actually starts:
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.