@venusprotocol/governance-contracts 1.1.0-dev.2 → 1.1.0-dev.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +11 -0
  2. package/artifacts/build-info/52cd2a2ed6764b7fce3ff5a23ca8a581.json +1 -0
  3. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.dbg.json +1 -1
  4. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.dbg.json +1 -1
  5. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorAlphaInterface.dbg.json +1 -1
  6. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateInterface.dbg.json +1 -1
  7. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.dbg.json +1 -1
  8. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.dbg.json +1 -1
  9. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.dbg.json +1 -1
  10. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.dbg.json +1 -1
  11. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/TimelockInterface.dbg.json +1 -1
  12. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/XvsVaultInterface.dbg.json +1 -1
  13. package/artifacts/contracts/legacy/GovernorBravoDelegateV1.sol/GovernorBravoDelegateV1.dbg.json +4 -0
  14. package/artifacts/contracts/legacy/GovernorBravoDelegateV1.sol/GovernorBravoDelegateV1.json +1143 -0
  15. package/artifacts/contracts/legacy/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.dbg.json +4 -0
  16. package/artifacts/contracts/legacy/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.json +278 -0
  17. package/artifacts/contracts/legacy/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.dbg.json +4 -0
  18. package/artifacts/contracts/legacy/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.json +56 -0
  19. package/artifacts/contracts/legacy/GovernorBravoInterfaces.sol/GovernorBravoEventsV1.dbg.json +4 -0
  20. package/artifacts/contracts/legacy/GovernorBravoInterfaces.sol/GovernorBravoEventsV1.json +306 -0
  21. package/contracts/legacy/GovernorBravoDelegateV1.sol +528 -0
  22. package/contracts/legacy/GovernorBravoInterfaces.sol +176 -0
  23. package/deployments/bscmainnet/AccessControlManager.json +285 -0
  24. package/deployments/bscmainnet.json +7167 -0
  25. package/deployments/bsctestnet/AccessControlManager.json +364 -0
  26. package/deployments/bsctestnet.json +6437 -0
  27. package/deployments/sepolia.json +369 -0
  28. package/package.json +1 -1
  29. package/artifacts/build-info/97a3124320e74f843bc59439c75c258d.json +0 -1
  30. package/deployments/deployments.json +0 -13981
@@ -0,0 +1,176 @@
1
+ pragma solidity ^0.5.16;
2
+ pragma experimental ABIEncoderV2;
3
+
4
+ import { XvsVaultInterface, TimelockInterface, GovernorAlphaInterface } from "../Governance/GovernorBravoInterfaces.sol";
5
+
6
+ /**
7
+ * @title GovernorBravoEvents
8
+ * @author Venus
9
+ * @notice Set of events emitted by the first GovernorBravo implementation contract.
10
+ * @dev This contract is included for archival and testing purposes as the ProposalCreated event has a different signature than the latest implementation.
11
+ */
12
+ contract GovernorBravoEventsV1 {
13
+ /// @notice An event emitted when a new proposal is created
14
+ event ProposalCreated(
15
+ uint id,
16
+ address proposer,
17
+ address[] targets,
18
+ uint[] values,
19
+ string[] signatures,
20
+ bytes[] calldatas,
21
+ uint startBlock,
22
+ uint endBlock,
23
+ string description
24
+ );
25
+
26
+ /// @notice An event emitted when a vote has been cast on a proposal
27
+ /// @param voter The address which casted a vote
28
+ /// @param proposalId The proposal id which was voted on
29
+ /// @param support Support value for the vote. 0=against, 1=for, 2=abstain
30
+ /// @param votes Number of votes which were cast by the voter
31
+ /// @param reason The reason given for the vote by the voter
32
+ event VoteCast(address indexed voter, uint proposalId, uint8 support, uint votes, string reason);
33
+
34
+ /// @notice An event emitted when a proposal has been canceled
35
+ event ProposalCanceled(uint id);
36
+
37
+ /// @notice An event emitted when a proposal has been queued in the Timelock
38
+ event ProposalQueued(uint id, uint eta);
39
+
40
+ /// @notice An event emitted when a proposal has been executed in the Timelock
41
+ event ProposalExecuted(uint id);
42
+
43
+ /// @notice An event emitted when the voting delay is set
44
+ event VotingDelaySet(uint oldVotingDelay, uint newVotingDelay);
45
+
46
+ /// @notice An event emitted when the voting period is set
47
+ event VotingPeriodSet(uint oldVotingPeriod, uint newVotingPeriod);
48
+
49
+ /// @notice Emitted when implementation is changed
50
+ event NewImplementation(address oldImplementation, address newImplementation);
51
+
52
+ /// @notice Emitted when proposal threshold is set
53
+ event ProposalThresholdSet(uint oldProposalThreshold, uint newProposalThreshold);
54
+
55
+ /// @notice Emitted when pendingAdmin is changed
56
+ event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);
57
+
58
+ /// @notice Emitted when pendingAdmin is accepted, which means admin is updated
59
+ event NewAdmin(address oldAdmin, address newAdmin);
60
+
61
+ /// @notice Emitted when the new guardian address is set
62
+ event NewGuardian(address oldGuardian, address newGuardian);
63
+
64
+ /// @notice Emitted when the maximum number of operations in one proposal is updated
65
+ event ProposalMaxOperationsUpdated(uint oldMaxOperations, uint newMaxOperations);
66
+ }
67
+
68
+ /**
69
+ * @title GovernorBravoDelegatorStorage
70
+ * @author Venus
71
+ * @notice Storage layout of the `GovernorBravoDelegator` contract
72
+ */
73
+ contract GovernorBravoDelegatorStorage {
74
+ /// @notice Administrator for this contract
75
+ address public admin;
76
+
77
+ /// @notice Pending administrator for this contract
78
+ address public pendingAdmin;
79
+
80
+ /// @notice Active brains of Governor
81
+ address public implementation;
82
+ }
83
+
84
+ /**
85
+ * @title GovernorBravoDelegateStorageV1
86
+ * @dev This contract is included for archival and testing purposes as the Proposal struct has a different shape than the latest implementation.
87
+ */
88
+ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage {
89
+ /// @notice DEPRECATED The delay before voting on a proposal may take place, once proposed, in blocks
90
+ uint public votingDelay;
91
+
92
+ /// @notice DEPRECATED The duration of voting on a proposal, in blocks
93
+ uint public votingPeriod;
94
+
95
+ /// @notice DEPRECATED The number of votes required in order for a voter to become a proposer
96
+ uint public proposalThreshold;
97
+
98
+ /// @notice Initial proposal id set at become
99
+ uint public initialProposalId;
100
+
101
+ /// @notice The total number of proposals
102
+ uint public proposalCount;
103
+
104
+ /// @notice The address of the Venus Protocol Timelock
105
+ TimelockInterface public timelock;
106
+
107
+ /// @notice The address of the Venus governance token
108
+ XvsVaultInterface public xvsVault;
109
+
110
+ /// @notice The official record of all proposals ever proposed
111
+ mapping(uint => Proposal) public proposals;
112
+
113
+ /// @notice The latest proposal for each proposer
114
+ mapping(address => uint) public latestProposalIds;
115
+
116
+ struct Proposal {
117
+ /// @notice Unique id for looking up a proposal
118
+ uint id;
119
+ /// @notice Creator of the proposal
120
+ address proposer;
121
+ /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
122
+ uint eta;
123
+ /// @notice the ordered list of target addresses for calls to be made
124
+ address[] targets;
125
+ /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
126
+ uint[] values;
127
+ /// @notice The ordered list of function signatures to be called
128
+ string[] signatures;
129
+ /// @notice The ordered list of calldata to be passed to each call
130
+ bytes[] calldatas;
131
+ /// @notice The block at which voting begins: holders must delegate their votes prior to this block
132
+ uint startBlock;
133
+ /// @notice The block at which voting ends: votes must be cast prior to this block
134
+ uint endBlock;
135
+ /// @notice Current number of votes in favor of this proposal
136
+ uint forVotes;
137
+ /// @notice Current number of votes in opposition to this proposal
138
+ uint againstVotes;
139
+ /// @notice Current number of votes for abstaining for this proposal
140
+ uint abstainVotes;
141
+ /// @notice Flag marking whether the proposal has been canceled
142
+ bool canceled;
143
+ /// @notice Flag marking whether the proposal has been executed
144
+ bool executed;
145
+ /// @notice Receipts of ballots for the entire set of voters
146
+ mapping(address => Receipt) receipts;
147
+ }
148
+
149
+ /// @notice Ballot receipt record for a voter
150
+ struct Receipt {
151
+ /// @notice Whether or not a vote has been cast
152
+ bool hasVoted;
153
+ /// @notice Whether or not the voter supports the proposal or abstains
154
+ uint8 support;
155
+ /// @notice The number of votes the voter had, which were cast
156
+ uint96 votes;
157
+ }
158
+
159
+ /// @notice Possible states that a proposal may be in
160
+ enum ProposalState {
161
+ Pending,
162
+ Active,
163
+ Canceled,
164
+ Defeated,
165
+ Succeeded,
166
+ Queued,
167
+ Expired,
168
+ Executed
169
+ }
170
+
171
+ /// @notice The maximum number of actions that can be included in a proposal
172
+ uint public proposalMaxOperations;
173
+
174
+ /// @notice A privileged role that can cancel any proposal
175
+ address public guardian;
176
+ }
@@ -0,0 +1,285 @@
1
+ {
2
+ "address": "0x4788629abc6cfca10f9f969efdeaa1cf70c23555",
3
+ "abi": [
4
+ {
5
+ "inputs": [],
6
+ "stateMutability": "nonpayable",
7
+ "type": "constructor"
8
+ },
9
+ {
10
+ "anonymous": false,
11
+ "inputs": [
12
+ {
13
+ "indexed": true,
14
+ "internalType": "bytes32",
15
+ "name": "role",
16
+ "type": "bytes32"
17
+ },
18
+ {
19
+ "indexed": true,
20
+ "internalType": "bytes32",
21
+ "name": "previousAdminRole",
22
+ "type": "bytes32"
23
+ },
24
+ {
25
+ "indexed": true,
26
+ "internalType": "bytes32",
27
+ "name": "newAdminRole",
28
+ "type": "bytes32"
29
+ }
30
+ ],
31
+ "name": "RoleAdminChanged",
32
+ "type": "event"
33
+ },
34
+ {
35
+ "anonymous": false,
36
+ "inputs": [
37
+ {
38
+ "indexed": true,
39
+ "internalType": "bytes32",
40
+ "name": "role",
41
+ "type": "bytes32"
42
+ },
43
+ {
44
+ "indexed": true,
45
+ "internalType": "address",
46
+ "name": "account",
47
+ "type": "address"
48
+ },
49
+ {
50
+ "indexed": true,
51
+ "internalType": "address",
52
+ "name": "sender",
53
+ "type": "address"
54
+ }
55
+ ],
56
+ "name": "RoleGranted",
57
+ "type": "event"
58
+ },
59
+ {
60
+ "anonymous": false,
61
+ "inputs": [
62
+ {
63
+ "indexed": true,
64
+ "internalType": "bytes32",
65
+ "name": "role",
66
+ "type": "bytes32"
67
+ },
68
+ {
69
+ "indexed": true,
70
+ "internalType": "address",
71
+ "name": "account",
72
+ "type": "address"
73
+ },
74
+ {
75
+ "indexed": true,
76
+ "internalType": "address",
77
+ "name": "sender",
78
+ "type": "address"
79
+ }
80
+ ],
81
+ "name": "RoleRevoked",
82
+ "type": "event"
83
+ },
84
+ {
85
+ "inputs": [],
86
+ "name": "DEFAULT_ADMIN_ROLE",
87
+ "outputs": [
88
+ {
89
+ "internalType": "bytes32",
90
+ "name": "",
91
+ "type": "bytes32"
92
+ }
93
+ ],
94
+ "stateMutability": "view",
95
+ "type": "function"
96
+ },
97
+ {
98
+ "inputs": [
99
+ {
100
+ "internalType": "bytes32",
101
+ "name": "role",
102
+ "type": "bytes32"
103
+ }
104
+ ],
105
+ "name": "getRoleAdmin",
106
+ "outputs": [
107
+ {
108
+ "internalType": "bytes32",
109
+ "name": "",
110
+ "type": "bytes32"
111
+ }
112
+ ],
113
+ "stateMutability": "view",
114
+ "type": "function"
115
+ },
116
+ {
117
+ "inputs": [
118
+ {
119
+ "internalType": "address",
120
+ "name": "contractAddress",
121
+ "type": "address"
122
+ },
123
+ {
124
+ "internalType": "string",
125
+ "name": "functionSig",
126
+ "type": "string"
127
+ },
128
+ {
129
+ "internalType": "address",
130
+ "name": "accountToPermit",
131
+ "type": "address"
132
+ }
133
+ ],
134
+ "name": "giveCallPermission",
135
+ "outputs": [],
136
+ "stateMutability": "nonpayable",
137
+ "type": "function"
138
+ },
139
+ {
140
+ "inputs": [
141
+ {
142
+ "internalType": "bytes32",
143
+ "name": "role",
144
+ "type": "bytes32"
145
+ },
146
+ {
147
+ "internalType": "address",
148
+ "name": "account",
149
+ "type": "address"
150
+ }
151
+ ],
152
+ "name": "grantRole",
153
+ "outputs": [],
154
+ "stateMutability": "nonpayable",
155
+ "type": "function"
156
+ },
157
+ {
158
+ "inputs": [
159
+ {
160
+ "internalType": "bytes32",
161
+ "name": "role",
162
+ "type": "bytes32"
163
+ },
164
+ {
165
+ "internalType": "address",
166
+ "name": "account",
167
+ "type": "address"
168
+ }
169
+ ],
170
+ "name": "hasRole",
171
+ "outputs": [
172
+ {
173
+ "internalType": "bool",
174
+ "name": "",
175
+ "type": "bool"
176
+ }
177
+ ],
178
+ "stateMutability": "view",
179
+ "type": "function"
180
+ },
181
+ {
182
+ "inputs": [
183
+ {
184
+ "internalType": "address",
185
+ "name": "account",
186
+ "type": "address"
187
+ },
188
+ {
189
+ "internalType": "string",
190
+ "name": "functionSig",
191
+ "type": "string"
192
+ }
193
+ ],
194
+ "name": "isAllowedToCall",
195
+ "outputs": [
196
+ {
197
+ "internalType": "bool",
198
+ "name": "",
199
+ "type": "bool"
200
+ }
201
+ ],
202
+ "stateMutability": "view",
203
+ "type": "function"
204
+ },
205
+ {
206
+ "inputs": [
207
+ {
208
+ "internalType": "bytes32",
209
+ "name": "role",
210
+ "type": "bytes32"
211
+ },
212
+ {
213
+ "internalType": "address",
214
+ "name": "account",
215
+ "type": "address"
216
+ }
217
+ ],
218
+ "name": "renounceRole",
219
+ "outputs": [],
220
+ "stateMutability": "nonpayable",
221
+ "type": "function"
222
+ },
223
+ {
224
+ "inputs": [
225
+ {
226
+ "internalType": "address",
227
+ "name": "contractAddress",
228
+ "type": "address"
229
+ },
230
+ {
231
+ "internalType": "string",
232
+ "name": "functionSig",
233
+ "type": "string"
234
+ },
235
+ {
236
+ "internalType": "address",
237
+ "name": "accountToRevoke",
238
+ "type": "address"
239
+ }
240
+ ],
241
+ "name": "revokeCallPermission",
242
+ "outputs": [],
243
+ "stateMutability": "nonpayable",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "inputs": [
248
+ {
249
+ "internalType": "bytes32",
250
+ "name": "role",
251
+ "type": "bytes32"
252
+ },
253
+ {
254
+ "internalType": "address",
255
+ "name": "account",
256
+ "type": "address"
257
+ }
258
+ ],
259
+ "name": "revokeRole",
260
+ "outputs": [],
261
+ "stateMutability": "nonpayable",
262
+ "type": "function"
263
+ },
264
+ {
265
+ "inputs": [
266
+ {
267
+ "internalType": "bytes4",
268
+ "name": "interfaceId",
269
+ "type": "bytes4"
270
+ }
271
+ ],
272
+ "name": "supportsInterface",
273
+ "outputs": [
274
+ {
275
+ "internalType": "bool",
276
+ "name": "",
277
+ "type": "bool"
278
+ }
279
+ ],
280
+ "stateMutability": "view",
281
+ "type": "function"
282
+ }
283
+ ],
284
+ "numDeployments": 1
285
+ }