Last active
January 20, 2023 16:38
-
-
Save martinvol/31e0098ed3b44ec5cf89c24067fc2fc5 to your computer and use it in GitHub Desktop.
Step by step to pass a governance proposal on Alfajores or Baklava Celo testnets
This file contains hidden or 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
#!/usr/bin/env bash | |
# Imperfect but simple script to pass governance proposals on Celo tesnets (staging, baklava or alfajores) | |
set -euo pipefail | |
# Variables to be defined | |
PROPOSAL_JSON_PATH= # Path for json of the proposal | |
DESCRIPTION_URL= # Path for the URL containing the proposal | |
SIGNER= # address that will send the tx | |
APPROVER= # approver address | |
# PRIVATE_KEY= # Private key of the approver, safer to define in the command line with `export` | |
celocli governance:withdraw --from=$SIGNER || echo "There were no pending refunds" # Optional step, getting some deposits back | |
PROPOSAL_ID=`celocli governance:propose --deposit=100e18 --descriptionURL=$DESCRIPTION_URL --from=$SIGNER --jsonTransactions=$PROPOSAL_JSON_PATH | grep "proposalId:" | grep -oE '[0-9]+'` | |
echo "Proposal has ID=$PROPOSAL_ID" | |
echo -e "\a" && sleep 31 &&\ | |
celocli governance:approve --proposalID $PROPOSAL_ID --from $APPROVER --useMultiSig --privateKey $PRIVATE_KEY &&\ | |
echo -e "\a" && sleep 301 &&\ | |
celocli governance:vote --value=Yes --from=$SIGNER --proposalID=$PROPOSAL_ID &&\ | |
echo -e "\a" && sleep 301 &&\ | |
celocli governance:execute --from=$SIGNER --proposalID=$PROPOSAL_ID | |
# Proposal passed, make some noise | |
echo -e "\a" | |
echo -e "\a" | |
echo -e "\a" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment