Skip to content

Instantly share code, notes, and snippets.

@skmgoldin
Created September 5, 2017 22:18
Show Gist options
  • Save skmgoldin/6553d1c1b25f6571b1262835126dac71 to your computer and use it in GitHub Desktop.
Save skmgoldin/6553d1c1b25f6571b1262835126dac71 to your computer and use it in GitHub Desktop.
function startPoll(uint _voteQuorum, uint _commitDuration, uint _revealDuration) public returns (uint pollID) {
pollNonce = pollNonce + 1;
pollMap[pollNonce] = Poll({
voteQuorum: _voteQuorum,
commitEndDate: block.timestamp + _commitDuration,
revealEndDate: block.timestamp + _commitDuration + _revealDuration,
votesFor: 0,
votesAgainst: 0
});
PollCreated(pollNonce);
return pollNonce;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment