|
1 |
| -pragma solidity ^0.5.16; |
| 1 | +// SPDX-License-Identifier: BSD-3-Clause |
| 2 | + |
| 3 | +pragma solidity 0.6.11; |
2 | 4 | pragma experimental ABIEncoderV2;
|
3 | 5 |
|
4 | 6 | contract GovernorAlpha {
|
@@ -30,58 +32,58 @@ contract GovernorAlpha {
|
30 | 32 | uint public proposalCount;
|
31 | 33 |
|
32 | 34 | struct Proposal {
|
33 |
| - /// @notice Unique id for looking up a proposal |
| 35 | + // Unique id for looking up a proposal |
34 | 36 | uint id;
|
35 | 37 |
|
36 |
| - /// @notice Creator of the proposal |
| 38 | + // Creator of the proposal |
37 | 39 | address proposer;
|
38 | 40 |
|
39 |
| - /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds |
| 41 | + // The timestamp that the proposal will be available for execution, set once the vote succeeds |
40 | 42 | uint eta;
|
41 | 43 |
|
42 |
| - /// @notice the ordered list of target addresses for calls to be made |
| 44 | + // The ordered list of target addresses for calls to be made |
43 | 45 | address[] targets;
|
44 | 46 |
|
45 |
| - /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made |
| 47 | + // The ordered list of values (i.e. msg.value) to be passed to the calls to be made |
46 | 48 | uint[] values;
|
47 | 49 |
|
48 |
| - /// @notice The ordered list of function signatures to be called |
| 50 | + // The ordered list of function signatures to be called |
49 | 51 | string[] signatures;
|
50 | 52 |
|
51 |
| - /// @notice The ordered list of calldata to be passed to each call |
| 53 | + // The ordered list of calldata to be passed to each call |
52 | 54 | bytes[] calldatas;
|
53 | 55 |
|
54 |
| - /// @notice The block at which voting begins: holders must delegate their votes prior to this block |
| 56 | + // The block at which voting begins: holders must delegate their votes prior to this block |
55 | 57 | uint startBlock;
|
56 | 58 |
|
57 |
| - /// @notice The block at which voting ends: votes must be cast prior to this block |
| 59 | + // The block at which voting ends: votes must be cast prior to this block |
58 | 60 | uint endBlock;
|
59 | 61 |
|
60 |
| - /// @notice Current number of votes in favor of this proposal |
| 62 | + // Current number of votes in favor of this proposal |
61 | 63 | uint forVotes;
|
62 | 64 |
|
63 |
| - /// @notice Current number of votes in opposition to this proposal |
| 65 | + // Current number of votes in opposition to this proposal |
64 | 66 | uint againstVotes;
|
65 | 67 |
|
66 |
| - /// @notice Flag marking whether the proposal has been canceled |
| 68 | + // Flag marking whether the proposal has been canceled |
67 | 69 | bool canceled;
|
68 | 70 |
|
69 |
| - /// @notice Flag marking whether the proposal has been executed |
| 71 | + // Flag marking whether the proposal has been executed |
70 | 72 | bool executed;
|
71 | 73 |
|
72 |
| - /// @notice Receipts of ballots for the entire set of voters |
| 74 | + // Receipts of ballots for the entire set of voters |
73 | 75 | mapping (address => Receipt) receipts;
|
74 | 76 | }
|
75 | 77 |
|
76 | 78 | /// @notice Ballot receipt record for a voter
|
77 | 79 | struct Receipt {
|
78 |
| - /// @notice Whether or not a vote has been cast |
| 80 | + // Whether or not a vote has been cast |
79 | 81 | bool hasVoted;
|
80 | 82 |
|
81 |
| - /// @notice Whether or not the voter supports the proposal |
| 83 | + // Whether or not the voter supports the proposal |
82 | 84 | bool support;
|
83 | 85 |
|
84 |
| - /// @notice The number of votes the voter had, which were cast |
| 86 | + // The number of votes the voter had, which were cast |
85 | 87 | uint96 votes;
|
86 | 88 | }
|
87 | 89 |
|
@@ -190,7 +192,7 @@ contract GovernorAlpha {
|
190 | 192 | Proposal storage proposal = proposals[proposalId];
|
191 | 193 | proposal.executed = true;
|
192 | 194 | for (uint i = 0; i < proposal.targets.length; i++) {
|
193 |
| - timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); |
| 195 | + timelock.executeTransaction{value: proposal.values[i]}(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); |
194 | 196 | }
|
195 | 197 | emit ProposalExecuted(proposalId);
|
196 | 198 | }
|
|
0 commit comments