@@ -7,36 +7,6 @@ import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
77import "@openzeppelin/contracts/proxy/utils/Initializable.sol " ;
88import "./VotingProxy.sol " ;
99
10- // Can a voter change his/her vote ? --> Yes
11- // Can a voter who grant proxy to somebody can still vote ? --> No
12- // Can s.he change proxy voter vote ? -->
13- // Can a proxy voter change original voter vote ?
14- // Is there a limit of delegate votes per proxy voters ?
15- // Can a voter grant proxy to more than one person on a given tag ?
16- // Do we need to have a started flag so admins can create a vote and start it afterwards ? --> No
17-
18- // Can a voter delegate to a voter that has less than 25k DPS ? --> No
19- // Is the 25k DPS limit for delegating balance DPS or undelegated DPS ? --> DPS balance
20-
21- // If A grant proxy to B, and if A and B call vote and reach the vote verification simultaneously, both A and B might register a vote for A
22- // ==> Could be solved by registering voters address instead of incrementing a count, but scales badly.
23-
24- // Currently, order is not kept for tags, causing index issues, 2 solutions :
25- // - remove reference to tag index and use value => forces to check each time there's a reference to a tag to verify it is a member of tag list.
26- // - do not change indexes at tag removal => residual value (such as empty string) will be left in the tag list.
27- // ==> Should owner even be able to remove a tag ?
28-
29- // Is granting recursive (if A grants proxy to B and B to C, does C has voting power of B+C or A+B+C ?)
30-
31- // Add/remove choices ?
32-
33- // A a voté 1
34- // B a voté 2
35-
36- // voters = address[]
37- // mapping(address => uint32) results
38- // results[C] == 0
39-
4010contract Ballot is Ownable , Initializable {
4111 IERC20Metadata public immutable DPS;
4212 VotingProxy public proxy;
@@ -81,12 +51,12 @@ contract Ballot is Ownable, Initializable {
8151 }
8252
8353 function vote (uint32 choiceIndex ) external {
84- require (! closed, ' Voting: Ballot is closed. ' );
85- require (choices.length > choiceIndex, ' Voting: Choice index is too high. ' );
54+ require (! closed, " Voting: Ballot is closed. " );
55+ require (choices.length > choiceIndex, " Voting: Choice index is too high. " );
8656
87- require (! proxy.hasDelegated (msg .sender ,tagIndex), ' Voting: Vote is delegated. ' ); // Verify that voter has not granted proxy to somebody.
57+ require (! proxy.hasDelegated (msg .sender ,tagIndex), " Voting: Vote is delegated. " ); // Verify that voter has not granted proxy to somebody.
8858
89- require (DPS.balanceOf (msg .sender ) >= 25e3 * 1e18 , ' Voting: Not enough DPS to vote. ' ); // 25k DPS limit
59+ require (DPS.balanceOf (msg .sender ) >= 25e3 * 1e18 , " Voting: Not enough DPS to vote. " ); // 25k DPS limit
9060
9161 if (! votes[msg .sender ].hasVoted) {
9262 votes[msg .sender ].hasVoted = true ;
@@ -97,7 +67,7 @@ contract Ballot is Ownable, Initializable {
9767 }
9868
9969 function closeBallot () external onlyOwner {
100- require (! closed, ' Voting: Ballot already closed. ' );
70+ require (! closed, " Voting: Ballot already closed. " );
10171
10272 closed = true ;
10373
0 commit comments