Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ernestognw/compound-proposal-automation
https://github.com/ernestognw/compound-proposal-automation
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ernestognw/compound-proposal-automation
- Owner: ernestognw
- Created: 2022-04-05T17:09:44.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-04-08T21:43:17.000Z (almost 3 years ago)
- Last Synced: 2024-10-29T01:40:58.924Z (2 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Compound Governance Proposal Automation ✨
Creates an Autotask given a `proposalId` that runs every 5 minutes and acts upon the current state
![](https://compound.finance/images/gov_diagram.png)
It follows the logic specified below:
- Query the proposal state given the proposal id
- If the proposal is `Succeeded`, queue it through a relayer transaction
- Save in the Autotask key-value store a state of `queue-tx-sent` so the Autotask don’t resend the tx
- If the proposal `Queued` then query the eta
- If `eta` has passed, send a tx to execute
- Save in the Autotask key-value store a `execute-tx-sent` so the relayer don't resend the tx
- If `eta` hasn’t passed, skip
- If the proposal is `Executed` pause the Autotask
- If the proposal has any other state, skip## How to deploy the Autotask ⚙️
1. Go to `code/index.js` and replace `GovernorBravo.address` if needed
2. Create an account and sign in to [Open Zeppelin Defender](https://defender.openzeppelin.com/)
3. Create a Relayer at the `Relay` tab for the same network where the `GovernorBravo` is deployed and fund it with any amount you'd like to provide for the proposals automations
4. Create a copy of `.env.example` in a `.env` file and fill with your Defender Team API Keys and your relayer id
5. Execute `yarn create:autotask `. `proposalId` should be in decimal### Notes
There are no `proposalId` validation, so be careful of providing an invalid `proposalId`