prevent vote overwrite

This commit is contained in:
Ricardo Guilherme Schmidt 2019-02-20 01:16:42 -03:00
parent 26e697584e
commit ff3aa67510
No known key found for this signature in database
GPG Key ID: BFB3F5C8ED618A94
1 changed files with 1 additions and 0 deletions

View File

@ -75,6 +75,7 @@ contract Proposal is Controlled, MessageSigned {
require(block.number > voteBlockEnd, "Voting running");
require(MerkleProof.verifyProof(_proof, signatures[_position], keccak256(_signature)), "Invalid proof");
address _voter = recoverAddress(keccak256(abi.encodePacked(address(this), _vote)), _signature);
require(voteMap[_voter] == Vote.Null, "Already tabulated");
voteMap[_voter] = _vote;
setTabulation(_voter, _voter, _vote);
}