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
- Save in the Autotask key-value store a state of
- 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
- Save in the Autotask key-value store a
- If
eta
hasn’t passed, skip
- If
- If the proposal is
Executed
pause the Autotask - If the proposal has any other state, skip
- If the proposal is
- Go to
code/index.js
and replaceGovernorBravo.address
if needed - Create an account and sign in to Open Zeppelin Defender
- Create a Relayer at the
Relay
tab for the same network where theGovernorBravo
is deployed and fund it with any amount you'd like to provide for the proposals automations - Create a copy of
.env.example
in a.env
file and fill with your Defender Team API Keys and your relayer id - Execute
yarn create:autotask <proposalId>
.proposalId
should be in decimal
There are no proposalId
validation, so be careful of providing an invalid proposalId