@bgd-labs/aave-address-book 1.1.1

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.
Files changed (115) hide show
  1. package/.gitmodules +4 -0
  2. package/CHANGELOG.md +56 -0
  3. package/LICENSE +7 -0
  4. package/README.md +94 -0
  5. package/addressbook_logo.png +0 -0
  6. package/dist/AaveAddressBook.d.ts +17 -0
  7. package/dist/AaveAddressBook.js +20 -0
  8. package/dist/AaveV2Avalanche.d.ts +9 -0
  9. package/dist/AaveV2Avalanche.js +12 -0
  10. package/dist/AaveV2Ethereum.d.ts +9 -0
  11. package/dist/AaveV2Ethereum.js +12 -0
  12. package/dist/AaveV2EthereumAMM.d.ts +9 -0
  13. package/dist/AaveV2EthereumAMM.js +12 -0
  14. package/dist/AaveV2EthereumArc.d.ts +9 -0
  15. package/dist/AaveV2EthereumArc.js +12 -0
  16. package/dist/AaveV2Fuji.d.ts +9 -0
  17. package/dist/AaveV2Fuji.js +12 -0
  18. package/dist/AaveV2Mumbai.d.ts +9 -0
  19. package/dist/AaveV2Mumbai.js +12 -0
  20. package/dist/AaveV2Polygon.d.ts +9 -0
  21. package/dist/AaveV2Polygon.js +12 -0
  22. package/dist/AaveV3Arbitrum.d.ts +9 -0
  23. package/dist/AaveV3Arbitrum.js +12 -0
  24. package/dist/AaveV3Avalanche.d.ts +9 -0
  25. package/dist/AaveV3Avalanche.js +12 -0
  26. package/dist/AaveV3Fantom.d.ts +9 -0
  27. package/dist/AaveV3Fantom.js +12 -0
  28. package/dist/AaveV3FantomTestnet.d.ts +9 -0
  29. package/dist/AaveV3FantomTestnet.js +12 -0
  30. package/dist/AaveV3Fuji.d.ts +9 -0
  31. package/dist/AaveV3Fuji.js +12 -0
  32. package/dist/AaveV3Harmony.d.ts +9 -0
  33. package/dist/AaveV3Harmony.js +12 -0
  34. package/dist/AaveV3Mumbai.d.ts +9 -0
  35. package/dist/AaveV3Mumbai.js +12 -0
  36. package/dist/AaveV3Optimism.d.ts +9 -0
  37. package/dist/AaveV3Optimism.js +12 -0
  38. package/dist/AaveV3OptimismKovan.d.ts +9 -0
  39. package/dist/AaveV3OptimismKovan.js +12 -0
  40. package/dist/AaveV3Polygon.d.ts +9 -0
  41. package/dist/AaveV3Polygon.js +12 -0
  42. package/foundry.toml +8 -0
  43. package/lib/forge-std/.github/workflows/tests.yml +27 -0
  44. package/lib/forge-std/.gitmodules +3 -0
  45. package/lib/forge-std/LICENSE-APACHE +203 -0
  46. package/lib/forge-std/LICENSE-MIT +25 -0
  47. package/lib/forge-std/README.md +246 -0
  48. package/lib/forge-std/lib/ds-test/LICENSE +674 -0
  49. package/lib/forge-std/lib/ds-test/Makefile +14 -0
  50. package/lib/forge-std/lib/ds-test/default.nix +4 -0
  51. package/lib/forge-std/lib/ds-test/demo/demo.sol +222 -0
  52. package/lib/forge-std/lib/ds-test/src/test.sol +469 -0
  53. package/lib/forge-std/src/Script.sol +39 -0
  54. package/lib/forge-std/src/StdJson.sol +118 -0
  55. package/lib/forge-std/src/Test.sol +1134 -0
  56. package/lib/forge-std/src/Vm.sol +231 -0
  57. package/lib/forge-std/src/console.sol +1533 -0
  58. package/lib/forge-std/src/console2.sol +1538 -0
  59. package/lib/forge-std/src/test/Script.t.sol +12 -0
  60. package/lib/forge-std/src/test/StdAssertions.t.sol +591 -0
  61. package/lib/forge-std/src/test/StdCheats.t.sol +282 -0
  62. package/lib/forge-std/src/test/StdError.t.sol +124 -0
  63. package/lib/forge-std/src/test/StdMath.t.sol +200 -0
  64. package/lib/forge-std/src/test/StdStorage.t.sol +321 -0
  65. package/lib/forge-std/src/test/fixtures/broadcast.log.json +187 -0
  66. package/package.json +39 -0
  67. package/src/AaveAddressBook.sol +28 -0
  68. package/src/AaveAddressBookV2.sol +143 -0
  69. package/src/AaveAddressBookV2Testnet.sol +74 -0
  70. package/src/AaveAddressBookV3.sol +166 -0
  71. package/src/AaveAddressBookV3Testnet.sol +120 -0
  72. package/src/AaveGovernanceV2.sol +549 -0
  73. package/src/AaveV2.sol +931 -0
  74. package/src/AaveV2Avalanche.sol +35 -0
  75. package/src/AaveV2Ethereum.sol +36 -0
  76. package/src/AaveV2EthereumAMM.sol +36 -0
  77. package/src/AaveV2EthereumArc.sol +36 -0
  78. package/src/AaveV2Fuji.sol +35 -0
  79. package/src/AaveV2Mumbai.sol +35 -0
  80. package/src/AaveV2Polygon.sol +35 -0
  81. package/src/AaveV3.sol +2406 -0
  82. package/src/AaveV3Arbitrum.sol +34 -0
  83. package/src/AaveV3Avalanche.sol +34 -0
  84. package/src/AaveV3Fantom.sol +34 -0
  85. package/src/AaveV3FantomTestnet.sol +34 -0
  86. package/src/AaveV3Fuji.sol +34 -0
  87. package/src/AaveV3Harmony.sol +34 -0
  88. package/src/AaveV3HarmonyTestnet.sol +34 -0
  89. package/src/AaveV3Mumbai.sol +34 -0
  90. package/src/AaveV3Optimism.sol +34 -0
  91. package/src/AaveV3OptimismKovan.sol +34 -0
  92. package/src/AaveV3Polygon.sol +34 -0
  93. package/src/Common.sol +9 -0
  94. package/src/test/AaveV2Ethereum.t.sol +72 -0
  95. package/src/test/AaveV2Misfits.t.sol +33 -0
  96. package/src/test/AaveV3Avalanche.t.sol +65 -0
  97. package/src/ts/AaveAddressBook.ts +17 -0
  98. package/src/ts/AaveV2Avalanche.ts +11 -0
  99. package/src/ts/AaveV2Ethereum.ts +12 -0
  100. package/src/ts/AaveV2EthereumAMM.ts +12 -0
  101. package/src/ts/AaveV2EthereumArc.ts +12 -0
  102. package/src/ts/AaveV2Fuji.ts +11 -0
  103. package/src/ts/AaveV2Mumbai.ts +11 -0
  104. package/src/ts/AaveV2Polygon.ts +11 -0
  105. package/src/ts/AaveV3Arbitrum.ts +12 -0
  106. package/src/ts/AaveV3Avalanche.ts +12 -0
  107. package/src/ts/AaveV3Fantom.ts +12 -0
  108. package/src/ts/AaveV3FantomTestnet.ts +12 -0
  109. package/src/ts/AaveV3Fuji.ts +12 -0
  110. package/src/ts/AaveV3Harmony.ts +12 -0
  111. package/src/ts/AaveV3Mumbai.ts +12 -0
  112. package/src/ts/AaveV3Optimism.ts +12 -0
  113. package/src/ts/AaveV3OptimismKovan.ts +12 -0
  114. package/src/ts/AaveV3Polygon.ts +12 -0
  115. package/tsconfig.json +101 -0
@@ -0,0 +1,231 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.6.0 <0.9.0;
3
+ pragma experimental ABIEncoderV2;
4
+
5
+ interface Vm {
6
+ struct Log {
7
+ bytes32[] topics;
8
+ bytes data;
9
+ }
10
+
11
+ // Sets block.timestamp (newTimestamp)
12
+ function warp(uint256) external;
13
+ // Sets block.height (newHeight)
14
+ function roll(uint256) external;
15
+ // Sets block.basefee (newBasefee)
16
+ function fee(uint256) external;
17
+ // Sets block.difficulty (newDifficulty)
18
+ function difficulty(uint256) external;
19
+ // Sets block.chainid
20
+ function chainId(uint256) external;
21
+ // Loads a storage slot from an address (who, slot)
22
+ function load(address,bytes32) external returns (bytes32);
23
+ // Stores a value to an address' storage slot, (who, slot, value)
24
+ function store(address,bytes32,bytes32) external;
25
+ // Signs data, (privateKey, digest) => (v, r, s)
26
+ function sign(uint256,bytes32) external returns (uint8,bytes32,bytes32);
27
+ // Gets the address for a given private key, (privateKey) => (address)
28
+ function addr(uint256) external returns (address);
29
+ // Gets the nonce of an account
30
+ function getNonce(address) external returns (uint64);
31
+ // Sets the nonce of an account; must be higher than the current nonce of the account
32
+ function setNonce(address, uint64) external;
33
+ // Performs a foreign function call via the terminal, (stringInputs) => (result)
34
+ function ffi(string[] calldata) external returns (bytes memory);
35
+ // Sets environment variables, (name, value)
36
+ function setEnv(string calldata, string calldata) external;
37
+ // Reads environment variables, (name) => (value)
38
+ function envBool(string calldata) external returns (bool);
39
+ function envUint(string calldata) external returns (uint256);
40
+ function envInt(string calldata) external returns (int256);
41
+ function envAddress(string calldata) external returns (address);
42
+ function envBytes32(string calldata) external returns (bytes32);
43
+ function envString(string calldata) external returns (string memory);
44
+ function envBytes(string calldata) external returns (bytes memory);
45
+ // Reads environment variables as arrays, (name, delim) => (value[])
46
+ function envBool(string calldata, string calldata) external returns (bool[] memory);
47
+ function envUint(string calldata, string calldata) external returns (uint256[] memory);
48
+ function envInt(string calldata, string calldata) external returns (int256[] memory);
49
+ function envAddress(string calldata, string calldata) external returns (address[] memory);
50
+ function envBytes32(string calldata, string calldata) external returns (bytes32[] memory);
51
+ function envString(string calldata, string calldata) external returns (string[] memory);
52
+ function envBytes(string calldata, string calldata) external returns (bytes[] memory);
53
+ // Sets the *next* call's msg.sender to be the input address
54
+ function prank(address) external;
55
+ // Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called
56
+ function startPrank(address) external;
57
+ // Sets the *next* call's msg.sender to be the input address, and the tx.origin to be the second input
58
+ function prank(address,address) external;
59
+ // Sets all subsequent calls' msg.sender to be the input address until `stopPrank` is called, and the tx.origin to be the second input
60
+ function startPrank(address,address) external;
61
+ // Resets subsequent calls' msg.sender to be `address(this)`
62
+ function stopPrank() external;
63
+ // Sets an address' balance, (who, newBalance)
64
+ function deal(address, uint256) external;
65
+ // Sets an address' code, (who, newCode)
66
+ function etch(address, bytes calldata) external;
67
+ // Expects an error on next call
68
+ function expectRevert(bytes calldata) external;
69
+ function expectRevert(bytes4) external;
70
+ function expectRevert() external;
71
+ // Records all storage reads and writes
72
+ function record() external;
73
+ // Gets all accessed reads and write slot from a recording session, for a given address
74
+ function accesses(address) external returns (bytes32[] memory reads, bytes32[] memory writes);
75
+ // Prepare an expected log with (bool checkTopic1, bool checkTopic2, bool checkTopic3, bool checkData).
76
+ // Call this function, then emit an event, then call a function. Internally after the call, we check if
77
+ // logs were emitted in the expected order with the expected topics and data (as specified by the booleans)
78
+ function expectEmit(bool,bool,bool,bool) external;
79
+ function expectEmit(bool,bool,bool,bool,address) external;
80
+ // Mocks a call to an address, returning specified data.
81
+ // Calldata can either be strict or a partial match, e.g. if you only
82
+ // pass a Solidity selector to the expected calldata, then the entire Solidity
83
+ // function will be mocked.
84
+ function mockCall(address,bytes calldata,bytes calldata) external;
85
+ // Mocks a call to an address with a specific msg.value, returning specified data.
86
+ // Calldata match takes precedence over msg.value in case of ambiguity.
87
+ function mockCall(address,uint256,bytes calldata,bytes calldata) external;
88
+ // Clears all mocked calls
89
+ function clearMockedCalls() external;
90
+ // Expects a call to an address with the specified calldata.
91
+ // Calldata can either be a strict or a partial match
92
+ function expectCall(address,bytes calldata) external;
93
+ // Expects a call to an address with the specified msg.value and calldata
94
+ function expectCall(address,uint256,bytes calldata) external;
95
+ // Gets the code from an artifact file. Takes in the relative path to the json file
96
+ function getCode(string calldata) external returns (bytes memory);
97
+ // Labels an address in call traces
98
+ function label(address, string calldata) external;
99
+ // If the condition is false, discard this run's fuzz inputs and generate new ones
100
+ function assume(bool) external;
101
+ // Sets block.coinbase (who)
102
+ function coinbase(address) external;
103
+ // Using the address that calls the test contract, has the next call (at this call depth only) create a transaction that can later be signed and sent onchain
104
+ function broadcast() external;
105
+ // Has the next call (at this call depth only) create a transaction with the address provided as the sender that can later be signed and sent onchain
106
+ function broadcast(address) external;
107
+ // Using the address that calls the test contract, has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain
108
+ function startBroadcast() external;
109
+ // Has all subsequent calls (at this call depth only) create transactions that can later be signed and sent onchain
110
+ function startBroadcast(address) external;
111
+ // Stops collecting onchain transactions
112
+ function stopBroadcast() external;
113
+
114
+ // Reads the entire content of file to string, (path) => (data)
115
+ function readFile(string calldata) external returns (string memory);
116
+ // Get the path of the current project root
117
+ function projectRoot() external returns (string memory);
118
+ // Reads next line of file to string, (path) => (line)
119
+ function readLine(string calldata) external returns (string memory);
120
+ // Writes data to file, creating a file if it does not exist, and entirely replacing its contents if it does.
121
+ // (path, data) => ()
122
+ function writeFile(string calldata, string calldata) external;
123
+ // Writes line to file, creating a file if it does not exist.
124
+ // (path, data) => ()
125
+ function writeLine(string calldata, string calldata) external;
126
+ // Closes file for reading, resetting the offset and allowing to read it from beginning with readLine.
127
+ // (path) => ()
128
+ function closeFile(string calldata) external;
129
+ // Removes file. This cheatcode will revert in the following situations, but is not limited to just these cases:
130
+ // - Path points to a directory.
131
+ // - The file doesn't exist.
132
+ // - The user lacks permissions to remove the file.
133
+ // (path) => ()
134
+ function removeFile(string calldata) external;
135
+
136
+ // Convert values to a string, (value) => (stringified value)
137
+ function toString(address) external returns(string memory);
138
+ function toString(bytes calldata) external returns(string memory);
139
+ function toString(bytes32) external returns(string memory);
140
+ function toString(bool) external returns(string memory);
141
+ function toString(uint256) external returns(string memory);
142
+ function toString(int256) external returns(string memory);
143
+
144
+ // Convert values from a string, (string) => (parsed value)
145
+ function parseBytes(string calldata) external returns (bytes memory);
146
+ function parseAddress(string calldata) external returns (address);
147
+ function parseUint(string calldata) external returns (uint256);
148
+ function parseInt(string calldata) external returns (int256);
149
+ function parseBytes32(string calldata) external returns (bytes32);
150
+ function parseBool(string calldata) external returns (bool);
151
+
152
+ // Record all the transaction logs
153
+ function recordLogs() external;
154
+ // Gets all the recorded logs, () => (logs)
155
+ function getRecordedLogs() external returns (Log[] memory);
156
+ // Snapshot the current state of the evm.
157
+ // Returns the id of the snapshot that was created.
158
+ // To revert a snapshot use `revertTo`
159
+ function snapshot() external returns(uint256);
160
+ // Revert the state of the evm to a previous snapshot
161
+ // Takes the snapshot id to revert to.
162
+ // This deletes the snapshot and all snapshots taken after the given snapshot id.
163
+ function revertTo(uint256) external returns(bool);
164
+
165
+ // Creates a new fork with the given endpoint and block and returns the identifier of the fork
166
+ function createFork(string calldata,uint256) external returns(uint256);
167
+ // Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork
168
+ function createFork(string calldata) external returns(uint256);
169
+ // Creates _and_ also selects a new fork with the given endpoint and block and returns the identifier of the fork
170
+ function createSelectFork(string calldata,uint256) external returns(uint256);
171
+ // Creates _and_ also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork
172
+ function createSelectFork(string calldata) external returns(uint256);
173
+ // Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
174
+ function selectFork(uint256) external;
175
+ /// Returns the currently active fork
176
+ /// Reverts if no fork is currently active
177
+ function activeFork() external returns(uint256);
178
+ // Updates the currently active fork to given block number
179
+ // This is similar to `roll` but for the currently active fork
180
+ function rollFork(uint256) external;
181
+ // Updates the given fork to given block number
182
+ function rollFork(uint256 forkId, uint256 blockNumber) external;
183
+
184
+ // Marks that the account(s) should use persistent storage across fork swaps in a multifork setup
185
+ // Meaning, changes made to the state of this account will be kept when switching forks
186
+ function makePersistent(address) external;
187
+ function makePersistent(address, address) external;
188
+ function makePersistent(address, address, address) external;
189
+ function makePersistent(address[] calldata) external;
190
+ // Revokes persistent status from the address, previously added via `makePersistent`
191
+ function revokePersistent(address) external;
192
+ function revokePersistent(address[] calldata) external;
193
+ // Returns true if the account is marked as persistent
194
+ function isPersistent(address) external returns (bool);
195
+
196
+ // Returns the RPC url for the given alias
197
+ function rpcUrl(string calldata) external returns(string memory);
198
+ // Returns all rpc urls and their aliases `[alias, url][]`
199
+ function rpcUrls() external returns(string[2][] memory);
200
+
201
+ // Derive a private key from a provided mnenomic string (or mnenomic file path) at the derivation path m/44'/60'/0'/0/{index}
202
+ function deriveKey(string calldata, uint32) external returns (uint256);
203
+ // Derive a private key from a provided mnenomic string (or mnenomic file path) at the derivation path {path}{index}
204
+ function deriveKey(string calldata, string calldata, uint32) external returns (uint256);
205
+ // parseJson
206
+
207
+ // Given a string of JSON, return the ABI-encoded value of provided key
208
+ // (stringified json, key) => (ABI-encoded data)
209
+ // Read the note below!
210
+ function parseJson(string calldata, string calldata) external returns(bytes memory);
211
+
212
+ // Given a string of JSON, return it as ABI-encoded, (stringified json, key) => (ABI-encoded data)
213
+ // Read the note below!
214
+ function parseJson(string calldata) external returns(bytes memory);
215
+
216
+ // Note:
217
+ // ----
218
+ // In case the returned value is a JSON object, it's encoded as a ABI-encoded tuple. As JSON objects
219
+ // don't have the notion of ordered, but tuples do, they JSON object is encoded with it's fields ordered in
220
+ // ALPHABETICAL ordser. That means that in order to succesfully decode the tuple, we need to define a tuple that
221
+ // encodes the fields in the same order, which is alphabetical. In the case of Solidity structs, they are encoded
222
+ // as tuples, with the attributes in the order in which they are defined.
223
+ // For example: json = { 'a': 1, 'b': 0xa4tb......3xs}
224
+ // a: uint256
225
+ // b: address
226
+ // To decode that json, we need to define a struct or a tuple as follows:
227
+ // struct json = { uint256 a; address b; }
228
+ // If we defined a json struct with the opposite order, meaning placing the address b first, it would try to
229
+ // decode the tuple in that order, and thus fail.
230
+
231
+ }