/seatbelt-for-ghosts

Aave Seatbelt for governance proposals

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

Aave logo

Aave seatbelt

This repository contains tools that make on-chain governance safer, including automated scripts that apply checks to live proposals to allow for better informed voting.

Governance Checks

How it works

Aave Seatbelt is a tool for executing and interpreting governance simulations: it forks Ethereum mainnet (where the Aave governance lives), it simulates the execution of a proposal, and finally generates a report containing human-readable information on what effects a proposal will have.

The generated report will contain:

  • All the state changes were caused by the proposal execution.
  • Events triggered.
  • Compilation report of all contracts affected, to check for potential warnings.
  • It runs Slither (static analysis tool) over all touched contracts to find potential issues.

Some of those checks are initially generic, but in addition, we also added extra “interpretations” for particularities of the Aave ecosystem. For example, when an Aave Pool contract is affected, we can automate a deeper interpretation of the effect, making it more human-readable.

diagram

Development

Adding DAOs to CI

To add a DAO to CI, submit a pull request that adds the desired DAO_NAME and the according governance address to the DAOs constant in utils/constants and append your DAO_NAME to the matrix section of .github/workflows/governance-checks.yaml.

Note that only AaveGovernanceV2 style governance are supported.

Running Locally

First, create a file called .env with the following environment variables:

# URL to your node, e.g. Infura or Alchemy endpoint
RPC_URL=yourNodeUrl
RPC_URL_POLYGON=yourNodeUrl

# Tenderly access token
# Access token is obtained from the Tenderly UI via Account > Authorization > Generate Access Token
TENDERLY_ACCESS_TOKEN=yourAccessToken

# Tenderly project slug
# Project slug can be found in the URL of your project: https://dashboard.tenderly.co/<account>/<project_slug>/transactions
TENDERLY_PROJECT_SLUG=projectName

# Define the DAO name
DAO_NAME=Aave

# Tenderly account
# Project slug can be found in the URL of your project: https://dashboard.tenderly.co/<account>/<project_slug>/transactions
TENDERLY_ACCOUNT=accountName

# (Optional) Set omit cache to true if you want to force rerun all proposals
OMIT_CACHE=true

# (Optional) Seatbelt does not simulate executed proposals, instead it just analyzes the actual onchain transaction
# While this usually is the desired behavior in development it sometimes makes sense to check the simulation flow
FORCE_SIMULATION=true

# (Optional) Only needed when you want to run specific proposals of the selected DAO
PROPOSAL_FILTER=1_2_3

# (Optional) The root is optional for fork testing, but allows you to move the root in case there's a simulation you want to point to
TENDERLY_ROOT=tenderlyRoot

There are now two modes of operation:

  1. Run yarn start to simulate and run checks on all AaveGovernanceV2 proposals for the currently selected DAO
  2. Set PROPOSAL_FILTER to proposalId1_proposalId2 and run yarn start to only run checks for the selected proposal(s).

Reports

Find the reports here when run in CI, or in the reports folder if running locally.

Some notes on the outputs of reports:

  • If a transaction reverts, that will be reported in the state changes section
  • State changes and events around the proposal execution process are omitted from reports to reduce noise

Aave ( 0xEC568fffba86c094cf06b22134B23074DFE2252c )

Proposal Report App-link
AIP 5: Adding CRV to Aave 000.md app
Adding GUSD to AAVE 001.md app
Aavenomics Quarterly Upgrade 002.md app
Adding BAL on AAVE 003.md app
Activation of the Aave Balancer Pool Liquidity Staking 004.md app
Adding xSushi on AAVE 005.md app
desactivation of Aave V1 stable rate borrowing 006.md app
desactivation of Aave V1 stable rate borrowing 007.md app
Add renFIL support to Aave 008.md app
Enable borrowing on renFIL 009.md app
Upgrade Aave V1 repayment for migration tool 010.md app
introduce Liquidity Incentives for Aave v2 011.md app
Whitelist Curve Liquidity Mining Claim 012.md app
Aave Grants DAO 013.md app
Aavenomics quarterly upgrade Q2 2021 014.md app
Safety Incentives Implementation 015.md app
Set Reserve Factors for GUSD and CRV 016.md app
Add RAI to Aave V2 017.md app
Adding AMPL on AAVE 018.md app
Add PAX to Aave V2 019.md app
undefined 020.md app
Extend Liquidity Incentives for Aave v2 021.md app
Add BarnBridge (BOND) to Aave 022.md app
Raise Maximum Interest Rate on AMPL Market 023.md app
Lower Reserve Factor for AMPL 024.md app
Dynamic Risk Parameters 025.md app
Dynamic Risk Parameters 026.md app
Add DPI on Aave V2 027.md app
Extend Liquidity Incentives for Aave v2 028.md app
Polygon Cross-chain Governance Test 029.md app
Liquidation Bonus Updates 030.md app
Add FRAX to Aave V2 031.md app
Adjust interest rate to account for APY over-approximation 032.md app
LTV and Liquidation Threshold Updates to Moderate Levels 033.md app
Update to the Liquidity Mining Distribution 034.md app
Add FEI to Aave V2 035.md app
Adjust interest rate to account for APY over-approximation 036.md app
Add FEI to Aave V2 037.md app
Liquidation Bonus Updates for eleven Aave V2 assets 038.md app
Risk Parameter Updates for Aave V2 assets 039.md app
Risk Parameter Updates 2021-10-07 040.md app
Institute a Voting Delay Period 041.md app
Risk Parameter Updates 2021-10-14 042.md app
Risk Parameter Updates 2021-10-21 043.md app
Disable borrow for xSUSHI and DPI. Freeze reserves for UNI and BAL AMM Markets 044.md app
Risk Parameter Updates 2021-11-04 045.md app
Q2 Dynamic Risk Parameters 046.md app
Aave V2 - Liquidity Mining Program (90 days at 30% reduced rate) 047.md app
Add Fireblocks as a whitelister on Aave Arc 048.md app
Arc actionSet(0) 048_arc_0.md app
Authorize the Guardian to hold the emergency keys for V2 049.md app
Q2 Dynamic Risk Parameters 050.md app
Add G-UNI to Aave V2 AMM Market 051.md app
Renew Aave Grants DAO 052.md app
Risk Parameter Updates 2021-12-16 053.md app
Risk Parameter Updates 2021-12-29 054.md app
Enable FEI as Collateral on Aave V2 055.md app
Add Assets to Aave Polygon Market and Update WMATIC Risk Parameters 056.md app
Revert ENJ Parameter Changes and Enable FEI as Collateral on Aave V2 057.md app
Risk Parameter Updates 2022-02-10 058.md app
Add SEBA Bank as a whitelister on Aave Arc 059.md app
Arc actionSet(1) 059_arc_1.md app
Aave V2 - Liquidity Mining Update (90 days at 30% reduced rate) 060.md app
Aave <> Starknet - Phase I 061.md app
Add stETH to AAVE v2 062.md app
Add ENS to Aave V2 063.md app
Risk Parameter Updates 2022-02-24 064.md app
Add Terra USD (UST) to AAVE v2 065.md app
Continuous Formal Verification 066.md app
Risk Parameter Updates 2022-03-22 067.md app
Optimizing ETH rates 068.md app
Risk Parameter Updates 2022-03-31 069.md app
Risk Parameter Updates 2022-04-22 070.md app
Approval of BGD contribution to Aave 071.md app
Aave Arc Market - Update Asset Listing Risk Parameters 072.md app
Arc actionSet(2) 072_arc_2.md app
Renew Aave Grants DAO 073.md app
Risk Parameter Updates 2022-05-05 074.md app
Freezing UST and Updating stETH Parameters 075.md app
Consolidate Reserve Factors and Enable Borrowing DPI 076.md app
Add claimRewardsToSelf() to incentives for Ethereum V2 Aave Market 077.md app
Risk Parameter Updates for Aave V2 and Aave Arc (Fireblocks) 2022-05-26 078.md app
Arc actionSet(3) 078_arc_3.md app
Consolidate Reserve Factors and Enable Borrowing DPI 079.md app
Add CVX to Aave V2 080.md app
Risk Parameter Updates for Aave Arc (Fireblocks) 2022-05-26 081.md app
Arc actionSet(3) 081_arc_3.md app
Renew allowance of the Aave Safety Module 082.md app
Freeze stETH, Increase stETH Liq. Threshold to 90%, Pause ETH Borrowing 083.md app
Risk Parameter Updates for Aave Arc (Fireblocks) 2022-05-26 084.md app
Arc actionSet(3) 084_arc_3.md app
Aave <> Starknet - Phase I (Part 2) 085.md app
Bounty to Hacxyk for fallback oracle misconfiguration 086.md app
Strategic Investment Part 1 - BAL <> AAVE Token Swap 087.md app
Sigma Prime - Security Assessment Services for Aave 088.md app
Add 1INCH to Aave v2 market 089.md app
Add 1INCH to Aave v2 market 090.md app
Appoint Securitize as a Whitelister to Aave Arc 091.md app
Arc actionSet(4) 091_arc_4.md app
Risk Parameter Updates for Aave V2 (2022-08-03) 092.md app
Add MAI to Aave V3 on Polygon 093.md app
PolygonBridgeExecutor actionSet("2": {"executed":true}) 093_fx_0.md app
Risk Parameter Updates for Aave V2 (2022-08-18) 094.md app
Add LUSD to Aave V2 095.md app
FEI Risk Parameter Updates for Ethereum Aave v2 Market 096.md app
Pause ETH Borrowing 097.md app
V3 Retroactive Funding 098.md app
PolygonBridgeExecutor actionSet("2": {"executed":true}) 098_fx_0.md app
Add stMATIC to Aave v3 pool on Polygon 099.md app
PolygonBridgeExecutor actionSet("3": {"executed":true}) 099_fx_0.md app
Add MaticX to Aave v3 Polygon Pool 100.md app
PolygonBridgeExecutor actionSet("4": {"executed":true}) 100_fx_0.md app
Re-enable ETH Borrowing 101.md app
Risk Parameter Updates for Aave V2 (2022-09-22) 102.md app
Ethereum v2 Reserve Factor - aFEI Holding Update 103.md app
Llama <> Aave 104.md app
Ethereum v2 Reserve Factor - aFEI Holding Update 105.md app
Adjust Aave Governance Level 2 requirements 106.md app
Use AAVE Ecosystem Reserve to vote YES on proposal to adjust Level 2 Governance requirements 107.md app
Risk Parameter Updates for Aave V2 ETH (2022-10-06) 108.md app
Whitelist Balancer’s Liquidity Mining Claim 109.md app
FEI Reserve Factor Update 110.md app
Risk Parameter Updates for Aave V2 ETH (2022-10-21) 111.md app
Risk Parameter Updates for Aave Polygon Markets (2022-10-21) 112.md app
PolygonBridgeExecutor actionSet("5": {"targets":null,"values":null,"signatures":null,"calldatas":null,"withDelegatecalls":null,"executionTime":null,"executed":true,"canceled":false}) 112_fx_5_0.md app
PolygonBridgeExecutor actionSet("6": {"targets":null,"values":null,"signatures":null,"calldatas":null,"withDelegatecalls":null,"executionTime":null,"executed":true,"canceled":false}) 112_fx_6_1.md app
Chaos Labs Risk Platform Proposal 113.md app
Certora Continuous Formal Verification 114.md app
Strategic Partnership with Balancer DAO Part 2 - 100k BAL Acquisition 115.md app
Add OP to Aave V3 on Optimism 116.md app
OptimismBridgeExecutor actionSet("0": {"targets":null,"values":null,"signatures":null,"calldatas":null,"withDelegatecalls":null,"executionTime":null,"executed":true,"canceled":false}) 116_optimism_0_0.md app
Risk Parameter Updates for Aave V2 ETH Market (2022-11-12) 117.md app
Risk Parameter Updates for Aave V2 ETH Market (2022-11-13) 118.md app
Risk Parameter Updates for Aave V2 ETH (2022-11-13) 119.md app

Credits

Forked of & inspired by uniswap governance seatbelt

Notable changes:

  • adjusted for AaveGovernanceV2 and ipfs proposal payloads
  • storing reports right on the main branch for better discoverability
  • simulations are only rerun for not previously executed & simulated proposals
  • running custom simulations is handled via PROPOSAL_FILTER only, no need to create sim files
  • the ci is chunking the proposals in different runs so they can partially run in parallel