Giter Club home page Giter Club logo

aave-risk-stewards's Introduction

Aave Risk Steward

This repository contains some template/example code for executing cap updates on the RiskCapPlusSteward. There are 3 relevant contacts here:

  • CapsPlusRiskStewardBase the abstract base contract handling the configuration snapshot creation and the forwarding to safe via ffi
  • abstract Network contracts with all the relevant addresses initialized
  • MainnetExample the actual contract performing the update. The contract inherits the others and therefore handles testing and forwarding to safe automatically. The only thing that needs to be done is implementing:
    • name function returning a unique name (is used for generating the config snapshot and diffs)
    • capsUpdates function, analog to config engine

The code can be executed by running: forge script src/MainnetExample.s.sol:MainnetExample --rpc-url mainnet --sig "run(bool)" false -vv where the bool inside the run(bool) signature determines if the calldata should be sent to safe.

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

Test

forge test

Advanced features

Diffing

For contracts upgrading implementations it's quite important to diff the implementation code to spot potential issues and ensure only the intended changes are included. Therefore the Makefile includes some commands to streamline the diffing process.

Download

You can download the current contract code of a deployed contract via make download chain=polygon address=0x00. This will download the contract source for specified address to src/etherscan/chain_address. This command works for all chains with a etherscan compatible block explorer.

Git diff

You can git-diff a downloaded contract against your src via make git-diff before=./etherscan/chain_address after=./src out=filename. This command will diff the two folders via git patience algorithm and write the output to diffs/filename.md.

Caveat: If the onchain implementation was verified using flatten, for generating the diff you need to flatten the new contract via forge flatten and supply the flattened file instead fo the whole ./src folder.

aave-risk-stewards's People

Contributors

dependabot[bot] avatar eyalovadya avatar maltmark avatar sagishoshan avatar sakulstra avatar yonikesel avatar

Watchers

 avatar

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.