You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function revealVote(uint_pollID, uint_voteOption, uint_salt) external {
// Make sure the reveal period is activerequire(revealPeriodActive(_pollID));
require(!hasBeenRevealed(msg.sender, _pollID)); // prevent user from revealing multiple timesrequire(keccak256(_voteOption, _salt) ==getCommitHash(msg.sender, _pollID)); // compare resultant hash from inputs to original commitHashuint numTokens =getNumTokens(msg.sender, _pollID);
if (_voteOption ==1) // apply numTokens to appropriate poll choice
pollMap[_pollID].votesFor += numTokens;
else
pollMap[_pollID].votesAgainst += numTokens;
dllMap[msg.sender].remove(_pollID); // remove the node referring to this vote upon revealVoteRevealed(msg.sender, _pollID, numTokens, _voteOption);
}
The text was updated successfully, but these errors were encountered:
Prospective fix: Change else to else if (vote == 0), followed by an else { revert }. The user will never be able to reveal, but they will be able to rescue tokens.
https://github.com/ConsenSys/PLCRVoting/blob/master/contracts/PLCRVoting.sol#L174
The text was updated successfully, but these errors were encountered: