@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,14 @@
1
+ all:; dapp build
2
+
3
+ test:
4
+ -dapp --use solc:0.4.23 build
5
+ -dapp --use solc:0.4.26 build
6
+ -dapp --use solc:0.5.17 build
7
+ -dapp --use solc:0.6.12 build
8
+ -dapp --use solc:0.7.5 build
9
+
10
+ demo:
11
+ DAPP_SRC=demo dapp --use solc:0.7.5 build
12
+ -hevm dapp-test --verbose 3
13
+
14
+ .PHONY: test demo
@@ -0,0 +1,4 @@
1
+ { solidityPackage, dappsys }: solidityPackage {
2
+ name = "ds-test";
3
+ src = ./src;
4
+ }
@@ -0,0 +1,222 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity >=0.5.0;
3
+
4
+ import "../src/test.sol";
5
+
6
+ contract DemoTest is DSTest {
7
+ function test_this() public pure {
8
+ require(true);
9
+ }
10
+ function test_logs() public {
11
+ emit log("-- log(string)");
12
+ emit log("a string");
13
+
14
+ emit log("-- log_named_uint(string, uint)");
15
+ emit log_named_uint("uint", 512);
16
+
17
+ emit log("-- log_named_int(string, int)");
18
+ emit log_named_int("int", -512);
19
+
20
+ emit log("-- log_named_address(string, address)");
21
+ emit log_named_address("address", address(this));
22
+
23
+ emit log("-- log_named_bytes32(string, bytes32)");
24
+ emit log_named_bytes32("bytes32", "a string");
25
+
26
+ emit log("-- log_named_bytes(string, bytes)");
27
+ emit log_named_bytes("bytes", hex"cafefe");
28
+
29
+ emit log("-- log_named_string(string, string)");
30
+ emit log_named_string("string", "a string");
31
+
32
+ emit log("-- log_named_decimal_uint(string, uint, uint)");
33
+ emit log_named_decimal_uint("decimal uint", 1.0e18, 18);
34
+
35
+ emit log("-- log_named_decimal_int(string, int, uint)");
36
+ emit log_named_decimal_int("decimal int", -1.0e18, 18);
37
+ }
38
+ event log_old_named_uint(bytes32,uint);
39
+ function test_old_logs() public {
40
+ emit log_old_named_uint("key", 500);
41
+ emit log_named_bytes32("bkey", "val");
42
+ }
43
+ function test_trace() public view {
44
+ this.echo("string 1", "string 2");
45
+ }
46
+ function test_multiline() public {
47
+ emit log("a multiline\\nstring");
48
+ emit log("a multiline string");
49
+ emit log_bytes("a string");
50
+ emit log_bytes("a multiline\nstring");
51
+ emit log_bytes("a multiline\\nstring");
52
+ emit logs(hex"0000");
53
+ emit log_named_bytes("0x0000", hex"0000");
54
+ emit logs(hex"ff");
55
+ }
56
+ function echo(string memory s1, string memory s2) public pure
57
+ returns (string memory, string memory)
58
+ {
59
+ return (s1, s2);
60
+ }
61
+
62
+ function prove_this(uint x) public {
63
+ emit log_named_uint("sym x", x);
64
+ assertGt(x + 1, 0);
65
+ }
66
+
67
+ function test_logn() public {
68
+ assembly {
69
+ log0(0x01, 0x02)
70
+ log1(0x01, 0x02, 0x03)
71
+ log2(0x01, 0x02, 0x03, 0x04)
72
+ log3(0x01, 0x02, 0x03, 0x04, 0x05)
73
+ }
74
+ }
75
+
76
+ event MyEvent(uint, uint indexed, uint, uint indexed);
77
+ function test_events() public {
78
+ emit MyEvent(1, 2, 3, 4);
79
+ }
80
+
81
+ function test_asserts() public {
82
+ string memory err = "this test has failed!";
83
+ emit log("## assertTrue(bool)\n");
84
+ assertTrue(false);
85
+ emit log("\n");
86
+ assertTrue(false, err);
87
+
88
+ emit log("\n## assertEq(address,address)\n");
89
+ assertEq(address(this), msg.sender);
90
+ emit log("\n");
91
+ assertEq(address(this), msg.sender, err);
92
+
93
+ emit log("\n## assertEq32(bytes32,bytes32)\n");
94
+ assertEq32("bytes 1", "bytes 2");
95
+ emit log("\n");
96
+ assertEq32("bytes 1", "bytes 2", err);
97
+
98
+ emit log("\n## assertEq(bytes32,bytes32)\n");
99
+ assertEq32("bytes 1", "bytes 2");
100
+ emit log("\n");
101
+ assertEq32("bytes 1", "bytes 2", err);
102
+
103
+ emit log("\n## assertEq(uint,uint)\n");
104
+ assertEq(uint(0), 1);
105
+ emit log("\n");
106
+ assertEq(uint(0), 1, err);
107
+
108
+ emit log("\n## assertEq(int,int)\n");
109
+ assertEq(-1, -2);
110
+ emit log("\n");
111
+ assertEq(-1, -2, err);
112
+
113
+ emit log("\n## assertEqDecimal(int,int,uint)\n");
114
+ assertEqDecimal(-1.0e18, -1.1e18, 18);
115
+ emit log("\n");
116
+ assertEqDecimal(-1.0e18, -1.1e18, 18, err);
117
+
118
+ emit log("\n## assertEqDecimal(uint,uint,uint)\n");
119
+ assertEqDecimal(uint(1.0e18), 1.1e18, 18);
120
+ emit log("\n");
121
+ assertEqDecimal(uint(1.0e18), 1.1e18, 18, err);
122
+
123
+ emit log("\n## assertGt(uint,uint)\n");
124
+ assertGt(uint(0), 0);
125
+ emit log("\n");
126
+ assertGt(uint(0), 0, err);
127
+
128
+ emit log("\n## assertGt(int,int)\n");
129
+ assertGt(-1, -1);
130
+ emit log("\n");
131
+ assertGt(-1, -1, err);
132
+
133
+ emit log("\n## assertGtDecimal(int,int,uint)\n");
134
+ assertGtDecimal(-2.0e18, -1.1e18, 18);
135
+ emit log("\n");
136
+ assertGtDecimal(-2.0e18, -1.1e18, 18, err);
137
+
138
+ emit log("\n## assertGtDecimal(uint,uint,uint)\n");
139
+ assertGtDecimal(uint(1.0e18), 1.1e18, 18);
140
+ emit log("\n");
141
+ assertGtDecimal(uint(1.0e18), 1.1e18, 18, err);
142
+
143
+ emit log("\n## assertGe(uint,uint)\n");
144
+ assertGe(uint(0), 1);
145
+ emit log("\n");
146
+ assertGe(uint(0), 1, err);
147
+
148
+ emit log("\n## assertGe(int,int)\n");
149
+ assertGe(-1, 0);
150
+ emit log("\n");
151
+ assertGe(-1, 0, err);
152
+
153
+ emit log("\n## assertGeDecimal(int,int,uint)\n");
154
+ assertGeDecimal(-2.0e18, -1.1e18, 18);
155
+ emit log("\n");
156
+ assertGeDecimal(-2.0e18, -1.1e18, 18, err);
157
+
158
+ emit log("\n## assertGeDecimal(uint,uint,uint)\n");
159
+ assertGeDecimal(uint(1.0e18), 1.1e18, 18);
160
+ emit log("\n");
161
+ assertGeDecimal(uint(1.0e18), 1.1e18, 18, err);
162
+
163
+ emit log("\n## assertLt(uint,uint)\n");
164
+ assertLt(uint(0), 0);
165
+ emit log("\n");
166
+ assertLt(uint(0), 0, err);
167
+
168
+ emit log("\n## assertLt(int,int)\n");
169
+ assertLt(-1, -1);
170
+ emit log("\n");
171
+ assertLt(-1, -1, err);
172
+
173
+ emit log("\n## assertLtDecimal(int,int,uint)\n");
174
+ assertLtDecimal(-1.0e18, -1.1e18, 18);
175
+ emit log("\n");
176
+ assertLtDecimal(-1.0e18, -1.1e18, 18, err);
177
+
178
+ emit log("\n## assertLtDecimal(uint,uint,uint)\n");
179
+ assertLtDecimal(uint(2.0e18), 1.1e18, 18);
180
+ emit log("\n");
181
+ assertLtDecimal(uint(2.0e18), 1.1e18, 18, err);
182
+
183
+ emit log("\n## assertLe(uint,uint)\n");
184
+ assertLe(uint(1), 0);
185
+ emit log("\n");
186
+ assertLe(uint(1), 0, err);
187
+
188
+ emit log("\n## assertLe(int,int)\n");
189
+ assertLe(0, -1);
190
+ emit log("\n");
191
+ assertLe(0, -1, err);
192
+
193
+ emit log("\n## assertLeDecimal(int,int,uint)\n");
194
+ assertLeDecimal(-1.0e18, -1.1e18, 18);
195
+ emit log("\n");
196
+ assertLeDecimal(-1.0e18, -1.1e18, 18, err);
197
+
198
+ emit log("\n## assertLeDecimal(uint,uint,uint)\n");
199
+ assertLeDecimal(uint(2.0e18), 1.1e18, 18);
200
+ emit log("\n");
201
+ assertLeDecimal(uint(2.0e18), 1.1e18, 18, err);
202
+
203
+ emit log("\n## assertEq(string,string)\n");
204
+ string memory s1 = "string 1";
205
+ string memory s2 = "string 2";
206
+ assertEq(s1, s2);
207
+ emit log("\n");
208
+ assertEq(s1, s2, err);
209
+
210
+ emit log("\n## assertEq0(bytes,bytes)\n");
211
+ assertEq0(hex"abcdef01", hex"abcdef02");
212
+ emit log("\n");
213
+ assertEq0(hex"abcdef01", hex"abcdef02", err);
214
+ }
215
+ }
216
+
217
+ contract DemoTestWithSetUp {
218
+ function setUp() public {
219
+ }
220
+ function test_pass() public pure {
221
+ }
222
+ }