We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b220a2 commit 811fa19Copy full SHA for 811fa19
docs/examples/voting.rst
@@ -128,15 +128,17 @@ of votes.
128
// We found a loop in the delegation, not allowed.
129
require(to != msg.sender, "Found loop in delegation.");
130
}
131
-
132
- // Since `sender` is a reference, this
133
- // modifies `voters[msg.sender].voted`
+
134
Voter storage delegate_ = voters[to];
135
136
// Voters cannot delegate to accounts that cannot vote.
137
require(delegate_.weight >= 1);
+ // Since `sender` is a reference, this
138
+ // modifies `voters[msg.sender]`.
139
sender.voted = true;
140
sender.delegate = to;
141
142
if (delegate_.voted) {
143
// If the delegate already voted,
144
// directly add to the number of votes
0 commit comments