@bgd-labs/aave-address-book 4.44.2-6665235b375ba44abc99392fa26d89ba4142ea2b.0 → 4.44.2-9714560ec245445f6cf53004f96fcc251d7a74b5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +79 -65
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright
|
|
1
|
+
Copyright 2022 BGD Labs
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
package/README.md
CHANGED
|
@@ -1,119 +1,133 @@
|
|
|
1
1
|
<p align="center"><img width="200" src="./addressbook_logo.png" alt="Address book logo"></a></p>
|
|
2
2
|
|
|
3
|
-
# Aave Address Book
|
|
3
|
+
# Aave Address Book :book:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This repository contains an up-to-date registry of all addresses of the Aave ecosystem's smart contracts, for its usage in Solidity codebases.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
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.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
You can find a searchable version of the address book on [https://search.onaave.com/](https://search.onaave.com/).
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Usage with foundry
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
With Foundry installed and being in a Git repository:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
16
|
forge install bgd-labs/aave-address-book
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**Import a pool specific collection of addresses & interfaces:**
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
|
|
22
|
+
import {AaveV2Ethereum} from "aave-address-book/AaveV2Ethereum.sol";
|
|
23
|
+
import {AaveV3Avalanche} from "aave-address-book/AaveV3Avalanche.sol";
|
|
23
24
|
```
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
**Import addresses and interfaces to interact with Governance:**
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
```sh
|
|
29
|
+
import {AaveGovernanceV2} from "aave-address-book/AaveGovernanceV2.sol";
|
|
30
|
+
import {IGovernanceCore} from "aave-address-book/GovernanceV3.sol";
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Import miscellaneous network addresses and interfaces relevant to the aave protocol:**
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
import {Misc<Network>} from "aave-address-book/Aave<Network>.sol";
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Production Recommendations
|
|
41
|
+
|
|
42
|
+
While there is a index import available in "aave-address-book/AaveAddressBook.sol", we only recommend using it in tests.
|
|
43
|
+
Foundry currently does not eliminate unused code for [verification](https://github.com/foundry-rs/foundry/issues/2266).
|
|
44
|
+
This results in rather gigantic verifications when using the index file import from [aave-address-book/AaveAddressBook.sol](./src/AaveAddressBook.sol).
|
|
45
|
+
For production code we therefore recommend to use pool specific libraries (`Aave[Version][Network][?SubPool]`) exported from `aave-address-book` like `AaveV2Ethereum` for the `V2` `Ethereum` pool.
|
|
28
46
|
|
|
29
|
-
|
|
30
|
-
import { AaveV3Ethereum } from "aave-address-book/AaveV3Ethereum.sol";
|
|
31
|
-
import { AaveV2Avalanche } from "aave-address-book/AaveV2Avalanche.sol";
|
|
32
|
-
import { AaveGovernanceV2 } from "aave-address-book/AaveGovernanceV2.sol";
|
|
47
|
+
## Usage with node
|
|
33
48
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
}
|
|
49
|
+
### Install
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npm i @bgd-labs/aave-address-book
|
|
40
53
|
```
|
|
41
54
|
|
|
42
|
-
###
|
|
55
|
+
### Usage
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
import * as pools from "@bgd-labs/aave-address-book"; // wildcard import
|
|
59
|
+
import { AaveV2Avalanche } from "@bgd-labs/aave-address-book"; // import specific pool
|
|
43
60
|
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
// all variables available on solidity version are available in javascript as well
|
|
62
|
+
console.log(AaveV2Avalanche.POOL_ADDRESSES_PROVIDER);
|
|
63
|
+
// "0xa97684ead0e402dC232d5A977953DF7ECBaB3CDb"
|
|
46
64
|
|
|
47
|
-
|
|
48
|
-
console.log(
|
|
65
|
+
// in addition the chainId of the respective addresses is exported alongside
|
|
66
|
+
console.log(AaveV2Avalanche.CHAIN_ID);
|
|
67
|
+
// 43114
|
|
49
68
|
```
|
|
50
69
|
|
|
51
|
-
##
|
|
70
|
+
## Running this repository
|
|
52
71
|
|
|
53
|
-
### Generate
|
|
72
|
+
### Generate files
|
|
54
73
|
|
|
55
|
-
The library
|
|
74
|
+
The library is generated based on the `scripts/generateAddresses.ts` and `scripts/generateABIs.ts` scripts. You can regenerate the files by running `npm run start`.
|
|
75
|
+
|
|
76
|
+
### Dependencies
|
|
56
77
|
|
|
57
78
|
```sh
|
|
58
|
-
|
|
79
|
+
forge update
|
|
59
80
|
```
|
|
60
81
|
|
|
61
|
-
###
|
|
82
|
+
### Compilation
|
|
62
83
|
|
|
63
84
|
```sh
|
|
64
|
-
npm run build
|
|
65
85
|
forge build
|
|
66
86
|
```
|
|
67
87
|
|
|
68
|
-
###
|
|
69
|
-
|
|
70
|
-
The library includes a suite of tests that can be run using the following commands:
|
|
88
|
+
### Testing
|
|
71
89
|
|
|
72
90
|
```sh
|
|
73
|
-
npm test
|
|
74
91
|
forge test
|
|
75
92
|
```
|
|
76
93
|
|
|
77
|
-
|
|
78
|
-
In addition to that there is a [verification suite](./tests/verification.spec.ts) that ensures that all the addresses listed on address book, are verified on our preferred explorers.
|
|
94
|
+
### Adding a new Pool
|
|
79
95
|
|
|
80
|
-
|
|
96
|
+
To list a new pool in the address book, you simply need to add a new pool in the respective [pools config](./scripts/configs/<type>/<network>) and run `npm run generate:addresses`.
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
2. Run `npm run generate:addresses`
|
|
84
|
-
3. Commit the generated files
|
|
98
|
+
### Adding new Addresses
|
|
85
99
|
|
|
86
|
-
|
|
100
|
+
a) Adding an address that **can be obtained via onchain calls** so it doesn't need to be hardcoded on the configs:
|
|
87
101
|
|
|
88
|
-
|
|
102
|
+
To achieve an addition here you need to add the address to the respective [v2 type](https://github.com/bgd-labs/aave-address-book/blob/main/scripts/generator_v2.ts#L11) and/or [v3 type](https://github.com/bgd-labs/aave-address-book/blob/main/scripts/generator_v3.ts#L11) and adjust the generator scripts accordingly. New types should be added to the [AaveV2](https://github.com/bgd-labs/aave-address-book/blob/main/src/AaveV2.sol) and [AaveV3](https://github.com/bgd-labs/aave-address-book/blob/main/src/AaveV3.sol) files.
|
|
89
103
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
# Per default the package uses the public rpcs available via viem
|
|
96
|
-
# You can opt in to use private/different rpcs by setting the following environment variables
|
|
97
|
-
RPC_<NETWORK>=your_rpc_url
|
|
98
|
-
ALCHEMY_API_KEY=your_key_here
|
|
99
|
-
QUICKNODE_ENDPOINT_NAME=your_quicknode_endpoint_name
|
|
100
|
-
QUICKNODE_TOKEN=your_quicknode_token
|
|
101
|
-
```
|
|
104
|
+
b) Adding an address that **cannot be obtained via onchain calls** so it needs to be manually maintained:
|
|
105
|
+
|
|
106
|
+
To achieve an addition here, you need to alter the [additionalAddresses section](https://github.com/bgd-labs/aave-address-book/blob/main/scripts/config.ts#L46) on the pool type and add your address to the respective pools. Additional addresses will currently be exported as type `address`. There's currently no possibility to define a custom type.
|
|
107
|
+
|
|
108
|
+
In any case you need to run `npm run generate:addresses` afterwards and commit the altered artifacts.
|
|
102
109
|
|
|
103
|
-
|
|
110
|
+
### Notes
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
- In order to successfully check that contracts are verified, you must have in your local `.env` file an entry of `ETHERSCAN_API_KEY` with a mainnet API key on it.
|
|
113
|
+
- Avalanche contracts must be verified on `snowscan.io`
|
|
114
|
+
- Contract addresses of whitelabel instances which are not directly controlled by the Aave DAO are also included in this repository. A complete list of Whitelabel instances controlled by their respective teams can be found here: [AaveV3InkWhitelabel](src/AaveV3InkWhitelabel.sol)
|
|
107
115
|
|
|
108
|
-
|
|
116
|
+
### Troubleshooting
|
|
109
117
|
|
|
110
|
-
|
|
111
|
-
- **[Web Search](https://search.onaave.com/)** - Browse all addresses
|
|
118
|
+
#### Error generating the addresses
|
|
112
119
|
|
|
113
|
-
|
|
120
|
+
This repository will try to use public rpcs.
|
|
121
|
+
For some networks they are not very reliable though, therefore you can set `RPC_<NETWORK>` in your .env to use a private rpc.
|
|
122
|
+
Check https://github.com/bgd-labs/aave-address-book/blob/main/scripts/clients.ts#L39 for the chain naming convention.
|
|
123
|
+
Alternatively you can provide an `ALCHEMY_API_KEY` which will use alchemy as a fallback if no exact RPC is specified.
|
|
114
124
|
|
|
115
|
-
|
|
125
|
+
### Raycast extension
|
|
116
126
|
|
|
117
|
-
|
|
127
|
+
To install the Aave Search extension for [Raycast](https://www.raycast.com/):
|
|
128
|
+
1. Make sure you have Raycast installed on your Mac
|
|
129
|
+
2. Open Raycast, type `Store` and select the Store command
|
|
130
|
+
4. Search for `Aave Search` or navigate directly to the [extension page](https://www.raycast.com/smbdy/aave-search).
|
|
131
|
+
5. Click the Install button or press `⌘ + ↵` to install the extension
|
|
118
132
|
|
|
119
|
-
|
|
133
|
+
Once installed, you can use the extension by typing `aave` in Raycast.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgd-labs/aave-address-book",
|
|
3
|
-
"version": "4.44.2-
|
|
3
|
+
"version": "4.44.2-9714560ec245445f6cf53004f96fcc251d7a74b5.0",
|
|
4
4
|
"description": "This repository contains an up-to-date registry of all addresses of the Aave ecosystem's smart contracts, for its usage in Solidity codebases.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|