Skip to content

Instantly share code, notes, and snippets.

@atvanguard
Created November 5, 2018 01:39
Show Gist options
  • Save atvanguard/1d5b4145015860f43ebe2f07d0f3bcbf to your computer and use it in GitHub Desktop.
Save atvanguard/1d5b4145015860f43ebe2f07d0f3bcbf to your computer and use it in GitHub Desktop.
function vote(uint proposal) public isValidVoter {
require(
proposal < proposals.length,
'Invalid proposal id'
);
Voter storage voter = voters[msg.sender];
voter.vote = proposal;
voter.state = State.Voted;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment