Giter Site home page Giter Site logo

aave / aave-proposals-aip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bgd-labs/aave-proposals

3.0 1.0 1.0 3.09 MB

Utilities and examples for Aave governance proposals

License: MIT License

TypeScript 3.62% Makefile 0.35% Solidity 96.03%

aave-proposals-aip's Introduction

Aave proposals

This repository contains various proposals targeting the Aave governance. In addition to the actual proposals this repository also contains tooling to standardize certain protocol tasks. The tooling documentation is co-located with the relevant smart contracts.

Tooling

Cross-chain forwarders

The cross-chain-forwarders are opinionated contracts for proposals targeting polygon, optimism and arbitrum. For detailed documentation checkout the docs.

Config engine

The AaveV3ConfigEngine (Docs) is a helper smart contract to abstract good practices when doing "admin" interactions with the Aave v3 protocol, but built on top, without touching the core contracts.

Development

This project uses Foundry. See the book for detailed instructions on how to install and use Foundry. The template ships with sensible default so you can use default foundry commands without resorting to MakeFile.

Setup

cp .env.example .env
forge install
yarn

Create an aip

This repository includes a generator to help you bootstrap the required files for an AIP. To generate a proposal you need to run: yarn generate

To get a full list of available commands run yarn generate --help

Usage: proposal-generator [options]

CLI to generate aave proposals

Options:
  -V, --version                    output the version number
  -f, --force                      force creation (might overwrite existing files)
  -cfg, --configEngine             extends config engine
  -ch, --chains <letters...>        (choices: "Ethereum", "Optimism", "Arbitrum", "Polygon", "Avalanche", "Fantom", "Harmony", "Metis", "Base")
  -pv, --protocolVersion <string>   (choices: "V2", "V3")
  -t, --title <string>             aip title
  -a, --author <string>            author
  -d, --discussion <string>        forum link
  -s, --snapshot <string>          snapshot link
  -h, --help                       display help for command

If you have any feedback regarding the generator (bugs, improvements, features), don't hesitate and put it here!

Test

# You can use vanilla forge to customize your test
# https://book.getfoundry.sh/reference/forge/forge-test
forge test
# We also provide a script with sensible defaults to just test a single contract matching a filter
make test-contract filter=ENS

Deploy

The makefile contains some generic templates for proposal deployments. To deploy a contract you can run make deploy-ledger contract=pathToContract:Contract chain=chainAlias.

# example
make deploy-ledger contract=script/CreateProposals.s.sol:MultiPayloadProposal chain=mainnet
make deploy-pk contract=script/CreateProposals.s.sol:MultiPayloadProposal chain=mainnet
# both targets also expose a `dry` option you can run via
make deploy-ledger contract=script/CreateProposals.s.sol:MultiPayloadProposal chain=mainnet dry=true
make deploy-pk contract=script/CreateProposals.s.sol:MultiPayloadProposal chain=mainnet dry=true

Simulate

While a proposal should be tested throughout, it usually is a good idea to simulate execution on a fork. Therefore this repository comes with the aave-tenderly-cli node package which can be used to streamline fork creation.

Setup your .env accordingly or follow the setup instructions for global configuration. Now you can

yarn simulate:<mainnet|polygon|...> -- <artifactPath>

# example:
# yarn simulate:polygon -- ./out/AaveV3EthAddCRVPoolPayload.sol/AaveV3EthAddCRVPoolPayload.json

to generate a tenderly fork you can share with your team.

Proposal creation

To create a proposal you have to do three things:

  1. deploy the payload
  2. create an aip
  3. create the mainnet proposal

While the first two steps can be performed in parallel, the final proposal creation relies on (1) and (2). Every step can in theory be performed by a different entity.

The address creating the mainnet proposal(3) requires 80k AAVE of proposition power.

1. Deploy payload

The payload is always deployed on the chain it affects. Therefore you need to adjust the relevant script accordingly:

Once adjusted, you need to deploy it to receive the payload address. Checkout Makefile for reference.

2. Create an aip

The aip can be co-located with the proposal code as a markdown file. This repository will manage the upload to ipfs automatically once a pr is merged to main. Alternatively you can submit your aip to the aave/aip repository or upload it yourself.

3. Create proposal

The proposal requires at least one payload address and the encodedHash.

To create the proposal you need to adjust:

Once adjusted, you need to create the proposal. Checkout Makefile for reference.

๐ŸŽ‰

aave-proposals-aip's People

Contributors

sakulstra avatar efecarranza avatar eboadom avatar yonikesel avatar foodaka avatar defijesus avatar rustboyar avatar sendra avatar brotherlymite avatar yhayun avatar maltmark avatar zer0dot avatar reem avatar rozengarden avatar arieg419 avatar github-actions[bot] avatar zedt3ster avatar natanela avatar miguelmtzinf avatar sagishoshan avatar yoavigra avatar

Stargazers

The light co avatar  avatar Sanyakry avatar

Watchers

 avatar

Forkers

gofaraway002

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.