generated from AngleProtocol/boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: comments in the angle-governance system (#2)
- Loading branch information
Showing
8 changed files
with
50 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,9 @@ It also comes with some utils and scripts to facilitate the creation and executi | |
|
||
## System Architecture 🏘️ | ||
|
||
Angle onchain governance works a![Alt text](../angle-governance-old/logo.svg) ../angle-governance-old/README.md ![Alt text](../angle-governance-old/DAO.png)s follows: | ||
Angle onchain governance works as follows: | ||
|
||
- veANGLE holders vote on Ethereum on an OpenZeppelin [`Governor`](contracts/AngleGovernor.sol) implementation called `AngleGovernor` with a predetermined quorum, voting delay and proposal threshold. | ||
- veANGLE holders vote on Ethereum on an OpenZeppelin [`Governor`](contracts/AngleGovernor.sol) implementation called `AngleGovernor` with a predetermined quorum, voting delay, proposal and shortcircuit thresholds. | ||
- On every chain where the protocol is deployed, there is a `Timelock` contract which is admin of all the protocol contracts (Borrowing module, Transmuter, direct deposit modules, ...) of its chain. | ||
- While only onchain votes can lead to payloads being included in the `Timelock` contract of a chain before execution, [Angle 4/6 Governance multisig](https://docs.angle.money/protocol-governance/angle-dao) (deployed on all chains as well) has a veto power on the payloads in Timelock contracts, and can cancel rogue governance votes. | ||
- For successful votes on non-Ethereum proposals, payloads to execute are bridged to the chain of interest using LayerZero message passing technology before being sent to the `Timelock` contract of their chain. | ||
|
@@ -53,7 +53,7 @@ It's worth noting that, setup like this, the Angle Governance system can be abst | |
|
||
## Audits | ||
|
||
- The `AngleGovernor` implementation relies on several OpenZeppelin extensions as well as on the [audited](http://blog.openzeppelin.com/scopelift-flexible-voting-audit) [`GovernorCountingFractional` extension](https://github.com/ScopeLift/flexible-voting/blob/4399694c1a70d9e236c4c072802bfbe8e4951bf0/src/GovernorCountingFractional.sol) by ScopeLift. | ||
- The `AngleGovernor` implementation relies on several OpenZeppelin extensions, on the [audited](http://blog.openzeppelin.com/scopelift-flexible-voting-audit) [`GovernorCountingFractional` extension](https://github.com/ScopeLift/flexible-voting/blob/4399694c1a70d9e236c4c072802bfbe8e4951bf0/src/GovernorCountingFractional.sol) by ScopeLift. It is a fork of the [audited](https://github.com/trailofbits/publications/blob/master/reviews/2023-05-fraxgov-securityreview.pdf) [governance system by FRAX](https://github.com/FraxFinance/frax-governance). | ||
- The [`ProposalReceiver`](contracts/ProposalReceiver.sol) and [`ProposalSender`](contracts/ProposalSender.sol) contracts are forks from LayerZero Labs implementation. Find their audits [here](https://github.com/LayerZero-Labs/omnichain-governance-executor/tree/main/audits). | ||
|
||
### Bug Bounty | ||
|
@@ -144,7 +144,7 @@ You can run tests as follows: | |
|
||
```bash | ||
forge test -vvvv --watch | ||
forge test -vvvv --match-path contracts/forge-tests/KeeperMulticall.t.sol | ||
forge test -vvvv --match-path test/unit/Constants.t.sol | ||
forge test -vvvv --match-test "testAbc*" | ||
forge test -vvvv --fork-url https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf | ||
``` | ||
|
@@ -206,7 +206,6 @@ For any question or feedback you can send an email to [[email protected]](mail | |
|
||
This repository is released under the [MIT License](LICENSE). | ||
|
||
|
||
## Media | ||
|
||
Don't hesitate to reach out on [Twitter](https://twitter.com/AngleProtocol) 🐦 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,8 +23,9 @@ import "./utils/Errors.sol"; | |
/// @dev Core of Angle governance system, extending various OpenZeppelin modules | ||
/// @dev This contract overrides some OpenZeppelin function, like those in `GovernorSettings` to introduce | ||
/// the `onlyExecutor` modifier which ensures that only the Timelock contract can update the system's parameters | ||
/// @dev The time parameters (`votingDelay`, `votingPeriod`, ...) are expressed here in block number units which | ||
/// means that this implementation is only suited for an Ethereum deployment | ||
/// @dev The time parameters (`votingDelay`, `votingPeriod`, ...) are expressed here in timestamp units, but the | ||
/// also has a `votingDelayBlocks` parameters which must be set in accordance to the `votingDelay` | ||
/// @dev The `state` and `propose` functions here were forked from FRAX governance implementation | ||
/// @custom:security-contact [email protected] | ||
contract AngleGovernor is | ||
GovernorSettings, | ||
|
@@ -123,7 +124,7 @@ contract AngleGovernor is | |
|
||
/// @inheritdoc Governor | ||
// solhint-disable-next-line | ||
/// @notice Fork from Frax Finance: https://github.com/FraxFinance/frax-governance/blob/e465513ac282aa7bfd6744b3136354fae51fed3c/ | ||
/// @notice Fork from Frax Finance: https://github.com/FraxFinance/frax-governance/blob/e465513ac282aa7bfd6744b3136354fae51fed3c/src/FraxGovernorAlpha.sol | ||
function state(uint256 proposalId) public view override returns (ProposalState) { | ||
// We read the struct fields into the stack at once so Solidity emits a single SLOAD | ||
ProposalCore storage proposal = _proposals[proposalId]; | ||
|
@@ -172,7 +173,7 @@ contract AngleGovernor is | |
|
||
/// @inheritdoc Governor | ||
// solhint-disable-next-line | ||
/// @notice Fork from Frax Finance: https://github.com/FraxFinance/frax-governance/blob/e465513ac282aa7bfd6744b3136354fae51fed3c/ | ||
/// @notice Fork from Frax Finance: https://github.com/FraxFinance/frax-governance/blob/e465513ac282aa7bfd6744b3136354fae51fed3c/src/FraxGovernorAlpha.sol | ||
function _propose( | ||
address[] memory targets, | ||
uint256[] memory values, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.