There is no condition in MartenitsaVoting::announceWinner
which checks for the case of vote resulting in a draw which then picks only the first producer to get highest votes as a winner
If the vote ends in a draw then the MartenitsaVoting::announceWinner
picks the first producer to get highest votes as the winner where as both players have won the voting.
Note: Please Import {console}
in MartenitsaVoting.t.sol
by adding import {console} from "forge-std/Test.sol";
at the top for the PoC's to work effortlessly.
Voting results in a draw but the first producer to get highest votes is announced as winner
Votes May result in a draw hence instead of using uint256 winnerTokenId;
using a uint256 array i.e uint256[] winnerTokenId;
to push the winners
and announcing everyone on the array as a winner is a better choice.
Make the following Changes in MartenitsaVoting::announceWinner
function:
Alternatively, if only one winner is to be picked then owner can hold his vote until the end to solve the draw by voting to any one of the tokenIds , relevant changed should be done in the code to not announce the winner in case of draw and let owner make the final vote .
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.