@venusprotocol/governance-contracts 1.0.1-dev.1 → 1.0.1-dev.3

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 (57) hide show
  1. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +1 -1
  2. package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +1 -1
  3. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  4. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
  5. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +1 -1
  6. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +1 -1
  7. package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +1 -1
  8. package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +1 -1
  9. package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  10. package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  11. package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  12. package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  13. package/artifacts/build-info/0e028ff5062f0f59a7ffef92b702c074.json +1 -0
  14. package/artifacts/build-info/56323f6708e82b6f7b159248c3c1268a.json +1 -0
  15. package/artifacts/build-info/bb792d434e41d4003eeb48354b3a6c5c.json +1 -0
  16. package/artifacts/build-info/e5638231ea42ec29d0230b1b013f1a57.json +1 -0
  17. package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +1 -1
  18. package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +2 -2
  19. package/artifacts/contracts/Governance/AccessControlledV5.sol/AccessControlledV5.dbg.json +1 -1
  20. package/artifacts/contracts/Governance/AccessControlledV5.sol/AccessControlledV5.json +2 -2
  21. package/artifacts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.dbg.json +1 -1
  22. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.dbg.json +1 -1
  23. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.json +2 -2
  24. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.dbg.json +1 -1
  25. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.json +2 -2
  26. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorAlphaInterface.dbg.json +1 -1
  27. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.dbg.json +1 -1
  28. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.json +2 -2
  29. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.dbg.json +1 -1
  30. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.json +2 -2
  31. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.dbg.json +1 -1
  32. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.json +2 -2
  33. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.dbg.json +1 -1
  34. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.json +2 -2
  35. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/TimelockInterface.dbg.json +1 -1
  36. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/XvsVaultInterface.dbg.json +1 -1
  37. package/artifacts/contracts/Governance/IAccessControlManagerV5.sol/IAccessControlManagerV5.dbg.json +1 -1
  38. package/artifacts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +1 -1
  39. package/artifacts/contracts/Governance/Timelock.sol/Timelock.dbg.json +1 -1
  40. package/artifacts/contracts/Governance/Timelock.sol/Timelock.json +2 -2
  41. package/artifacts/contracts/Utils/SafeMath.sol/SafeMath.dbg.json +1 -1
  42. package/artifacts/contracts/test/MockAccessTest.sol/MockAccessTest.dbg.json +1 -1
  43. package/artifacts/contracts/test/MockAccessTest.sol/MockAccessTest.json +2 -2
  44. package/contracts/Governance/AccessControlManager.sol +44 -5
  45. package/contracts/Governance/AccessControlledV5.sol +4 -5
  46. package/contracts/Governance/AccessControlledV8.sol +4 -6
  47. package/contracts/Governance/GovernorBravoDelegate.sol +67 -0
  48. package/contracts/Governance/GovernorBravoDelegator.sol +5 -0
  49. package/contracts/Governance/GovernorBravoInterfaces.sol +23 -2
  50. package/contracts/Governance/IAccessControlManagerV5.sol +5 -0
  51. package/contracts/Governance/IAccessControlManagerV8.sol +5 -0
  52. package/contracts/Governance/Timelock.sol +63 -1
  53. package/package.json +1 -1
  54. package/artifacts/build-info/0ed8a45a04a58741f8391cb7a77f7ff9.json +0 -1
  55. package/artifacts/build-info/1659b7cff20ee8b7949bfbefa681db8b.json +0 -1
  56. package/artifacts/build-info/21eeeec59918770851ef762f6f414247.json +0 -1
  57. package/artifacts/build-info/fa9891803c56b8a530ff515ffc45dc03.json +0 -1
@@ -2,12 +2,23 @@ pragma solidity ^0.5.16;
2
2
 
3
3
  import "../Utils/SafeMath.sol";
4
4
 
5
+ /**
6
+ * @title Timelock
7
+ * @author Venus
8
+ * @notice The Timelock contract.
9
+ */
5
10
  contract Timelock {
6
11
  using SafeMath for uint;
7
-
12
+ /// @notice Event emitted when a new admin is accepted
8
13
  event NewAdmin(address indexed newAdmin);
14
+
15
+ /// @notice Event emitted when a new admin is proposed
9
16
  event NewPendingAdmin(address indexed newPendingAdmin);
17
+
18
+ /// @notice Event emitted when a new admin is proposed
10
19
  event NewDelay(uint indexed newDelay);
20
+
21
+ /// @notice Event emitted when a proposal transaction has been cancelled
11
22
  event CancelTransaction(
12
23
  bytes32 indexed txHash,
13
24
  address indexed target,
@@ -16,6 +27,8 @@ contract Timelock {
16
27
  bytes data,
17
28
  uint eta
18
29
  );
30
+
31
+ /// @notice Event emitted when a proposal transaction has been executed
19
32
  event ExecuteTransaction(
20
33
  bytes32 indexed txHash,
21
34
  address indexed target,
@@ -24,6 +37,8 @@ contract Timelock {
24
37
  bytes data,
25
38
  uint eta
26
39
  );
40
+
41
+ /// @notice Event emitted when a proposal transaction has been queued
27
42
  event QueueTransaction(
28
43
  bytes32 indexed txHash,
29
44
  address indexed target,
@@ -33,14 +48,25 @@ contract Timelock {
33
48
  uint eta
34
49
  );
35
50
 
51
+ /// @notice Required period to execute a proposal transaction
36
52
  uint public constant GRACE_PERIOD = 14 days;
53
+
54
+ /// @notice Minimum amount of time a proposal transaction must be queued
37
55
  uint public constant MINIMUM_DELAY = 1 hours;
56
+
57
+ /// @notice Maximum amount of time a proposal transaction must be queued
38
58
  uint public constant MAXIMUM_DELAY = 30 days;
39
59
 
60
+ /// @notice Timelock admin authorized to queue and execute transactions
40
61
  address public admin;
62
+
63
+ /// @notice Account proposed as the next admin
41
64
  address public pendingAdmin;
65
+
66
+ /// @notice Period for a proposal transaction to be queued
42
67
  uint public delay;
43
68
 
69
+ /// @notice Mapping of queued transactions
44
70
  mapping(bytes32 => bool) public queuedTransactions;
45
71
 
46
72
  constructor(address admin_, uint delay_) public {
@@ -53,6 +79,10 @@ contract Timelock {
53
79
 
54
80
  function() external payable {}
55
81
 
82
+ /**
83
+ * @notice Setter for the transaction queue delay
84
+ * @param delay_ The new delay period for the transaction queue
85
+ */
56
86
  function setDelay(uint delay_) public {
57
87
  require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
58
88
  require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay.");
@@ -62,6 +92,9 @@ contract Timelock {
62
92
  emit NewDelay(delay);
63
93
  }
64
94
 
95
+ /**
96
+ * @notice Method for accepting a proposed admin
97
+ */
65
98
  function acceptAdmin() public {
66
99
  require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
67
100
  admin = msg.sender;
@@ -70,6 +103,10 @@ contract Timelock {
70
103
  emit NewAdmin(admin);
71
104
  }
72
105
 
106
+ /**
107
+ * @notice Method to propose a new admin authorized to call timelock functions. This should be the Governor Contract
108
+ * @param pendingAdmin_ Address of the proposed admin
109
+ */
73
110
  function setPendingAdmin(address pendingAdmin_) public {
74
111
  require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
75
112
  pendingAdmin = pendingAdmin_;
@@ -77,6 +114,15 @@ contract Timelock {
77
114
  emit NewPendingAdmin(pendingAdmin);
78
115
  }
79
116
 
117
+ /**
118
+ * @notice Called for each action when queuing a proposal
119
+ * @param target Address of the contract with the method to be called
120
+ * @param value Native token amount sent with the transaction
121
+ * @param signature Ssignature of the function to be called
122
+ * @param data Arguments to be passed to the function when called
123
+ * @param eta Timestamp after which the transaction can be executed
124
+ * @return Hash of the queued transaction
125
+ */
80
126
  function queueTransaction(
81
127
  address target,
82
128
  uint value,
@@ -97,6 +143,14 @@ contract Timelock {
97
143
  return txHash;
98
144
  }
99
145
 
146
+ /**
147
+ * @notice Called to cancel a queued transaction
148
+ * @param target Address of the contract with the method to be called
149
+ * @param value Native token amount sent with the transaction
150
+ * @param signature Ssignature of the function to be called
151
+ * @param data Arguments to be passed to the function when called
152
+ * @param eta Timestamp after which the transaction can be executed
153
+ */
100
154
  function cancelTransaction(
101
155
  address target,
102
156
  uint value,
@@ -112,6 +166,14 @@ contract Timelock {
112
166
  emit CancelTransaction(txHash, target, value, signature, data, eta);
113
167
  }
114
168
 
169
+ /**
170
+ * @notice Called to execute a queued transaction
171
+ * @param target Address of the contract with the method to be called
172
+ * @param value Native token amount sent with the transaction
173
+ * @param signature Ssignature of the function to be called
174
+ * @param data Arguments to be passed to the function when called
175
+ * @param eta Timestamp after which the transaction can be executed
176
+ */
115
177
  function executeTransaction(
116
178
  address target,
117
179
  uint value,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@venusprotocol/governance-contracts",
3
3
  "description": "",
4
- "version": "1.0.1-dev.1",
4
+ "version": "1.0.1-dev.3",
5
5
  "author": "",
6
6
  "files": [
7
7
  "artifacts",