File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
contracts/governance/extensions Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
52
52
53
53
/**
54
54
* @dev See {IGovernor-hasVoted}.
55
+ *
56
+ * NOTE: Calling {castVote} (or similar) casts a vote using the voting power that is delegated to the voter.
57
+ * Conversely, calling {castOverrideVote} (or similar) uses the voting power of the account itself, from its asset
58
+ * balances. Casting an "override vote" does not count as voting and won't be reflected by this getter. Consider
59
+ * using {hasVotedOverride} to check if an account has casted an "override vote" for a given proposal id.
55
60
*/
56
61
function hasVoted (uint256 proposalId , address account ) public view virtual override returns (bool ) {
57
62
return _proposalVotes[proposalId].voteReceipt[account].casted != 0 ;
@@ -120,7 +125,11 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
120
125
return totalWeight;
121
126
}
122
127
123
- /// @dev Variant of {Governor-_countVote} that deals with vote overrides.
128
+ /**
129
+ * @dev Variant of {Governor-_countVote} that deals with vote overrides.
130
+ *
131
+ * NOTE: See {hasVoted} for more details about the difference between {castVote} and {castOverrideVote}.
132
+ */
124
133
function _countOverride (uint256 proposalId , address account , uint8 support ) internal virtual returns (uint256 ) {
125
134
ProposalVote storage proposalVote = _proposalVotes[proposalId];
126
135
@@ -150,7 +159,7 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
150
159
return overridenWeight;
151
160
}
152
161
153
- /// @dev variant of {Governor-_castVote} that deals with vote overrides.
162
+ /// @dev Variant of {Governor-_castVote} that deals with vote overrides.
154
163
function _castOverride (
155
164
uint256 proposalId ,
156
165
address account ,
You can’t perform that action at this time.
0 commit comments