Preserve camelCase in GovernorCountingSimple (#3608)

pull/3613/head
gmhacker.eth 3 years ago committed by GitHub
parent 85a9bed49e
commit d514cdd26e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      contracts/governance/extensions/GovernorCountingSimple.sol

@ -57,26 +57,26 @@ abstract contract GovernorCountingSimple is Governor {
uint256 abstainVotes
)
{
ProposalVote storage proposalvote = _proposalVotes[proposalId];
return (proposalvote.againstVotes, proposalvote.forVotes, proposalvote.abstainVotes);
ProposalVote storage proposalVote = _proposalVotes[proposalId];
return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);
}
/**
* @dev See {Governor-_quorumReached}.
*/
function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
ProposalVote storage proposalVote = _proposalVotes[proposalId];
return quorum(proposalSnapshot(proposalId)) <= proposalvote.forVotes + proposalvote.abstainVotes;
return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;
}
/**
* @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.
*/
function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
ProposalVote storage proposalVote = _proposalVotes[proposalId];
return proposalvote.forVotes > proposalvote.againstVotes;
return proposalVote.forVotes > proposalVote.againstVotes;
}
/**
@ -89,17 +89,17 @@ abstract contract GovernorCountingSimple is Governor {
uint256 weight,
bytes memory // params
) internal virtual override {
ProposalVote storage proposalvote = _proposalVotes[proposalId];
ProposalVote storage proposalVote = _proposalVotes[proposalId];
require(!proposalvote.hasVoted[account], "GovernorVotingSimple: vote already cast");
proposalvote.hasVoted[account] = true;
require(!proposalVote.hasVoted[account], "GovernorVotingSimple: vote already cast");
proposalVote.hasVoted[account] = true;
if (support == uint8(VoteType.Against)) {
proposalvote.againstVotes += weight;
proposalVote.againstVotes += weight;
} else if (support == uint8(VoteType.For)) {
proposalvote.forVotes += weight;
proposalVote.forVotes += weight;
} else if (support == uint8(VoteType.Abstain)) {
proposalvote.abstainVotes += weight;
proposalVote.abstainVotes += weight;
} else {
revert("GovernorVotingSimple: invalid value for enum VoteType");
}

Loading…
Cancel
Save