{"id":22873956,"url":"https://github.com/angleprotocol/angle-governance","last_synced_at":"2025-05-06T19:12:06.031Z","repository":{"id":234091729,"uuid":"715230923","full_name":"AngleProtocol/angle-governance","owner":"AngleProtocol","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-22T12:39:45.000Z","size":878,"stargazers_count":10,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-22T15:01:54.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AngleProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-06T18:18:11.000Z","updated_at":"2024-07-15T22:49:31.000Z","dependencies_parsed_at":"2024-05-02T17:45:51.983Z","dependency_job_id":"1b659d12-001e-401f-bb26-ae8bd7caa512","html_url":"https://github.com/AngleProtocol/angle-governance","commit_stats":null,"previous_names":["angleprotocol/angle-governance"],"tags_count":0,"template":false,"template_full_name":"AngleProtocol/boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fangle-governance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fangle-governance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fangle-governance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AngleProtocol%2Fangle-governance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AngleProtocol","download_url":"https://codeload.github.com/AngleProtocol/angle-governance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229556360,"owners_count":18091747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T14:32:02.827Z","updated_at":"2024-12-13T14:32:03.456Z","avatar_url":"https://github.com/AngleProtocol.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\".github/assets/logo.svg\" alt=\"Angle\" height=\"40px\"\u003e Angle Governance\n\n[![CI](https://github.com/AngleProtocol/angle-governance/actions/workflows/ci.yml/badge.svg)](https://github.com/AngleProtocol/angle-governance/actions)\n[![Coverage](https://codecov.io/gh/AngleProtocol/angle-governance/branch/main/graph/badge.svg)](https://codecov.io/gh/AngleProtocol/angle-governance)\n\n## About this repository 🤔\n\nAngle is a decentralized stablecoin protocol, ruled by the [veANGLE token](https://etherscan.io/address/0x0c462dbb9ec8cd1630f1728b2cfd2769d09f0dd5) and natively deployed on multiple EVM compatible chains (including Ethereum, Polygon, Optimism, Arbitrum, ...).\n\nThis repository contains the smart contracts for the cross-chain governance system for Angle Protocol relying on LayerZero message passing infrastructure.\n\nIt also comes with some utils and scripts to facilitate the creation and execution of proposals on top of the deployed system.\n\n## Create and Simulate a Proposal\n\n- Create a script in `scripts/proposals`. Take for example `scripts/proposals/SetMinDelayTimelock.s.sol` and the contract name is `SetMinDelayTimelock`\n- Create the associated test in `tests/scripts`. If the script contract name is `XXX` the test contract should be named `XXXTest`.\n- You can create, simulate and potentially send (you will be asked if you want) the proposals by running `yarn create:proposal`. You will be prompted to specify the script you want to run, you should enter `XXX`. Then asks on which chains you want to run the script, and finally after tests are passing you are asked if you want to send the proposal to the on chain governance.\n\n## System Architecture 🏘️\n\nAngle onchain governance works as follows:\n\n- 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.\n- 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.\n- 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.\n- 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.\n\n![Angle Governance Architecture Summary](./DAO.png)\n\nPrecisely speaking, once a vote succeeds (majority of positive votes + quorum), the flow is the following:\n\n- If the vote concerns an Ethereum action:\n  - The payload to execute is sent to the Ethereum `Timelock` contract. The Ethereum Timelock contract only accepts payload from the `AngleGovernor` contract\n  - After the timelock period ends, if the payload is not veto-ed by [Angle Governance multisig](https://etherscan.io/address/0xdC4e6DFe07EFCa50a197DF15D9200883eF4Eb1c8) on Ethereum, it can be executed on Ethereum.\n- If the vote concerns an action on another chain:\n  - The payload to execute is sent to a [`ProposalSender`](contracts/ProposalSender.sol) contract on Ethereum which is a simple LayerZero message passing contract owned by the `AngleGovernor` contract.\n  - This payload is to be received on the destination chain by a [`ProposalReceiver`](contracts/ProposalReceiver.sol) contract which role is to then send the payload to the Timelock contract of this chain. `Timelock` contracts of non-Ethereum chains only accept payloads from their respective `ProposalReceiver` contract.\n\nIt's worth noting that, setup like this, the Angle Governance system can be abstracted among a decision module (`AngleGovernor` contract) and an execution module. Both are modular, and so any could be changed at any time in the future.\n\n---\n\n## Documentation 📚\n\n- [Angle Governance Documentation](https://docs.angle.money/protocol-governance/angle-dao)\n- [Angle Documentation](https://docs.angle.money)\n- [Angle Developers Documentation](https://developers.angle.money)\n\n---\n\n## Security ⛑️\n\n## Audits\n\n- 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).\n- 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).\n\n### Bug Bounty\n\nFor contracts deployed for the Angle Protocol, a bug bounty is open on [Immunefi](https://immunefi.com) and [Hats Finance](https://hats.finance). The rewards and scope of the Angle Immunefi are defined [here](https://immunefi.com/bounty/angleprotocol/).\n\n---\n\n## Deployment Addresses 🚦\n\nAll Angle governance deployment addresses can be found in the developers documentation [here](https://developers.angle.money/overview/smart-contracts).\n\n---\n\n## Starting\n\n### Install packages\n\nYou can install all dependencies by running\n\n```bash\nyarn\nforge i\n```\n\n### Create `.env` file\n\nIn order to interact with non local networks, you must create an `.env` that has:\n\n- `PRIVATE_KEY`\n- `MNEMONIC`\n- network key (eg. `ALCHEMY_NETWORK_KEY`)\n- `ETHERSCAN_API_KEY`\n\nFor additional keys, you can check the `.env.example` file.\n\nWarning: always keep your confidential information safe.\n\n### Foundry Installation\n\n```bash\ncurl -L https://foundry.paradigm.xyz | bash\n\nsource /root/.zshrc\n# or, if you're under bash: source /root/.bashrc\n\nfoundryup\n```\n\nTo install the standard library:\n\n```bash\nforge install foundry-rs/forge-std\n```\n\nTo update libraries:\n\n```bash\nforge update\n```\n\n### Foundry on Docker 🐳\n\n**If you don’t want to install Rust and Foundry on your computer, you can use Docker**\nImage is available here [ghcr.io/foundry-rs/foundry](http://ghcr.io/foundry-rs/foundry).\n\n```bash\ndocker pull ghcr.io/foundry-rs/foundry\ndocker tag ghcr.io/foundry-rs/foundry:latest foundry:latest\n```\n\nTo run the container:\n\n```bash\ndocker run -it --rm -v $(pwd):/app -w /app foundry sh\n```\n\nThen you are inside the container and can run Foundry’s commands.\n\n### Warnings\n\n- Always keep your confidential information safe\n- This repository uses [`ffi`](https://book.getfoundry.sh/cheatcodes/ffi) in its test suite. Beware as a malicious actor forking this repo may execute malicious commands on your machine\n\n### Tests\n\nYou can run tests as follows:\n\n```bash\nforge test -vvvv --watch\nforge test -vvvv --match-path test/unit/Constants.t.sol\nforge test -vvvv --match-test \"testAbc*\"\nforge test -vvvv --fork-url https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf\n```\n\nYou can also list tests:\n\n```bash\nforge test --list\nforge test --list --json --match-test \"testXXX*\"\n```\n\n### Deploying\n\nThere is an example script in the `scripts/foundry` folder. Then you can run:\n\n```bash\nyarn foundry:deploy \u003cFILE_NAME\u003e --rpc-url \u003cNETWORK_NAME\u003e\n```\n\nExample:\n\n```bash\nyarn foundry:deploy scripts/foundry/DeployMockAgEUR.s.sol --rpc-url goerli\n```\n\n### Coverage\n\nWe recommend the use of this [vscode extension](ryanluker.vscode-coverage-gutters).\n\n```bash\nyarn coverage\n```\n\nYou'll need to install lcov `brew install lcov` to visualize the coverage report.\n\n---\n\n### Gas report ⛽️\n\n```bash\nyarn gas\n```\n\n---\n\n## Contributing\n\nIf you're interested in contributing, please see our [contributions guidelines](./CONTRIBUTING.md).\n\n---\n\n## Questions \u0026 Feedback\n\nFor any question or feedback you can send an email to [contact@angle.money](mailto:contact@angle.money). Don't hesitate to reach out on [Twitter](https://twitter.com/AngleProtocol)🐦 as well.\n\n---\n\n## License\n\nThis repository is released under the [MIT License](LICENSE).\n\n## Media\n\nDon't hesitate to reach out on [Twitter](https://twitter.com/AngleProtocol) 🐦\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangleprotocol%2Fangle-governance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangleprotocol%2Fangle-governance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangleprotocol%2Fangle-governance/lists"}