@venusprotocol/governance-contracts 1.0.1-dev.6 → 1.1.0-dev.2

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 (70) hide show
  1. package/artifacts/build-info/4b74a981a83b37e1de5123f7f9359ad5.json +1 -0
  2. package/artifacts/build-info/5ef7ba07b1e4b96d9b02042d36d229c2.json +1 -0
  3. package/artifacts/build-info/97a3124320e74f843bc59439c75c258d.json +1 -0
  4. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.dbg.json +1 -1
  5. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.json +3 -3
  6. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.dbg.json +1 -1
  7. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.json +25 -18
  8. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorAlphaInterface.dbg.json +1 -1
  9. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateInterface.dbg.json +4 -0
  10. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateInterface.json +58 -0
  11. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.dbg.json +1 -1
  12. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.json +2 -2
  13. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.dbg.json +1 -1
  14. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.json +2 -2
  15. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.dbg.json +1 -1
  16. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.json +2 -2
  17. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.dbg.json +1 -1
  18. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.json +2 -2
  19. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/TimelockInterface.dbg.json +1 -1
  20. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/XvsVaultInterface.dbg.json +1 -1
  21. package/artifacts/contracts/legacy/GovernorAlpha.sol/GovernorAlpha.dbg.json +4 -0
  22. package/artifacts/contracts/legacy/GovernorAlpha.sol/GovernorAlpha.json +731 -0
  23. package/artifacts/contracts/legacy/GovernorAlpha.sol/TimelockInterface.dbg.json +4 -0
  24. package/artifacts/contracts/legacy/GovernorAlpha.sol/TimelockInterface.json +188 -0
  25. package/artifacts/contracts/legacy/GovernorAlpha.sol/XVSInterface.dbg.json +4 -0
  26. package/artifacts/contracts/legacy/GovernorAlpha.sol/XVSInterface.json +37 -0
  27. package/artifacts/contracts/legacy/GovernorAlpha2.sol/GovernorAlpha2.dbg.json +4 -0
  28. package/artifacts/contracts/legacy/GovernorAlpha2.sol/GovernorAlpha2.json +736 -0
  29. package/artifacts/contracts/legacy/GovernorAlpha2.sol/TimelockInterface.dbg.json +4 -0
  30. package/artifacts/contracts/legacy/GovernorAlpha2.sol/TimelockInterface.json +188 -0
  31. package/artifacts/contracts/legacy/GovernorAlpha2.sol/XVSInterface.dbg.json +4 -0
  32. package/artifacts/contracts/legacy/GovernorAlpha2.sol/XVSInterface.json +37 -0
  33. package/contracts/Governance/GovernorBravoDelegate.sol +1 -1
  34. package/contracts/Governance/GovernorBravoDelegator.sol +6 -10
  35. package/contracts/Governance/GovernorBravoInterfaces.sol +19 -5
  36. package/contracts/legacy/GovernorAlpha.sol +426 -0
  37. package/contracts/legacy/GovernorAlpha2.sol +427 -0
  38. package/deployments/bscmainnet/.chainId +1 -0
  39. package/deployments/bscmainnet/CriticalTimelock.json +463 -0
  40. package/deployments/bscmainnet/FastTrackTimelock.json +463 -0
  41. package/deployments/bscmainnet/GovernorAlpha.json +726 -0
  42. package/deployments/bscmainnet/GovernorAlpha2.json +731 -0
  43. package/deployments/bscmainnet/GovernorBravoDelegate.json +1168 -0
  44. package/deployments/bscmainnet/GovernorBravoDelegator.json +1576 -0
  45. package/deployments/bscmainnet/GovernorBravoDelegator_Implementation.json +1168 -0
  46. package/deployments/bscmainnet/GovernorBravoDelegator_Proxy.json +413 -0
  47. package/deployments/bscmainnet/NormalTimelock.json +463 -0
  48. package/deployments/bsctestnet/.chainId +1 -0
  49. package/deployments/bsctestnet/CriticalTimelock.json +463 -0
  50. package/deployments/bsctestnet/FastTrackTimelock.json +463 -0
  51. package/deployments/bsctestnet/GovernorAlpha.json +726 -0
  52. package/deployments/bsctestnet/GovernorBravoDelegate.json +1168 -0
  53. package/deployments/bsctestnet/GovernorBravoDelegator.json +1576 -0
  54. package/deployments/bsctestnet/GovernorBravoDelegator_Implementation.json +1168 -0
  55. package/deployments/bsctestnet/GovernorBravoDelegator_Proxy.json +413 -0
  56. package/deployments/bsctestnet/NormalTimelock.json +463 -0
  57. package/deployments/deployments.json +13981 -0
  58. package/dist/deploy/001-access-control.d.ts.map +1 -1
  59. package/dist/deploy/001-access-control.js +7 -2
  60. package/dist/deploy/001-access-control.js.map +1 -1
  61. package/dist/deploy/helpers/constants.d.ts +2 -0
  62. package/dist/deploy/helpers/constants.d.ts.map +1 -1
  63. package/dist/deploy/helpers/constants.js +1 -0
  64. package/dist/deploy/helpers/constants.js.map +1 -1
  65. package/dist/deploy/helpers/deploymentUtils.d.ts +2 -0
  66. package/dist/deploy/helpers/deploymentUtils.d.ts.map +1 -1
  67. package/dist/deploy/helpers/deploymentUtils.js +1 -0
  68. package/dist/deploy/helpers/deploymentUtils.js.map +1 -1
  69. package/package.json +1 -1
  70. package/artifacts/build-info/e5638231ea42ec29d0230b1b013f1a57.json +0 -1
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/5ef7ba07b1e4b96d9b02042d36d229c2.json"
4
+ }
@@ -0,0 +1,188 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "TimelockInterface",
4
+ "sourceName": "contracts/legacy/GovernorAlpha2.sol",
5
+ "abi": [
6
+ {
7
+ "constant": true,
8
+ "inputs": [],
9
+ "name": "GRACE_PERIOD",
10
+ "outputs": [
11
+ {
12
+ "internalType": "uint256",
13
+ "name": "",
14
+ "type": "uint256"
15
+ }
16
+ ],
17
+ "payable": false,
18
+ "stateMutability": "view",
19
+ "type": "function"
20
+ },
21
+ {
22
+ "constant": false,
23
+ "inputs": [],
24
+ "name": "acceptAdmin",
25
+ "outputs": [],
26
+ "payable": false,
27
+ "stateMutability": "nonpayable",
28
+ "type": "function"
29
+ },
30
+ {
31
+ "constant": false,
32
+ "inputs": [
33
+ {
34
+ "internalType": "address",
35
+ "name": "target",
36
+ "type": "address"
37
+ },
38
+ {
39
+ "internalType": "uint256",
40
+ "name": "value",
41
+ "type": "uint256"
42
+ },
43
+ {
44
+ "internalType": "string",
45
+ "name": "signature",
46
+ "type": "string"
47
+ },
48
+ {
49
+ "internalType": "bytes",
50
+ "name": "data",
51
+ "type": "bytes"
52
+ },
53
+ {
54
+ "internalType": "uint256",
55
+ "name": "eta",
56
+ "type": "uint256"
57
+ }
58
+ ],
59
+ "name": "cancelTransaction",
60
+ "outputs": [],
61
+ "payable": false,
62
+ "stateMutability": "nonpayable",
63
+ "type": "function"
64
+ },
65
+ {
66
+ "constant": true,
67
+ "inputs": [],
68
+ "name": "delay",
69
+ "outputs": [
70
+ {
71
+ "internalType": "uint256",
72
+ "name": "",
73
+ "type": "uint256"
74
+ }
75
+ ],
76
+ "payable": false,
77
+ "stateMutability": "view",
78
+ "type": "function"
79
+ },
80
+ {
81
+ "constant": false,
82
+ "inputs": [
83
+ {
84
+ "internalType": "address",
85
+ "name": "target",
86
+ "type": "address"
87
+ },
88
+ {
89
+ "internalType": "uint256",
90
+ "name": "value",
91
+ "type": "uint256"
92
+ },
93
+ {
94
+ "internalType": "string",
95
+ "name": "signature",
96
+ "type": "string"
97
+ },
98
+ {
99
+ "internalType": "bytes",
100
+ "name": "data",
101
+ "type": "bytes"
102
+ },
103
+ {
104
+ "internalType": "uint256",
105
+ "name": "eta",
106
+ "type": "uint256"
107
+ }
108
+ ],
109
+ "name": "executeTransaction",
110
+ "outputs": [
111
+ {
112
+ "internalType": "bytes",
113
+ "name": "",
114
+ "type": "bytes"
115
+ }
116
+ ],
117
+ "payable": true,
118
+ "stateMutability": "payable",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "constant": false,
123
+ "inputs": [
124
+ {
125
+ "internalType": "address",
126
+ "name": "target",
127
+ "type": "address"
128
+ },
129
+ {
130
+ "internalType": "uint256",
131
+ "name": "value",
132
+ "type": "uint256"
133
+ },
134
+ {
135
+ "internalType": "string",
136
+ "name": "signature",
137
+ "type": "string"
138
+ },
139
+ {
140
+ "internalType": "bytes",
141
+ "name": "data",
142
+ "type": "bytes"
143
+ },
144
+ {
145
+ "internalType": "uint256",
146
+ "name": "eta",
147
+ "type": "uint256"
148
+ }
149
+ ],
150
+ "name": "queueTransaction",
151
+ "outputs": [
152
+ {
153
+ "internalType": "bytes32",
154
+ "name": "",
155
+ "type": "bytes32"
156
+ }
157
+ ],
158
+ "payable": false,
159
+ "stateMutability": "nonpayable",
160
+ "type": "function"
161
+ },
162
+ {
163
+ "constant": true,
164
+ "inputs": [
165
+ {
166
+ "internalType": "bytes32",
167
+ "name": "hash",
168
+ "type": "bytes32"
169
+ }
170
+ ],
171
+ "name": "queuedTransactions",
172
+ "outputs": [
173
+ {
174
+ "internalType": "bool",
175
+ "name": "",
176
+ "type": "bool"
177
+ }
178
+ ],
179
+ "payable": false,
180
+ "stateMutability": "view",
181
+ "type": "function"
182
+ }
183
+ ],
184
+ "bytecode": "0x",
185
+ "deployedBytecode": "0x",
186
+ "linkReferences": {},
187
+ "deployedLinkReferences": {}
188
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "_format": "hh-sol-dbg-1",
3
+ "buildInfo": "../../../build-info/5ef7ba07b1e4b96d9b02042d36d229c2.json"
4
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "_format": "hh-sol-artifact-1",
3
+ "contractName": "XVSInterface",
4
+ "sourceName": "contracts/legacy/GovernorAlpha2.sol",
5
+ "abi": [
6
+ {
7
+ "constant": true,
8
+ "inputs": [
9
+ {
10
+ "internalType": "address",
11
+ "name": "account",
12
+ "type": "address"
13
+ },
14
+ {
15
+ "internalType": "uint256",
16
+ "name": "blockNumber",
17
+ "type": "uint256"
18
+ }
19
+ ],
20
+ "name": "getPriorVotes",
21
+ "outputs": [
22
+ {
23
+ "internalType": "uint96",
24
+ "name": "",
25
+ "type": "uint96"
26
+ }
27
+ ],
28
+ "payable": false,
29
+ "stateMutability": "view",
30
+ "type": "function"
31
+ }
32
+ ],
33
+ "bytecode": "0x",
34
+ "deployedBytecode": "0x",
35
+ "linkReferences": {},
36
+ "deployedLinkReferences": {}
37
+ }
@@ -70,7 +70,7 @@ import "./GovernorBravoInterfaces.sol";
70
70
  * The delegation of votes happens through the `XVSVault` contract by calling the `delegate` or `delegateBySig` functions. These same functions can revert
71
71
  * vote delegation by calling the same function with a value of `0`.
72
72
  */
73
- contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoEvents {
73
+ contract GovernorBravoDelegate is GovernorBravoDelegateInterface, GovernorBravoDelegateStorageV2, GovernorBravoEvents {
74
74
  /// @notice The name of this contract
75
75
  string public constant name = "Venus Governor Bravo";
76
76
 
@@ -10,13 +10,11 @@ import "./GovernorBravoInterfaces.sol";
10
10
  */
11
11
  contract GovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoEvents {
12
12
  constructor(
13
- address timelock_,
14
13
  address xvsVault_,
15
14
  address admin_,
16
15
  address implementation_,
17
- uint votingPeriod_,
18
- uint votingDelay_,
19
- uint proposalThreshold_,
16
+ GovernorBravoDelegateInterface.ProposalConfig[] memory proposalConfigs_,
17
+ address[] memory timelocks_,
20
18
  address guardian_
21
19
  ) public {
22
20
  // Admin set to msg.sender for initialization
@@ -24,13 +22,11 @@ contract GovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoE
24
22
 
25
23
  delegateTo(
26
24
  implementation_,
27
- abi.encodeWithSignature(
28
- "initialize(address,address,uint256,uint256,uint256,address)",
29
- timelock_,
25
+ abi.encodeWithSelector(
26
+ GovernorBravoDelegateInterface(implementation_).initialize.selector,
30
27
  xvsVault_,
31
- votingPeriod_,
32
- votingDelay_,
33
- proposalThreshold_,
28
+ proposalConfigs_,
29
+ timelocks_,
34
30
  guardian_
35
31
  )
36
32
  );
@@ -190,6 +190,19 @@ contract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {
190
190
  CRITICAL
191
191
  }
192
192
 
193
+ /// @notice mapping containing configuration for each proposal type
194
+ mapping(uint => GovernorBravoDelegateInterface.ProposalConfig) public proposalConfigs;
195
+
196
+ /// @notice mapping containing Timelock addresses for each proposal type
197
+ mapping(uint => TimelockInterface) public proposalTimelocks;
198
+ }
199
+
200
+ /**
201
+ * @title TimelockInterface
202
+ * @author Venus
203
+ * @notice Interface implemented by the GovernorBravoDelegate contract.
204
+ */
205
+ interface GovernorBravoDelegateInterface {
193
206
  struct ProposalConfig {
194
207
  /// @notice The delay before voting on a proposal may take place, once proposed, in blocks
195
208
  uint256 votingDelay;
@@ -199,11 +212,12 @@ contract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {
199
212
  uint256 proposalThreshold;
200
213
  }
201
214
 
202
- /// @notice mapping containing configuration for each proposal type
203
- mapping(uint => ProposalConfig) public proposalConfigs;
204
-
205
- /// @notice mapping containing Timelock addresses for each proposal type
206
- mapping(uint => TimelockInterface) public proposalTimelocks;
215
+ function initialize(
216
+ address xvsVault_,
217
+ ProposalConfig[] calldata proposalConfigs_,
218
+ TimelockInterface[] calldata timelocks,
219
+ address guardian_
220
+ ) external;
207
221
  }
208
222
 
209
223
  /**