@venusprotocol/governance-contracts 1.0.1-dev.1 → 1.0.1-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 (105) hide show
  1. package/contracts/Governance/AccessControlManager.sol +44 -5
  2. package/contracts/Governance/AccessControlledV5.sol +4 -5
  3. package/contracts/Governance/AccessControlledV8.sol +4 -6
  4. package/contracts/Governance/GovernorBravoDelegate.sol +67 -0
  5. package/contracts/Governance/GovernorBravoDelegator.sol +5 -0
  6. package/contracts/Governance/GovernorBravoInterfaces.sol +23 -2
  7. package/contracts/Governance/IAccessControlManagerV5.sol +5 -0
  8. package/contracts/Governance/IAccessControlManagerV8.sol +5 -0
  9. package/contracts/Governance/Timelock.sol +5 -0
  10. package/package.json +1 -1
  11. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +0 -4
  12. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +0 -215
  13. package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +0 -4
  14. package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +0 -183
  15. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +0 -4
  16. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +0 -10
  17. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +0 -4
  18. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +0 -10
  19. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +0 -4
  20. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +0 -30
  21. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +0 -4
  22. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +0 -30
  23. package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +0 -4
  24. package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +0 -10
  25. package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.dbg.json +0 -4
  26. package/artifacts/@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol/Ownable2StepUpgradeable.json +0 -115
  27. package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +0 -4
  28. package/artifacts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +0 -76
  29. package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +0 -4
  30. package/artifacts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +0 -24
  31. package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +0 -4
  32. package/artifacts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +0 -10
  33. package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +0 -4
  34. package/artifacts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +0 -24
  35. package/artifacts/@venusprotocol/venus-protocol/contracts/Governance/XVS.sol/Owned.dbg.json +0 -4
  36. package/artifacts/@venusprotocol/venus-protocol/contracts/Governance/XVS.sol/Owned.json +0 -66
  37. package/artifacts/@venusprotocol/venus-protocol/contracts/Governance/XVS.sol/Tokenlock.dbg.json +0 -4
  38. package/artifacts/@venusprotocol/venus-protocol/contracts/Governance/XVS.sol/Tokenlock.json +0 -90
  39. package/artifacts/@venusprotocol/venus-protocol/contracts/Governance/XVS.sol/XVS.dbg.json +0 -4
  40. package/artifacts/@venusprotocol/venus-protocol/contracts/Governance/XVS.sol/XVS.json +0 -618
  41. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/Address.sol/Address.dbg.json +0 -4
  42. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/Address.sol/Address.json +0 -10
  43. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/ECDSA.sol/ECDSA.dbg.json +0 -4
  44. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/ECDSA.sol/ECDSA.json +0 -10
  45. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/IBEP20.sol/IBEP20.dbg.json +0 -4
  46. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/IBEP20.sol/IBEP20.json +0 -206
  47. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/SafeBEP20.sol/SafeBEP20.dbg.json +0 -4
  48. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/SafeBEP20.sol/SafeBEP20.json +0 -10
  49. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/SafeMath.sol/SafeMath.dbg.json +0 -4
  50. package/artifacts/@venusprotocol/venus-protocol/contracts/Utils/SafeMath.sol/SafeMath.json +0 -10
  51. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSStore.sol/XVSStore.dbg.json +0 -4
  52. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSStore.sol/XVSStore.json +0 -244
  53. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVault.sol/IXVSStore.dbg.json +0 -4
  54. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVault.sol/IXVSStore.json +0 -56
  55. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVault.sol/XVSVault.dbg.json +0 -4
  56. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVault.sol/XVSVault.json +0 -1211
  57. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultErrorReporter.sol/XVSVaultErrorReporter.dbg.json +0 -4
  58. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultErrorReporter.sol/XVSVaultErrorReporter.json +0 -36
  59. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultProxy.sol/XVSVaultProxy.dbg.json +0 -4
  60. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultProxy.sol/XVSVaultProxy.json +0 -255
  61. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol/XVSVaultAdminStorage.dbg.json +0 -4
  62. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol/XVSVaultAdminStorage.json +0 -71
  63. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol/XVSVaultStorage.dbg.json +0 -4
  64. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol/XVSVaultStorage.json +0 -313
  65. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol/XVSVaultStorageV1.dbg.json +0 -4
  66. package/artifacts/@venusprotocol/venus-protocol/contracts/XVSVault/XVSVaultStorage.sol/XVSVaultStorageV1.json +0 -240
  67. package/artifacts/build-info/0ed8a45a04a58741f8391cb7a77f7ff9.json +0 -1
  68. package/artifacts/build-info/1659b7cff20ee8b7949bfbefa681db8b.json +0 -1
  69. package/artifacts/build-info/21eeeec59918770851ef762f6f414247.json +0 -1
  70. package/artifacts/build-info/60a7730a05f99cbf38891be24e3a5c77.json +0 -1
  71. package/artifacts/build-info/fa9891803c56b8a530ff515ffc45dc03.json +0 -1
  72. package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.dbg.json +0 -4
  73. package/artifacts/contracts/Governance/AccessControlManager.sol/AccessControlManager.json +0 -369
  74. package/artifacts/contracts/Governance/AccessControlledV5.sol/AccessControlledV5.dbg.json +0 -4
  75. package/artifacts/contracts/Governance/AccessControlledV5.sol/AccessControlledV5.json +0 -45
  76. package/artifacts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.dbg.json +0 -4
  77. package/artifacts/contracts/Governance/AccessControlledV8.sol/AccessControlledV8.json +0 -181
  78. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.dbg.json +0 -4
  79. package/artifacts/contracts/Governance/GovernorBravoDelegate.sol/GovernorBravoDelegate.json +0 -1173
  80. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.dbg.json +0 -4
  81. package/artifacts/contracts/Governance/GovernorBravoDelegator.sol/GovernorBravoDelegator.json +0 -424
  82. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorAlphaInterface.dbg.json +0 -4
  83. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorAlphaInterface.json +0 -26
  84. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.dbg.json +0 -4
  85. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV1.json +0 -283
  86. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.dbg.json +0 -4
  87. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegateStorageV2.json +0 -335
  88. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.dbg.json +0 -4
  89. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoDelegatorStorage.json +0 -56
  90. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.dbg.json +0 -4
  91. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/GovernorBravoEvents.json +0 -312
  92. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/TimelockInterface.dbg.json +0 -4
  93. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/TimelockInterface.json +0 -188
  94. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/XvsVaultInterface.dbg.json +0 -4
  95. package/artifacts/contracts/Governance/GovernorBravoInterfaces.sol/XvsVaultInterface.json +0 -37
  96. package/artifacts/contracts/Governance/IAccessControlManagerV5.sol/IAccessControlManagerV5.dbg.json +0 -4
  97. package/artifacts/contracts/Governance/IAccessControlManagerV5.sol/IAccessControlManagerV5.json +0 -300
  98. package/artifacts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.dbg.json +0 -4
  99. package/artifacts/contracts/Governance/IAccessControlManagerV8.sol/IAccessControlManagerV8.json +0 -282
  100. package/artifacts/contracts/Governance/Timelock.sol/Timelock.dbg.json +0 -4
  101. package/artifacts/contracts/Governance/Timelock.sol/Timelock.json +0 -468
  102. package/artifacts/contracts/Utils/SafeMath.sol/SafeMath.dbg.json +0 -4
  103. package/artifacts/contracts/Utils/SafeMath.sol/SafeMath.json +0 -10
  104. package/artifacts/contracts/test/MockAccessTest.sol/MockAccessTest.dbg.json +0 -4
  105. package/artifacts/contracts/test/MockAccessTest.sol/MockAccessTest.json +0 -194
@@ -4,11 +4,50 @@ import "@openzeppelin/contracts/access/AccessControl.sol";
4
4
  import "./IAccessControlManagerV8.sol";
5
5
 
6
6
  /**
7
- * @title Venus Access Control Contract
8
- * @author venus
9
- * @dev This contract is a wrapper of OpenZeppelin AccessControl
10
- * extending it in a way to standartize access control
11
- * within Venus Smart Contract Ecosystem
7
+ * @title AccessControlManager
8
+ * @author Venus
9
+ * @dev This contract is a wrapper of OpenZeppelin AccessControl extending it in a way to standartize access control within Venus Smart Contract Ecosystem.
10
+ * @notice Access control plays a crucial role in the Venus governance model. It is used to restrict functions so that they can only be called from one
11
+ * account or list of accounts (EOA or Contract Accounts).
12
+ *
13
+ * The implementation of `AccessControlManager`(https://github.com/VenusProtocol/governance-contracts/blob/main/contracts/Governance/AccessControlManager.sol)
14
+ * inherits the [Open Zeppelin AccessControl](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol)
15
+ * contract as a base for role management logic. There are two role types: admin and granular permissions.
16
+ *
17
+ * ## Granular Roles
18
+ *
19
+ * Granular roles are built by hashing the contract address and its function signature. For example, given contract `Foo` with function `Foo.bar()` which
20
+ * is guarded by ACM, calling `giveRolePermission` for account B do the following:
21
+ *
22
+ * 1. Compute `keccak256(contractFooAddress,functionSignatureBar)`
23
+ * 1. Add the computed role to the roles of account B
24
+ * 1. Account B now can call `ContractFoo.bar()`
25
+ *
26
+ * ## Admin Roles
27
+ *
28
+ * Admin roles allow for an address to call a function signature on any contract guarded by the `AccessControlManager`. This is particularly useful for
29
+ * contracts created by factories.
30
+ *
31
+ * For Admin roles a null address is hashed in place of the contract address (`keccak256(0x0000000000000000000000000000000000000000,functionSignatureBar)`.
32
+ *
33
+ * In the previous example, giving account B the admin role, account B will have permissions to call the `bar()` function on any contract that is guarded by
34
+ * ACM, not only contract A.
35
+ *
36
+ * ## Protocol Integration
37
+ *
38
+ * All restricted functions in Venus Protocol use a hook to ACM in order to check if the caller has the right permission to call the guarded function.
39
+ * `AccessControlledV5` and `AccessControlledV8` abstract contract makes this integration easier. They call ACM's external method
40
+ * `isAllowedToCall(address caller, string functionSig)`. Here is an example of how `setCollateralFactor` function in `Comptroller` is integrated with ACM:
41
+
42
+ ```
43
+ contract Comptroller is [...] AccessControlledV8 {
44
+ [...]
45
+ function setCollateralFactor(VToken vToken, uint256 newCollateralFactorMantissa, uint256 newLiquidationThresholdMantissa) external {
46
+ _checkAccessAllowed("setCollateralFactor(address,uint256,uint256)");
47
+ [...]
48
+ }
49
+ }
50
+ ```
12
51
  */
13
52
  contract AccessControlManager is AccessControl, IAccessControlManagerV8 {
14
53
  /// @notice Emitted when an account is given a permission to a certain contract function
@@ -4,12 +4,11 @@ pragma solidity 0.5.16;
4
4
  import "./IAccessControlManagerV5.sol";
5
5
 
6
6
  /**
7
- * @title Venus Access Control Contract.
8
- * @dev This contract is helper between access control manager and actual contract
9
- * This contract further inherited by other contract to integrate access controlled mechanism
10
- * It provides initialise methods and verifying access methods
7
+ * @title AccessControlledV5
8
+ * @author Venus
9
+ * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.5.16)
10
+ * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.
11
11
  */
12
-
13
12
  contract AccessControlledV5 {
14
13
  /// @notice Access control manager contract
15
14
  IAccessControlManagerV5 private _accessControlManager;
@@ -7,13 +7,11 @@ import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
7
7
  import "./IAccessControlManagerV8.sol";
8
8
 
9
9
  /**
10
- * @title Venus Access Control Contract.
11
- * @dev The AccessControlledV8 contract is a wrapper around the OpenZeppelin AccessControl contract
12
- * It provides a standardized way to control access to methods within the Venus Smart Contract Ecosystem.
13
- * The contract allows the owner to set an AccessControlManager contract address.
14
- * It can restrict method calls based on the sender's role and the method's signature.
10
+ * @title AccessControlledV8
11
+ * @author Venus
12
+ * @notice This contract is helper between access control manager and actual contract. This contract further inherited by other contract (using solidity 0.8.13)
13
+ * to integrate access controlled mechanism. It provides initialise methods and verifying access methods.
15
14
  */
16
-
17
15
  abstract contract AccessControlledV8 is Initializable, Ownable2StepUpgradeable {
18
16
  /// @notice Access control manager contract
19
17
  IAccessControlManagerV8 private _accessControlManager;
@@ -3,6 +3,73 @@ pragma experimental ABIEncoderV2;
3
3
 
4
4
  import "./GovernorBravoInterfaces.sol";
5
5
 
6
+ /**
7
+ * @title GovernorBravoDelegate
8
+ * @notice Venus Governance latest on chain governance includes several new features including variable proposal routes and fine grained pause control.
9
+ * Variable routes for proposals allows for governance paramaters such as voting threshold and timelocks to be customized based on the risk level and
10
+ * impact of the proposal. Added granularity to the pause control mechanism allows governance to pause individual actions on specific markets,
11
+ * which reduces impact on the protocol as a whole. This is particularly useful when applied to isolated pools.
12
+ *
13
+ * The goal of **Governance** is to increase governance efficiency, while mitigating and eliminating malicious or erroneous proposals.
14
+ *
15
+ * ## Details
16
+ *
17
+ * Governance has **3 main contracts**: **GovernanceBravoDelegate, XVSVault, XVS** token.
18
+ *
19
+ * - XVS token is the protocol token used for protocol users to cast their vote on submitted proposals.
20
+ * - XVSVault is the main staking contract for XVS. Users first stake their XVS in the vault and receive voting power proportional to their staked
21
+ * tokens that they can use to vote on proposals. Users also can choose to delegate their voting power to other users.
22
+ *
23
+ * # Governor Bravo
24
+ *
25
+ * `GovernanceBravoDelegate` is main Venus Governance contract. Users interact with it to:
26
+ * - Submit new proposal
27
+ * - Vote on a proposal
28
+ * - Cancel a proposal
29
+ * - Queue a proposal for execution with a timelock executor contract.
30
+ * `GovernanceBravoDelegate` uses the XVSVault to get restrict certain actions based on a user's voting power. The governance rules it inforces are:
31
+ * - A user's voting power must be greater than the `proposalThreshold` to submit a proposal
32
+ * - If a user's voting power drops below certain amount, anyone can cancel the the proposal. The governance guardian and proposal creator can also
33
+ * cancel a proposal at anytime before it is queued for execution.
34
+ *
35
+ * ## Venus Improvement Proposal
36
+ *
37
+ * Venus Governance allows for Venus Improvement Proposals (VIPs) to be categorized based on their impact and risk levels. This allows for optimizing proposals
38
+ * execution to allow for things such as expediting interest rate changes and quickly updating risk parameters, while moving slower on other types of proposals
39
+ * that can prevent a larger risk to the protocol and are not urgent. There are three different types of VIPs with different proposal paramters:
40
+ *
41
+ * - `NORMAL`
42
+ * - `FASTTRACK`
43
+ * - `CRITICAL`
44
+ *
45
+ * When initializing the `GovernorBravo` contract, the parameters for the three routes are set. The parameters are:
46
+ *
47
+ * - `votingDelay`: The delay in blocks between submitting a proposal and when voting begins
48
+ * - `votingPeriod`: The number of blocks where voting will be open
49
+ * - `proposalThreshold`: The number of votes required in order submit a proposal
50
+ *
51
+ * There is also a separate timelock executor contract for each route, which is used to dispatch the VIP for execution, giving even more control over the
52
+ * flow of each type of VIP.
53
+ *
54
+ * ## Voting
55
+ *
56
+ * After a VIP is proposed, voting is opened after the `votingDelay` has passed. For example, if `votingDelay = 0`, then voting will begin in the next block
57
+ * after the proposal has been submitted. After the delay, the proposal state is `ACTIVE` and users can cast their vote `for`, `against`, or `abstain`,
58
+ * weighted by their total voting power (tokens + delegated voting power). Abstaining from a voting allows for a vote to be cast and optionally include a
59
+ * comment, without the incrementing for or against vote count. The total voting power for the user is obtained by calling XVSVault's `getPriorVotes`.
60
+ *
61
+ * `GovernorBravoDelegate` also accepts [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signatures for voting on proposals via the external function
62
+ * `castVoteBySig`.
63
+ *
64
+ * ## Delegating
65
+ *
66
+ * A users voting power includes the amount of staked XVS the have staked as well as the votes delegate to them. Delegating is the process of a user loaning
67
+ * their voting power to another, so that the latter has the combined voting power of both users. This is an important feature because it allows for a user
68
+ * to let another user who they trust propose or vote in their place.
69
+ *
70
+ * The delegation of votes happens through the `XVSVault` contract by calling the `delegate` or `delegateBySig` functions. These same functions can revert
71
+ * vote delegation by calling the same function with a value of `0`.
72
+ */
6
73
  contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoEvents {
7
74
  /// @notice The name of this contract
8
75
  string public constant name = "Venus Governor Bravo";
@@ -3,6 +3,11 @@ pragma experimental ABIEncoderV2;
3
3
 
4
4
  import "./GovernorBravoInterfaces.sol";
5
5
 
6
+ /**
7
+ * @title GovernorBravoDelegator
8
+ * @author Venus
9
+ * @notice The `GovernorBravoDelegator` contract.
10
+ */
6
11
  contract GovernorBravoDelegator is GovernorBravoDelegatorStorage, GovernorBravoEvents {
7
12
  constructor(
8
13
  address timelock_,
@@ -1,6 +1,11 @@
1
1
  pragma solidity ^0.5.16;
2
2
  pragma experimental ABIEncoderV2;
3
3
 
4
+ /**
5
+ * @title GovernorBravoEvents
6
+ * @author Venus
7
+ * @notice Set of events emitted by the GovernorBravo contracts.
8
+ */
4
9
  contract GovernorBravoEvents {
5
10
  /// @notice An event emitted when a new proposal is created
6
11
  event ProposalCreated(
@@ -58,6 +63,11 @@ contract GovernorBravoEvents {
58
63
  event ProposalMaxOperationsUpdated(uint oldMaxOperations, uint newMaxOperations);
59
64
  }
60
65
 
66
+ /**
67
+ * @title GovernorBravoDelegatorStorage
68
+ * @author Venus
69
+ * @notice Storage layout of the `GovernorBravoDelegator` contract
70
+ */
61
71
  contract GovernorBravoDelegatorStorage {
62
72
  /// @notice Administrator for this contract
63
73
  address public admin;
@@ -70,8 +80,8 @@ contract GovernorBravoDelegatorStorage {
70
80
  }
71
81
 
72
82
  /**
73
- * @title Storage for Governor Bravo Delegate
74
- * @notice For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new
83
+ * @title GovernorBravoDelegateStorageV1
84
+ * @dev For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new
75
85
  * contract which implements GovernorBravoDelegateStorageV1 and following the naming convention
76
86
  * GovernorBravoDelegateStorageVX.
77
87
  */
@@ -167,6 +177,12 @@ contract GovernorBravoDelegateStorageV1 is GovernorBravoDelegatorStorage {
167
177
  address public guardian;
168
178
  }
169
179
 
180
+ /**
181
+ * @title GovernorBravoDelegateStorageV2
182
+ * @dev For future upgrades, do not change GovernorBravoDelegateStorageV1. Create a new
183
+ * contract which implements GovernorBravoDelegateStorageV2 and following the naming convention
184
+ * GovernorBravoDelegateStorageVX.
185
+ */
170
186
  contract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {
171
187
  enum ProposalType {
172
188
  NORMAL,
@@ -190,6 +206,11 @@ contract GovernorBravoDelegateStorageV2 is GovernorBravoDelegateStorageV1 {
190
206
  mapping(uint => TimelockInterface) public proposalTimelocks;
191
207
  }
192
208
 
209
+ /**
210
+ * @title TimelockInterface
211
+ * @author Venus
212
+ * @notice Interface implemented by the Timelock contract.
213
+ */
193
214
  interface TimelockInterface {
194
215
  function delay() external view returns (uint);
195
216
 
@@ -1,6 +1,11 @@
1
1
  // SPDX-License-Identifier: BSD-3-Clause
2
2
  pragma solidity 0.5.16;
3
3
 
4
+ /**
5
+ * @title IAccessControlManagerV5
6
+ * @author Venus
7
+ * @notice Interface implemented by the `AccessControlManagerV5` contract.
8
+ */
4
9
  interface IAccessControlManagerV5 {
5
10
  /**
6
11
  * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
@@ -3,6 +3,11 @@ pragma solidity 0.8.13;
3
3
 
4
4
  import "@openzeppelin/contracts/access/IAccessControl.sol";
5
5
 
6
+ /**
7
+ * @title IAccessControlManagerV8
8
+ * @author Venus
9
+ * @notice Interface implemented by the `AccessControlManagerV8` contract.
10
+ */
6
11
  interface IAccessControlManagerV8 is IAccessControl {
7
12
  function giveCallPermission(address contractAddress, string calldata functionSig, address accountToPermit) external;
8
13
 
@@ -2,6 +2,11 @@ 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
 
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.2",
5
5
  "author": "",
6
6
  "files": [
7
7
  "artifacts",
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/0ed8a45a04a58741f8391cb7a77f7ff9.json"
4
- }
@@ -1,215 +0,0 @@
1
- {
2
- "_format": "hh-sol-artifact-1",
3
- "contractName": "AccessControl",
4
- "sourceName": "@openzeppelin/contracts/access/AccessControl.sol",
5
- "abi": [
6
- {
7
- "anonymous": false,
8
- "inputs": [
9
- {
10
- "indexed": true,
11
- "internalType": "bytes32",
12
- "name": "role",
13
- "type": "bytes32"
14
- },
15
- {
16
- "indexed": true,
17
- "internalType": "bytes32",
18
- "name": "previousAdminRole",
19
- "type": "bytes32"
20
- },
21
- {
22
- "indexed": true,
23
- "internalType": "bytes32",
24
- "name": "newAdminRole",
25
- "type": "bytes32"
26
- }
27
- ],
28
- "name": "RoleAdminChanged",
29
- "type": "event"
30
- },
31
- {
32
- "anonymous": false,
33
- "inputs": [
34
- {
35
- "indexed": true,
36
- "internalType": "bytes32",
37
- "name": "role",
38
- "type": "bytes32"
39
- },
40
- {
41
- "indexed": true,
42
- "internalType": "address",
43
- "name": "account",
44
- "type": "address"
45
- },
46
- {
47
- "indexed": true,
48
- "internalType": "address",
49
- "name": "sender",
50
- "type": "address"
51
- }
52
- ],
53
- "name": "RoleGranted",
54
- "type": "event"
55
- },
56
- {
57
- "anonymous": false,
58
- "inputs": [
59
- {
60
- "indexed": true,
61
- "internalType": "bytes32",
62
- "name": "role",
63
- "type": "bytes32"
64
- },
65
- {
66
- "indexed": true,
67
- "internalType": "address",
68
- "name": "account",
69
- "type": "address"
70
- },
71
- {
72
- "indexed": true,
73
- "internalType": "address",
74
- "name": "sender",
75
- "type": "address"
76
- }
77
- ],
78
- "name": "RoleRevoked",
79
- "type": "event"
80
- },
81
- {
82
- "inputs": [],
83
- "name": "DEFAULT_ADMIN_ROLE",
84
- "outputs": [
85
- {
86
- "internalType": "bytes32",
87
- "name": "",
88
- "type": "bytes32"
89
- }
90
- ],
91
- "stateMutability": "view",
92
- "type": "function"
93
- },
94
- {
95
- "inputs": [
96
- {
97
- "internalType": "bytes32",
98
- "name": "role",
99
- "type": "bytes32"
100
- }
101
- ],
102
- "name": "getRoleAdmin",
103
- "outputs": [
104
- {
105
- "internalType": "bytes32",
106
- "name": "",
107
- "type": "bytes32"
108
- }
109
- ],
110
- "stateMutability": "view",
111
- "type": "function"
112
- },
113
- {
114
- "inputs": [
115
- {
116
- "internalType": "bytes32",
117
- "name": "role",
118
- "type": "bytes32"
119
- },
120
- {
121
- "internalType": "address",
122
- "name": "account",
123
- "type": "address"
124
- }
125
- ],
126
- "name": "grantRole",
127
- "outputs": [],
128
- "stateMutability": "nonpayable",
129
- "type": "function"
130
- },
131
- {
132
- "inputs": [
133
- {
134
- "internalType": "bytes32",
135
- "name": "role",
136
- "type": "bytes32"
137
- },
138
- {
139
- "internalType": "address",
140
- "name": "account",
141
- "type": "address"
142
- }
143
- ],
144
- "name": "hasRole",
145
- "outputs": [
146
- {
147
- "internalType": "bool",
148
- "name": "",
149
- "type": "bool"
150
- }
151
- ],
152
- "stateMutability": "view",
153
- "type": "function"
154
- },
155
- {
156
- "inputs": [
157
- {
158
- "internalType": "bytes32",
159
- "name": "role",
160
- "type": "bytes32"
161
- },
162
- {
163
- "internalType": "address",
164
- "name": "account",
165
- "type": "address"
166
- }
167
- ],
168
- "name": "renounceRole",
169
- "outputs": [],
170
- "stateMutability": "nonpayable",
171
- "type": "function"
172
- },
173
- {
174
- "inputs": [
175
- {
176
- "internalType": "bytes32",
177
- "name": "role",
178
- "type": "bytes32"
179
- },
180
- {
181
- "internalType": "address",
182
- "name": "account",
183
- "type": "address"
184
- }
185
- ],
186
- "name": "revokeRole",
187
- "outputs": [],
188
- "stateMutability": "nonpayable",
189
- "type": "function"
190
- },
191
- {
192
- "inputs": [
193
- {
194
- "internalType": "bytes4",
195
- "name": "interfaceId",
196
- "type": "bytes4"
197
- }
198
- ],
199
- "name": "supportsInterface",
200
- "outputs": [
201
- {
202
- "internalType": "bool",
203
- "name": "",
204
- "type": "bool"
205
- }
206
- ],
207
- "stateMutability": "view",
208
- "type": "function"
209
- }
210
- ],
211
- "bytecode": "0x",
212
- "deployedBytecode": "0x",
213
- "linkReferences": {},
214
- "deployedLinkReferences": {}
215
- }
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/0ed8a45a04a58741f8391cb7a77f7ff9.json"
4
- }