Code Monkey home page Code Monkey logo

aave-address-book's Introduction

Address book logo

Aave Address Book ๐Ÿ“–

This repository contains an up-to-date registry of all addresses of the Aave ecosystem's smart contracts, for its usage in Solidity codebases.

The goal is for Solidity developers to have the most integrated environment possible when they want to develop on top of Aave, by just importing a package with all the necessary addresses to interact with.


Usage with foundry

With Foundry installed and being in a Git repository:

forge install bgd-labs/aave-address-book

You will be able to import on any Solidity file any collection of addresses per network:

import {AaveV2Ethereum} from "aave-address-book/AaveAddressBook.sol"

Usage in production

For production code we recommend to use market specific libraries (Aave[Version][Network][?SubMarket]) exported from AaveAddressBook like AaveV2Ethereum for the V2 Ethereum market. These entrypoints contain constants for all the immutable market specific addresses.

Each market consists of the following constants:

// v2 libraries
POOL_ADDRESSES_PROVIDER = ILendingPoolAddressesProvider;
POOL = ILendingPool;
POOL_CONFIGURATOR = ILendingPoolConfigurator;
ORACLE = IAaveOracle;
AAVE_PROTOCOL_DATA_PROVIDER = IAaveProtocolDataProvider;
POOL_ADMIN = address;
EMERGENCY_ADMIN = address;
// v3 libraries
POOL_ADDRESSES_PROVIDER = IPoolAddressesProvider;
POOL = IPool;
POOL_CONFIGURATOR = IPoolConfigurator;
ORACLE = IAaveOracle;
AAVE_PROTOCOL_DATA_PROVIDER = IAaveProtocolDataProvider;
POOL_ADMIN = address;
ACL_ADMIN = address;

Usage in tests

In tests it's sometimes useful to have a generic way to import different markets across networks. Therefore the address book provides generic entrypoints allowing to access multiple markets and networks.

Market memory v2market = AaveAddressBookV2.getMarket(marketName);
Market memory v2testnetmarket = AaveAddressBookV2Testnet.getMarket(marketName);
Market memory v3market = AaveAddressBookV3.getMarket(marketName);
Market memory v3testnetmarket = AaveAddressBookV3Testnet.getMarket(marketName);

The returned Market is a struct following the same layout as the market specific libraries.

We don't recommend using these generic libraries in production code as they are quite gas & code-size intensive.

Running this repository

Generate files

The library is generated based on the config file located in scripts/config.ts. You can regenerate the files by running yarn generate.

Dependencies

forge update

Compilation

forge build

Testing

forge test

Sample projects

aave-address-book's People

Contributors

eboadom avatar github-actions[bot] avatar sakulstra avatar sendra 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.