impermax-sdk 1.0.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.
Files changed (103) hide show
  1. package/.idea/impermax-sdk.iml +12 -0
  2. package/.idea/misc.xml +6 -0
  3. package/.idea/modules.xml +8 -0
  4. package/.idea/workspace.xml +642 -0
  5. package/abis/ImpermaxABI.ts +3 -0
  6. package/abis/contracts/BAllowance.json +4735 -0
  7. package/abis/contracts/BDeployer.json +1195 -0
  8. package/abis/contracts/BInterestRateModel.json +10796 -0
  9. package/abis/contracts/BSetter.json +6219 -0
  10. package/abis/contracts/BStorage.json +2613 -0
  11. package/abis/contracts/Borrowable.json +19937 -0
  12. package/abis/contracts/CDeployer.json +1104 -0
  13. package/abis/contracts/CSetter.json +5094 -0
  14. package/abis/contracts/CStorage.json +516 -0
  15. package/abis/contracts/ClaimAggregator.json +2015 -0
  16. package/abis/contracts/Collateral.json +21615 -0
  17. package/abis/contracts/ERC20.json +819 -0
  18. package/abis/contracts/Factory.json +21986 -0
  19. package/abis/contracts/FarmingPool.json +8601 -0
  20. package/abis/contracts/IBDeployer.json +351 -0
  21. package/abis/contracts/IBorrowTracker.json +346 -0
  22. package/abis/contracts/IBorrowable.json +13207 -0
  23. package/abis/contracts/ICDeployer.json +294 -0
  24. package/abis/contracts/IClaimable.json +406 -0
  25. package/abis/contracts/ICollateral.json +8952 -0
  26. package/abis/contracts/IERC20.json +2376 -0
  27. package/abis/contracts/IFactory.json +3660 -0
  28. package/abis/contracts/IFarmingPool.json +3584 -0
  29. package/abis/contracts/IImpermaxCallee.json +679 -0
  30. package/abis/contracts/IMerkleDistributor.json +1134 -0
  31. package/abis/contracts/IPoolToken.json +5343 -0
  32. package/abis/contracts/IRouter01.json +6891 -0
  33. package/abis/contracts/IRouter02.json +7283 -0
  34. package/abis/contracts/ISimpleUniswapOracle.json +1469 -0
  35. package/abis/contracts/IStakedLPToken.json +7309 -0
  36. package/abis/contracts/IStakingRewards.json +1036 -0
  37. package/abis/contracts/IUniswapV2Callee.json +403 -0
  38. package/abis/contracts/IUniswapV2ERC20.json +3155 -0
  39. package/abis/contracts/IUniswapV2Factory.json +1690 -0
  40. package/abis/contracts/IUniswapV2Pair.json +6761 -0
  41. package/abis/contracts/IWETH.json +561 -0
  42. package/abis/contracts/ImpermaxChef.json +20945 -0
  43. package/abis/contracts/ImpermaxERC20.json +12095 -0
  44. package/abis/contracts/Math.json +1966 -0
  45. package/abis/contracts/MockERC20.json +8884 -0
  46. package/abis/contracts/PoolToken.json +10784 -0
  47. package/abis/contracts/Router01.json +43963 -0
  48. package/abis/contracts/SafeMath.json +6828 -0
  49. package/abis/contracts/SimpleUniswapOracle.json +9640 -0
  50. package/abis/contracts/TransferHelper.json +4875 -0
  51. package/abis/contracts/UQ112x112.json +1201 -0
  52. package/abis/contracts/UniswapV2ERC20.json +10969 -0
  53. package/abis/contracts/UniswapV2Factory.json +5521 -0
  54. package/abis/contracts/UniswapV2Library.json +13789 -0
  55. package/abis/contracts/UniswapV2Pair.json +30782 -0
  56. package/abis/contracts/WETH9.json +6613 -0
  57. package/config/amms.ts +199 -0
  58. package/config/contracts/claim-aggregators.ts +16 -0
  59. package/config/contracts/impermax-chef.ts +16 -0
  60. package/config/contracts/imxes.ts +16 -0
  61. package/config/contracts/merkle-distributors.ts +13 -0
  62. package/config/contracts/routers.ts +36 -0
  63. package/config/contracts/simple-uniswap-oracles.ts +33 -0
  64. package/config/contracts/weths.ts +18 -0
  65. package/config/debank-ids.ts +15 -0
  66. package/config/endpoints/merkle-distributors.ts +13 -0
  67. package/config/eth.ts +32 -0
  68. package/config/factories.ts +26 -0
  69. package/config/farms.ts +119 -0
  70. package/config/general.ts +8 -0
  71. package/config/subgraphs.ts +69 -0
  72. package/config/types.ts +81 -0
  73. package/impermax-router/Account.ts +123 -0
  74. package/impermax-router/AccountBorrowable.ts +110 -0
  75. package/impermax-router/AccountCollateral.ts +40 -0
  76. package/impermax-router/AccountLendingPool.ts +231 -0
  77. package/impermax-router/AccountPoolToken.ts +76 -0
  78. package/impermax-router/Borrowable.ts +86 -0
  79. package/impermax-router/Collateral.ts +26 -0
  80. package/impermax-router/ContractsHelper.ts +64 -0
  81. package/impermax-router/ImpermaxFactory.ts +47 -0
  82. package/impermax-router/Interactions.ts +94 -0
  83. package/impermax-router/InteractionsLendingPool.ts +129 -0
  84. package/impermax-router/InteractionsPoolToken.ts +187 -0
  85. package/impermax-router/LendingPool.ts +256 -0
  86. package/impermax-router/PoolToken.ts +112 -0
  87. package/impermax-router/index.ts +49 -0
  88. package/impermax-router/interfaces.ts +233 -0
  89. package/index.ts +5 -0
  90. package/package.json +23 -0
  91. package/subgraph/Account.ts +93 -0
  92. package/subgraph/AccountLendingPool.ts +60 -0
  93. package/subgraph/AccountPoolToken.ts +60 -0
  94. package/subgraph/LendingPool.ts +179 -0
  95. package/subgraph/PoolToken.ts +381 -0
  96. package/subgraph/PriceHelper.ts +150 -0
  97. package/subgraph/SolidexHelper.ts +54 -0
  98. package/subgraph/index.ts +166 -0
  99. package/subgraph/initializer.ts +509 -0
  100. package/subgraph/query.ts +224 -0
  101. package/tsconfig.json +16 -0
  102. package/utils/ether-utils.ts +22 -0
  103. package/utils/index.ts +12 -0
@@ -0,0 +1,403 @@
1
+ {
2
+ "contractName": "IUniswapV2Callee",
3
+ "abi": [
4
+ {
5
+ "constant": false,
6
+ "inputs": [
7
+ {
8
+ "internalType": "address",
9
+ "name": "sender",
10
+ "type": "address"
11
+ },
12
+ {
13
+ "internalType": "uint256",
14
+ "name": "amount0",
15
+ "type": "uint256"
16
+ },
17
+ {
18
+ "internalType": "uint256",
19
+ "name": "amount1",
20
+ "type": "uint256"
21
+ },
22
+ {
23
+ "internalType": "bytes",
24
+ "name": "data",
25
+ "type": "bytes"
26
+ }
27
+ ],
28
+ "name": "uniswapV2Call",
29
+ "outputs": [],
30
+ "payable": false,
31
+ "stateMutability": "nonpayable",
32
+ "type": "function"
33
+ }
34
+ ],
35
+ "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"uniswapV2Call\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/univ2-core/interfaces/IUniswapV2Callee.sol\":\"IUniswapV2Callee\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/univ2-core/interfaces/IUniswapV2Callee.sol\":{\"keccak256\":\"0xdb17a1fb73e261e736ae8862be2d9a32964fc4b3741f48980f5cdc9d92b99a96\",\"urls\":[\"bzz-raw://468dab23a95d9d9b7d6ce74008d45eef3de2f137ede604e6be6c5e7d0121c5e9\",\"dweb:/ipfs/QmcXwjTfp6tCRgf1KsNQyUAtrqKhiaN6fbaHVGr22eficP\"]}},\"version\":1}",
36
+ "bytecode": "0x",
37
+ "deployedBytecode": "0x",
38
+ "sourceMap": "",
39
+ "deployedSourceMap": "",
40
+ "source": "pragma solidity >=0.5.0;\n\ninterface IUniswapV2Callee {\n function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data) external;\n}\n",
41
+ "sourcePath": "C:\\Users\\simor\\Desktop\\impermax-x-uniswapv2-periphery\\test\\Contracts\\univ2-core\\interfaces\\IUniswapV2Callee.sol",
42
+ "ast": {
43
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/univ2-core/interfaces/IUniswapV2Callee.sol",
44
+ "exportedSymbols": {
45
+ "IUniswapV2Callee": [
46
+ 9169
47
+ ]
48
+ },
49
+ "id": 9170,
50
+ "nodeType": "SourceUnit",
51
+ "nodes": [
52
+ {
53
+ "id": 9157,
54
+ "literals": [
55
+ "solidity",
56
+ ">=",
57
+ "0.5",
58
+ ".0"
59
+ ],
60
+ "nodeType": "PragmaDirective",
61
+ "src": "0:24:41"
62
+ },
63
+ {
64
+ "baseContracts": [],
65
+ "contractDependencies": [],
66
+ "contractKind": "interface",
67
+ "documentation": null,
68
+ "fullyImplemented": false,
69
+ "id": 9169,
70
+ "linearizedBaseContracts": [
71
+ 9169
72
+ ],
73
+ "name": "IUniswapV2Callee",
74
+ "nodeType": "ContractDefinition",
75
+ "nodes": [
76
+ {
77
+ "body": null,
78
+ "documentation": null,
79
+ "id": 9168,
80
+ "implemented": false,
81
+ "kind": "function",
82
+ "modifiers": [],
83
+ "name": "uniswapV2Call",
84
+ "nodeType": "FunctionDefinition",
85
+ "parameters": {
86
+ "id": 9166,
87
+ "nodeType": "ParameterList",
88
+ "parameters": [
89
+ {
90
+ "constant": false,
91
+ "id": 9159,
92
+ "name": "sender",
93
+ "nodeType": "VariableDeclaration",
94
+ "scope": 9168,
95
+ "src": "82:14:41",
96
+ "stateVariable": false,
97
+ "storageLocation": "default",
98
+ "typeDescriptions": {
99
+ "typeIdentifier": "t_address",
100
+ "typeString": "address"
101
+ },
102
+ "typeName": {
103
+ "id": 9158,
104
+ "name": "address",
105
+ "nodeType": "ElementaryTypeName",
106
+ "src": "82:7:41",
107
+ "stateMutability": "nonpayable",
108
+ "typeDescriptions": {
109
+ "typeIdentifier": "t_address",
110
+ "typeString": "address"
111
+ }
112
+ },
113
+ "value": null,
114
+ "visibility": "internal"
115
+ },
116
+ {
117
+ "constant": false,
118
+ "id": 9161,
119
+ "name": "amount0",
120
+ "nodeType": "VariableDeclaration",
121
+ "scope": 9168,
122
+ "src": "98:12:41",
123
+ "stateVariable": false,
124
+ "storageLocation": "default",
125
+ "typeDescriptions": {
126
+ "typeIdentifier": "t_uint256",
127
+ "typeString": "uint256"
128
+ },
129
+ "typeName": {
130
+ "id": 9160,
131
+ "name": "uint",
132
+ "nodeType": "ElementaryTypeName",
133
+ "src": "98:4:41",
134
+ "typeDescriptions": {
135
+ "typeIdentifier": "t_uint256",
136
+ "typeString": "uint256"
137
+ }
138
+ },
139
+ "value": null,
140
+ "visibility": "internal"
141
+ },
142
+ {
143
+ "constant": false,
144
+ "id": 9163,
145
+ "name": "amount1",
146
+ "nodeType": "VariableDeclaration",
147
+ "scope": 9168,
148
+ "src": "112:12:41",
149
+ "stateVariable": false,
150
+ "storageLocation": "default",
151
+ "typeDescriptions": {
152
+ "typeIdentifier": "t_uint256",
153
+ "typeString": "uint256"
154
+ },
155
+ "typeName": {
156
+ "id": 9162,
157
+ "name": "uint",
158
+ "nodeType": "ElementaryTypeName",
159
+ "src": "112:4:41",
160
+ "typeDescriptions": {
161
+ "typeIdentifier": "t_uint256",
162
+ "typeString": "uint256"
163
+ }
164
+ },
165
+ "value": null,
166
+ "visibility": "internal"
167
+ },
168
+ {
169
+ "constant": false,
170
+ "id": 9165,
171
+ "name": "data",
172
+ "nodeType": "VariableDeclaration",
173
+ "scope": 9168,
174
+ "src": "126:19:41",
175
+ "stateVariable": false,
176
+ "storageLocation": "calldata",
177
+ "typeDescriptions": {
178
+ "typeIdentifier": "t_bytes_calldata_ptr",
179
+ "typeString": "bytes"
180
+ },
181
+ "typeName": {
182
+ "id": 9164,
183
+ "name": "bytes",
184
+ "nodeType": "ElementaryTypeName",
185
+ "src": "126:5:41",
186
+ "typeDescriptions": {
187
+ "typeIdentifier": "t_bytes_storage_ptr",
188
+ "typeString": "bytes"
189
+ }
190
+ },
191
+ "value": null,
192
+ "visibility": "internal"
193
+ }
194
+ ],
195
+ "src": "81:65:41"
196
+ },
197
+ "returnParameters": {
198
+ "id": 9167,
199
+ "nodeType": "ParameterList",
200
+ "parameters": [],
201
+ "src": "155:0:41"
202
+ },
203
+ "scope": 9169,
204
+ "src": "59:97:41",
205
+ "stateMutability": "nonpayable",
206
+ "superFunction": null,
207
+ "visibility": "external"
208
+ }
209
+ ],
210
+ "scope": 9170,
211
+ "src": "26:132:41"
212
+ }
213
+ ],
214
+ "src": "0:159:41"
215
+ },
216
+ "legacyAST": {
217
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/univ2-core/interfaces/IUniswapV2Callee.sol",
218
+ "exportedSymbols": {
219
+ "IUniswapV2Callee": [
220
+ 9169
221
+ ]
222
+ },
223
+ "id": 9170,
224
+ "nodeType": "SourceUnit",
225
+ "nodes": [
226
+ {
227
+ "id": 9157,
228
+ "literals": [
229
+ "solidity",
230
+ ">=",
231
+ "0.5",
232
+ ".0"
233
+ ],
234
+ "nodeType": "PragmaDirective",
235
+ "src": "0:24:41"
236
+ },
237
+ {
238
+ "baseContracts": [],
239
+ "contractDependencies": [],
240
+ "contractKind": "interface",
241
+ "documentation": null,
242
+ "fullyImplemented": false,
243
+ "id": 9169,
244
+ "linearizedBaseContracts": [
245
+ 9169
246
+ ],
247
+ "name": "IUniswapV2Callee",
248
+ "nodeType": "ContractDefinition",
249
+ "nodes": [
250
+ {
251
+ "body": null,
252
+ "documentation": null,
253
+ "id": 9168,
254
+ "implemented": false,
255
+ "kind": "function",
256
+ "modifiers": [],
257
+ "name": "uniswapV2Call",
258
+ "nodeType": "FunctionDefinition",
259
+ "parameters": {
260
+ "id": 9166,
261
+ "nodeType": "ParameterList",
262
+ "parameters": [
263
+ {
264
+ "constant": false,
265
+ "id": 9159,
266
+ "name": "sender",
267
+ "nodeType": "VariableDeclaration",
268
+ "scope": 9168,
269
+ "src": "82:14:41",
270
+ "stateVariable": false,
271
+ "storageLocation": "default",
272
+ "typeDescriptions": {
273
+ "typeIdentifier": "t_address",
274
+ "typeString": "address"
275
+ },
276
+ "typeName": {
277
+ "id": 9158,
278
+ "name": "address",
279
+ "nodeType": "ElementaryTypeName",
280
+ "src": "82:7:41",
281
+ "stateMutability": "nonpayable",
282
+ "typeDescriptions": {
283
+ "typeIdentifier": "t_address",
284
+ "typeString": "address"
285
+ }
286
+ },
287
+ "value": null,
288
+ "visibility": "internal"
289
+ },
290
+ {
291
+ "constant": false,
292
+ "id": 9161,
293
+ "name": "amount0",
294
+ "nodeType": "VariableDeclaration",
295
+ "scope": 9168,
296
+ "src": "98:12:41",
297
+ "stateVariable": false,
298
+ "storageLocation": "default",
299
+ "typeDescriptions": {
300
+ "typeIdentifier": "t_uint256",
301
+ "typeString": "uint256"
302
+ },
303
+ "typeName": {
304
+ "id": 9160,
305
+ "name": "uint",
306
+ "nodeType": "ElementaryTypeName",
307
+ "src": "98:4:41",
308
+ "typeDescriptions": {
309
+ "typeIdentifier": "t_uint256",
310
+ "typeString": "uint256"
311
+ }
312
+ },
313
+ "value": null,
314
+ "visibility": "internal"
315
+ },
316
+ {
317
+ "constant": false,
318
+ "id": 9163,
319
+ "name": "amount1",
320
+ "nodeType": "VariableDeclaration",
321
+ "scope": 9168,
322
+ "src": "112:12:41",
323
+ "stateVariable": false,
324
+ "storageLocation": "default",
325
+ "typeDescriptions": {
326
+ "typeIdentifier": "t_uint256",
327
+ "typeString": "uint256"
328
+ },
329
+ "typeName": {
330
+ "id": 9162,
331
+ "name": "uint",
332
+ "nodeType": "ElementaryTypeName",
333
+ "src": "112:4:41",
334
+ "typeDescriptions": {
335
+ "typeIdentifier": "t_uint256",
336
+ "typeString": "uint256"
337
+ }
338
+ },
339
+ "value": null,
340
+ "visibility": "internal"
341
+ },
342
+ {
343
+ "constant": false,
344
+ "id": 9165,
345
+ "name": "data",
346
+ "nodeType": "VariableDeclaration",
347
+ "scope": 9168,
348
+ "src": "126:19:41",
349
+ "stateVariable": false,
350
+ "storageLocation": "calldata",
351
+ "typeDescriptions": {
352
+ "typeIdentifier": "t_bytes_calldata_ptr",
353
+ "typeString": "bytes"
354
+ },
355
+ "typeName": {
356
+ "id": 9164,
357
+ "name": "bytes",
358
+ "nodeType": "ElementaryTypeName",
359
+ "src": "126:5:41",
360
+ "typeDescriptions": {
361
+ "typeIdentifier": "t_bytes_storage_ptr",
362
+ "typeString": "bytes"
363
+ }
364
+ },
365
+ "value": null,
366
+ "visibility": "internal"
367
+ }
368
+ ],
369
+ "src": "81:65:41"
370
+ },
371
+ "returnParameters": {
372
+ "id": 9167,
373
+ "nodeType": "ParameterList",
374
+ "parameters": [],
375
+ "src": "155:0:41"
376
+ },
377
+ "scope": 9169,
378
+ "src": "59:97:41",
379
+ "stateMutability": "nonpayable",
380
+ "superFunction": null,
381
+ "visibility": "external"
382
+ }
383
+ ],
384
+ "scope": 9170,
385
+ "src": "26:132:41"
386
+ }
387
+ ],
388
+ "src": "0:159:41"
389
+ },
390
+ "compiler": {
391
+ "name": "solc",
392
+ "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
393
+ },
394
+ "networks": {},
395
+ "schemaVersion": "3.3.2",
396
+ "updatedAt": "2021-01-07T23:07:24.881Z",
397
+ "devdoc": {
398
+ "methods": {}
399
+ },
400
+ "userdoc": {
401
+ "methods": {}
402
+ }
403
+ }