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
{{ message }}
This repository was archived by the owner on May 1, 2026. It is now read-only.
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);
}
https://github.com/ConsenSys/PLCRVoting/blob/master/contracts/PLCRVoting.sol#L174