cylon56 / compound-proposal-automation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compound Governance Proposal Automation ✨

Creates an Autotask given a proposalId that runs every 5 minutes and acts upon the current state

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
  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>. proposalId should be in decimal

Notes

There are no proposalId validation, so be careful of providing an invalid proposalId

About


Languages

Language:JavaScript 99.4%Language:Shell 0.6%