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.
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"
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;
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.
The library is generated based on the config file located in scripts/config.ts
. You can regenerate the files by running yarn generate
.
forge update
forge build
forge test