@@ -27,8 +27,8 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
27
27
28
28
struct VoteReceipt {
29
29
uint8 casted; // 0 if vote was not casted. Otherwise: support + 1
30
- bool hasOverriden ;
31
- uint208 overridenWeight ;
30
+ bool hasOverridden ;
31
+ uint208 overriddenWeight ;
32
32
}
33
33
34
34
struct ProposalVote {
@@ -42,7 +42,7 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
42
42
/// @dev A delegated vote on `proposalId` was overridden by `weight`
43
43
event OverrideVoteCast (address indexed voter , uint256 proposalId , uint8 support , uint256 weight , string reason );
44
44
45
- error GovernorAlreadyOverridenVote (address account );
45
+ error GovernorAlreadyOverriddenVote (address account );
46
46
47
47
mapping (uint256 proposalId = > ProposalVote) private _proposalVotes;
48
48
@@ -70,7 +70,7 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
70
70
* @dev Check if an `account` has overridden their delegate for a proposal.
71
71
*/
72
72
function hasVotedOverride (uint256 proposalId , address account ) public view virtual returns (bool ) {
73
- return _proposalVotes[proposalId].voteReceipt[account].hasOverriden ;
73
+ return _proposalVotes[proposalId].voteReceipt[account].hasOverridden ;
74
74
}
75
75
76
76
/**
@@ -122,7 +122,7 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
122
122
revert GovernorAlreadyCastVote (account);
123
123
}
124
124
125
- totalWeight -= proposalVote.voteReceipt[account].overridenWeight ;
125
+ totalWeight -= proposalVote.voteReceipt[account].overriddenWeight ;
126
126
proposalVote.votes[support] += totalWeight;
127
127
proposalVote.voteReceipt[account].casted = support + 1 ;
128
128
@@ -141,26 +141,26 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
141
141
revert GovernorInvalidVoteType ();
142
142
}
143
143
144
- if (proposalVote.voteReceipt[account].hasOverriden ) {
145
- revert GovernorAlreadyOverridenVote (account);
144
+ if (proposalVote.voteReceipt[account].hasOverridden ) {
145
+ revert GovernorAlreadyOverriddenVote (account);
146
146
}
147
147
148
148
uint256 snapshot = proposalSnapshot (proposalId);
149
- uint256 overridenWeight = VotesExtended (address (token ())).getPastBalanceOf (account, snapshot);
149
+ uint256 overriddenWeight = VotesExtended (address (token ())).getPastBalanceOf (account, snapshot);
150
150
address delegate = VotesExtended (address (token ())).getPastDelegate (account, snapshot);
151
151
uint8 delegateCasted = proposalVote.voteReceipt[delegate].casted;
152
152
153
- proposalVote.voteReceipt[account].hasOverriden = true ;
154
- proposalVote.votes[support] += overridenWeight ;
153
+ proposalVote.voteReceipt[account].hasOverridden = true ;
154
+ proposalVote.votes[support] += overriddenWeight ;
155
155
if (delegateCasted == 0 ) {
156
- proposalVote.voteReceipt[delegate].overridenWeight += SafeCast.toUint208 (overridenWeight );
156
+ proposalVote.voteReceipt[delegate].overriddenWeight += SafeCast.toUint208 (overriddenWeight );
157
157
} else {
158
158
uint8 delegateSupport = delegateCasted - 1 ;
159
- proposalVote.votes[delegateSupport] -= overridenWeight ;
160
- emit VoteReduced (delegate, proposalId, delegateSupport, overridenWeight );
159
+ proposalVote.votes[delegateSupport] -= overriddenWeight ;
160
+ emit VoteReduced (delegate, proposalId, delegateSupport, overriddenWeight );
161
161
}
162
162
163
- return overridenWeight ;
163
+ return overriddenWeight ;
164
164
}
165
165
166
166
/// @dev Variant of {Governor-_castVote} that deals with vote overrides. Returns the overridden weight.
@@ -172,13 +172,13 @@ abstract contract GovernorCountingOverridable is GovernorVotes {
172
172
) internal virtual returns (uint256 ) {
173
173
_validateStateBitmap (proposalId, _encodeStateBitmap (ProposalState.Active));
174
174
175
- uint256 overridenWeight = _countOverride (proposalId, account, support);
175
+ uint256 overriddenWeight = _countOverride (proposalId, account, support);
176
176
177
- emit OverrideVoteCast (account, proposalId, support, overridenWeight , reason);
177
+ emit OverrideVoteCast (account, proposalId, support, overriddenWeight , reason);
178
178
179
179
_tallyUpdated (proposalId);
180
180
181
- return overridenWeight ;
181
+ return overriddenWeight ;
182
182
}
183
183
184
184
/// @dev Public function for casting an override vote. Returns the overridden weight.
0 commit comments