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,1201 @@
1
+ {
2
+ "contractName": "UQ112x112",
3
+ "abi": [],
4
+ "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/contracts/libraries/UQ112x112.sol\":\"UQ112x112\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/contracts/libraries/UQ112x112.sol\":{\"keccak256\":\"0xf3742fdcf136b11a19982e452b51f69bcf6bff029c4ac19a4a6b04548f39df5d\",\"urls\":[\"bzz-raw://d19aad4698d0e5a8c7103abb0dd9e31f3fce023b691508f4add80c0aff643195\",\"dweb:/ipfs/QmRNwHrEivtFuYq4M5jgQCifPcYuqTKy6yTcmHZq7w4a6f\"]}},\"version\":1}",
5
+ "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208d99443284aba80b9493e3039050d4bd21f61cee47b93ff29dc555212fbe74c464736f6c63430006060033",
6
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208d99443284aba80b9493e3039050d4bd21f61cee47b93ff29dc555212fbe74c464736f6c63430006060033",
7
+ "immutableReferences": {},
8
+ "sourceMap": "279:394:11:-:0;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
9
+ "deployedSourceMap": "279:394:11:-:0;;;;;;12:1:-1;9;2:12",
10
+ "source": "pragma solidity =0.6.6;\n\n// a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format))\n// src: https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/libraries/UQ112x112.sol\n\n// range: [0, 2**112 - 1]\n// resolution: 1 / 2**112\n\nlibrary UQ112x112 {\n uint224 constant Q112 = 2**112;\n\n // encode a uint112 as a UQ112x112\n function encode(uint112 y) internal pure returns (uint224 z) {\n z = uint224(y) * Q112; // never overflows\n }\n\n // divide a UQ112x112 by a uint112, returning a UQ112x112\n function uqdiv(uint224 x, uint112 y) internal pure returns (uint224 z) {\n z = x / uint224(y);\n }\n}\n",
11
+ "sourcePath": "C:/Users/simor/Desktop/impermax-x-uniswapv2-periphery/contracts/libraries/UQ112x112.sol",
12
+ "ast": {
13
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/contracts/libraries/UQ112x112.sol",
14
+ "exportedSymbols": {
15
+ "UQ112x112": [
16
+ 3562
17
+ ]
18
+ },
19
+ "id": 3563,
20
+ "nodeType": "SourceUnit",
21
+ "nodes": [
22
+ {
23
+ "id": 3520,
24
+ "literals": [
25
+ "solidity",
26
+ "=",
27
+ "0.6",
28
+ ".6"
29
+ ],
30
+ "nodeType": "PragmaDirective",
31
+ "src": "0:23:11"
32
+ },
33
+ {
34
+ "abstract": false,
35
+ "baseContracts": [],
36
+ "contractDependencies": [],
37
+ "contractKind": "library",
38
+ "documentation": null,
39
+ "fullyImplemented": true,
40
+ "id": 3562,
41
+ "linearizedBaseContracts": [
42
+ 3562
43
+ ],
44
+ "name": "UQ112x112",
45
+ "nodeType": "ContractDefinition",
46
+ "nodes": [
47
+ {
48
+ "constant": true,
49
+ "id": 3525,
50
+ "mutability": "constant",
51
+ "name": "Q112",
52
+ "nodeType": "VariableDeclaration",
53
+ "overrides": null,
54
+ "scope": 3562,
55
+ "src": "303:30:11",
56
+ "stateVariable": true,
57
+ "storageLocation": "default",
58
+ "typeDescriptions": {
59
+ "typeIdentifier": "t_uint224",
60
+ "typeString": "uint224"
61
+ },
62
+ "typeName": {
63
+ "id": 3521,
64
+ "name": "uint224",
65
+ "nodeType": "ElementaryTypeName",
66
+ "src": "303:7:11",
67
+ "typeDescriptions": {
68
+ "typeIdentifier": "t_uint224",
69
+ "typeString": "uint224"
70
+ }
71
+ },
72
+ "value": {
73
+ "argumentTypes": null,
74
+ "commonType": {
75
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
76
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
77
+ },
78
+ "id": 3524,
79
+ "isConstant": false,
80
+ "isLValue": false,
81
+ "isPure": true,
82
+ "lValueRequested": false,
83
+ "leftExpression": {
84
+ "argumentTypes": null,
85
+ "hexValue": "32",
86
+ "id": 3522,
87
+ "isConstant": false,
88
+ "isLValue": false,
89
+ "isPure": true,
90
+ "kind": "number",
91
+ "lValueRequested": false,
92
+ "nodeType": "Literal",
93
+ "src": "327:1:11",
94
+ "subdenomination": null,
95
+ "typeDescriptions": {
96
+ "typeIdentifier": "t_rational_2_by_1",
97
+ "typeString": "int_const 2"
98
+ },
99
+ "value": "2"
100
+ },
101
+ "nodeType": "BinaryOperation",
102
+ "operator": "**",
103
+ "rightExpression": {
104
+ "argumentTypes": null,
105
+ "hexValue": "313132",
106
+ "id": 3523,
107
+ "isConstant": false,
108
+ "isLValue": false,
109
+ "isPure": true,
110
+ "kind": "number",
111
+ "lValueRequested": false,
112
+ "nodeType": "Literal",
113
+ "src": "330:3:11",
114
+ "subdenomination": null,
115
+ "typeDescriptions": {
116
+ "typeIdentifier": "t_rational_112_by_1",
117
+ "typeString": "int_const 112"
118
+ },
119
+ "value": "112"
120
+ },
121
+ "src": "327:6:11",
122
+ "typeDescriptions": {
123
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
124
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
125
+ }
126
+ },
127
+ "visibility": "internal"
128
+ },
129
+ {
130
+ "body": {
131
+ "id": 3541,
132
+ "nodeType": "Block",
133
+ "src": "440:57:11",
134
+ "statements": [
135
+ {
136
+ "expression": {
137
+ "argumentTypes": null,
138
+ "id": 3539,
139
+ "isConstant": false,
140
+ "isLValue": false,
141
+ "isPure": false,
142
+ "lValueRequested": false,
143
+ "leftHandSide": {
144
+ "argumentTypes": null,
145
+ "id": 3532,
146
+ "name": "z",
147
+ "nodeType": "Identifier",
148
+ "overloadedDeclarations": [],
149
+ "referencedDeclaration": 3530,
150
+ "src": "450:1:11",
151
+ "typeDescriptions": {
152
+ "typeIdentifier": "t_uint224",
153
+ "typeString": "uint224"
154
+ }
155
+ },
156
+ "nodeType": "Assignment",
157
+ "operator": "=",
158
+ "rightHandSide": {
159
+ "argumentTypes": null,
160
+ "commonType": {
161
+ "typeIdentifier": "t_uint224",
162
+ "typeString": "uint224"
163
+ },
164
+ "id": 3538,
165
+ "isConstant": false,
166
+ "isLValue": false,
167
+ "isPure": false,
168
+ "lValueRequested": false,
169
+ "leftExpression": {
170
+ "argumentTypes": null,
171
+ "arguments": [
172
+ {
173
+ "argumentTypes": null,
174
+ "id": 3535,
175
+ "name": "y",
176
+ "nodeType": "Identifier",
177
+ "overloadedDeclarations": [],
178
+ "referencedDeclaration": 3527,
179
+ "src": "462:1:11",
180
+ "typeDescriptions": {
181
+ "typeIdentifier": "t_uint112",
182
+ "typeString": "uint112"
183
+ }
184
+ }
185
+ ],
186
+ "expression": {
187
+ "argumentTypes": [
188
+ {
189
+ "typeIdentifier": "t_uint112",
190
+ "typeString": "uint112"
191
+ }
192
+ ],
193
+ "id": 3534,
194
+ "isConstant": false,
195
+ "isLValue": false,
196
+ "isPure": true,
197
+ "lValueRequested": false,
198
+ "nodeType": "ElementaryTypeNameExpression",
199
+ "src": "454:7:11",
200
+ "typeDescriptions": {
201
+ "typeIdentifier": "t_type$_t_uint224_$",
202
+ "typeString": "type(uint224)"
203
+ },
204
+ "typeName": {
205
+ "id": 3533,
206
+ "name": "uint224",
207
+ "nodeType": "ElementaryTypeName",
208
+ "src": "454:7:11",
209
+ "typeDescriptions": {
210
+ "typeIdentifier": null,
211
+ "typeString": null
212
+ }
213
+ }
214
+ },
215
+ "id": 3536,
216
+ "isConstant": false,
217
+ "isLValue": false,
218
+ "isPure": false,
219
+ "kind": "typeConversion",
220
+ "lValueRequested": false,
221
+ "names": [],
222
+ "nodeType": "FunctionCall",
223
+ "src": "454:10:11",
224
+ "tryCall": false,
225
+ "typeDescriptions": {
226
+ "typeIdentifier": "t_uint224",
227
+ "typeString": "uint224"
228
+ }
229
+ },
230
+ "nodeType": "BinaryOperation",
231
+ "operator": "*",
232
+ "rightExpression": {
233
+ "argumentTypes": null,
234
+ "id": 3537,
235
+ "name": "Q112",
236
+ "nodeType": "Identifier",
237
+ "overloadedDeclarations": [],
238
+ "referencedDeclaration": 3525,
239
+ "src": "467:4:11",
240
+ "typeDescriptions": {
241
+ "typeIdentifier": "t_uint224",
242
+ "typeString": "uint224"
243
+ }
244
+ },
245
+ "src": "454:17:11",
246
+ "typeDescriptions": {
247
+ "typeIdentifier": "t_uint224",
248
+ "typeString": "uint224"
249
+ }
250
+ },
251
+ "src": "450:21:11",
252
+ "typeDescriptions": {
253
+ "typeIdentifier": "t_uint224",
254
+ "typeString": "uint224"
255
+ }
256
+ },
257
+ "id": 3540,
258
+ "nodeType": "ExpressionStatement",
259
+ "src": "450:21:11"
260
+ }
261
+ ]
262
+ },
263
+ "documentation": null,
264
+ "id": 3542,
265
+ "implemented": true,
266
+ "kind": "function",
267
+ "modifiers": [],
268
+ "name": "encode",
269
+ "nodeType": "FunctionDefinition",
270
+ "overrides": null,
271
+ "parameters": {
272
+ "id": 3528,
273
+ "nodeType": "ParameterList",
274
+ "parameters": [
275
+ {
276
+ "constant": false,
277
+ "id": 3527,
278
+ "mutability": "mutable",
279
+ "name": "y",
280
+ "nodeType": "VariableDeclaration",
281
+ "overrides": null,
282
+ "scope": 3542,
283
+ "src": "395:9:11",
284
+ "stateVariable": false,
285
+ "storageLocation": "default",
286
+ "typeDescriptions": {
287
+ "typeIdentifier": "t_uint112",
288
+ "typeString": "uint112"
289
+ },
290
+ "typeName": {
291
+ "id": 3526,
292
+ "name": "uint112",
293
+ "nodeType": "ElementaryTypeName",
294
+ "src": "395:7:11",
295
+ "typeDescriptions": {
296
+ "typeIdentifier": "t_uint112",
297
+ "typeString": "uint112"
298
+ }
299
+ },
300
+ "value": null,
301
+ "visibility": "internal"
302
+ }
303
+ ],
304
+ "src": "394:11:11"
305
+ },
306
+ "returnParameters": {
307
+ "id": 3531,
308
+ "nodeType": "ParameterList",
309
+ "parameters": [
310
+ {
311
+ "constant": false,
312
+ "id": 3530,
313
+ "mutability": "mutable",
314
+ "name": "z",
315
+ "nodeType": "VariableDeclaration",
316
+ "overrides": null,
317
+ "scope": 3542,
318
+ "src": "429:9:11",
319
+ "stateVariable": false,
320
+ "storageLocation": "default",
321
+ "typeDescriptions": {
322
+ "typeIdentifier": "t_uint224",
323
+ "typeString": "uint224"
324
+ },
325
+ "typeName": {
326
+ "id": 3529,
327
+ "name": "uint224",
328
+ "nodeType": "ElementaryTypeName",
329
+ "src": "429:7:11",
330
+ "typeDescriptions": {
331
+ "typeIdentifier": "t_uint224",
332
+ "typeString": "uint224"
333
+ }
334
+ },
335
+ "value": null,
336
+ "visibility": "internal"
337
+ }
338
+ ],
339
+ "src": "428:11:11"
340
+ },
341
+ "scope": 3562,
342
+ "src": "379:118:11",
343
+ "stateMutability": "pure",
344
+ "virtual": false,
345
+ "visibility": "internal"
346
+ },
347
+ {
348
+ "body": {
349
+ "id": 3560,
350
+ "nodeType": "Block",
351
+ "src": "636:35:11",
352
+ "statements": [
353
+ {
354
+ "expression": {
355
+ "argumentTypes": null,
356
+ "id": 3558,
357
+ "isConstant": false,
358
+ "isLValue": false,
359
+ "isPure": false,
360
+ "lValueRequested": false,
361
+ "leftHandSide": {
362
+ "argumentTypes": null,
363
+ "id": 3551,
364
+ "name": "z",
365
+ "nodeType": "Identifier",
366
+ "overloadedDeclarations": [],
367
+ "referencedDeclaration": 3549,
368
+ "src": "646:1:11",
369
+ "typeDescriptions": {
370
+ "typeIdentifier": "t_uint224",
371
+ "typeString": "uint224"
372
+ }
373
+ },
374
+ "nodeType": "Assignment",
375
+ "operator": "=",
376
+ "rightHandSide": {
377
+ "argumentTypes": null,
378
+ "commonType": {
379
+ "typeIdentifier": "t_uint224",
380
+ "typeString": "uint224"
381
+ },
382
+ "id": 3557,
383
+ "isConstant": false,
384
+ "isLValue": false,
385
+ "isPure": false,
386
+ "lValueRequested": false,
387
+ "leftExpression": {
388
+ "argumentTypes": null,
389
+ "id": 3552,
390
+ "name": "x",
391
+ "nodeType": "Identifier",
392
+ "overloadedDeclarations": [],
393
+ "referencedDeclaration": 3544,
394
+ "src": "650:1:11",
395
+ "typeDescriptions": {
396
+ "typeIdentifier": "t_uint224",
397
+ "typeString": "uint224"
398
+ }
399
+ },
400
+ "nodeType": "BinaryOperation",
401
+ "operator": "/",
402
+ "rightExpression": {
403
+ "argumentTypes": null,
404
+ "arguments": [
405
+ {
406
+ "argumentTypes": null,
407
+ "id": 3555,
408
+ "name": "y",
409
+ "nodeType": "Identifier",
410
+ "overloadedDeclarations": [],
411
+ "referencedDeclaration": 3546,
412
+ "src": "662:1:11",
413
+ "typeDescriptions": {
414
+ "typeIdentifier": "t_uint112",
415
+ "typeString": "uint112"
416
+ }
417
+ }
418
+ ],
419
+ "expression": {
420
+ "argumentTypes": [
421
+ {
422
+ "typeIdentifier": "t_uint112",
423
+ "typeString": "uint112"
424
+ }
425
+ ],
426
+ "id": 3554,
427
+ "isConstant": false,
428
+ "isLValue": false,
429
+ "isPure": true,
430
+ "lValueRequested": false,
431
+ "nodeType": "ElementaryTypeNameExpression",
432
+ "src": "654:7:11",
433
+ "typeDescriptions": {
434
+ "typeIdentifier": "t_type$_t_uint224_$",
435
+ "typeString": "type(uint224)"
436
+ },
437
+ "typeName": {
438
+ "id": 3553,
439
+ "name": "uint224",
440
+ "nodeType": "ElementaryTypeName",
441
+ "src": "654:7:11",
442
+ "typeDescriptions": {
443
+ "typeIdentifier": null,
444
+ "typeString": null
445
+ }
446
+ }
447
+ },
448
+ "id": 3556,
449
+ "isConstant": false,
450
+ "isLValue": false,
451
+ "isPure": false,
452
+ "kind": "typeConversion",
453
+ "lValueRequested": false,
454
+ "names": [],
455
+ "nodeType": "FunctionCall",
456
+ "src": "654:10:11",
457
+ "tryCall": false,
458
+ "typeDescriptions": {
459
+ "typeIdentifier": "t_uint224",
460
+ "typeString": "uint224"
461
+ }
462
+ },
463
+ "src": "650:14:11",
464
+ "typeDescriptions": {
465
+ "typeIdentifier": "t_uint224",
466
+ "typeString": "uint224"
467
+ }
468
+ },
469
+ "src": "646:18:11",
470
+ "typeDescriptions": {
471
+ "typeIdentifier": "t_uint224",
472
+ "typeString": "uint224"
473
+ }
474
+ },
475
+ "id": 3559,
476
+ "nodeType": "ExpressionStatement",
477
+ "src": "646:18:11"
478
+ }
479
+ ]
480
+ },
481
+ "documentation": null,
482
+ "id": 3561,
483
+ "implemented": true,
484
+ "kind": "function",
485
+ "modifiers": [],
486
+ "name": "uqdiv",
487
+ "nodeType": "FunctionDefinition",
488
+ "overrides": null,
489
+ "parameters": {
490
+ "id": 3547,
491
+ "nodeType": "ParameterList",
492
+ "parameters": [
493
+ {
494
+ "constant": false,
495
+ "id": 3544,
496
+ "mutability": "mutable",
497
+ "name": "x",
498
+ "nodeType": "VariableDeclaration",
499
+ "overrides": null,
500
+ "scope": 3561,
501
+ "src": "580:9:11",
502
+ "stateVariable": false,
503
+ "storageLocation": "default",
504
+ "typeDescriptions": {
505
+ "typeIdentifier": "t_uint224",
506
+ "typeString": "uint224"
507
+ },
508
+ "typeName": {
509
+ "id": 3543,
510
+ "name": "uint224",
511
+ "nodeType": "ElementaryTypeName",
512
+ "src": "580:7:11",
513
+ "typeDescriptions": {
514
+ "typeIdentifier": "t_uint224",
515
+ "typeString": "uint224"
516
+ }
517
+ },
518
+ "value": null,
519
+ "visibility": "internal"
520
+ },
521
+ {
522
+ "constant": false,
523
+ "id": 3546,
524
+ "mutability": "mutable",
525
+ "name": "y",
526
+ "nodeType": "VariableDeclaration",
527
+ "overrides": null,
528
+ "scope": 3561,
529
+ "src": "591:9:11",
530
+ "stateVariable": false,
531
+ "storageLocation": "default",
532
+ "typeDescriptions": {
533
+ "typeIdentifier": "t_uint112",
534
+ "typeString": "uint112"
535
+ },
536
+ "typeName": {
537
+ "id": 3545,
538
+ "name": "uint112",
539
+ "nodeType": "ElementaryTypeName",
540
+ "src": "591:7:11",
541
+ "typeDescriptions": {
542
+ "typeIdentifier": "t_uint112",
543
+ "typeString": "uint112"
544
+ }
545
+ },
546
+ "value": null,
547
+ "visibility": "internal"
548
+ }
549
+ ],
550
+ "src": "579:22:11"
551
+ },
552
+ "returnParameters": {
553
+ "id": 3550,
554
+ "nodeType": "ParameterList",
555
+ "parameters": [
556
+ {
557
+ "constant": false,
558
+ "id": 3549,
559
+ "mutability": "mutable",
560
+ "name": "z",
561
+ "nodeType": "VariableDeclaration",
562
+ "overrides": null,
563
+ "scope": 3561,
564
+ "src": "625:9:11",
565
+ "stateVariable": false,
566
+ "storageLocation": "default",
567
+ "typeDescriptions": {
568
+ "typeIdentifier": "t_uint224",
569
+ "typeString": "uint224"
570
+ },
571
+ "typeName": {
572
+ "id": 3548,
573
+ "name": "uint224",
574
+ "nodeType": "ElementaryTypeName",
575
+ "src": "625:7:11",
576
+ "typeDescriptions": {
577
+ "typeIdentifier": "t_uint224",
578
+ "typeString": "uint224"
579
+ }
580
+ },
581
+ "value": null,
582
+ "visibility": "internal"
583
+ }
584
+ ],
585
+ "src": "624:11:11"
586
+ },
587
+ "scope": 3562,
588
+ "src": "565:106:11",
589
+ "stateMutability": "pure",
590
+ "virtual": false,
591
+ "visibility": "internal"
592
+ }
593
+ ],
594
+ "scope": 3563,
595
+ "src": "279:394:11"
596
+ }
597
+ ],
598
+ "src": "0:674:11"
599
+ },
600
+ "legacyAST": {
601
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/contracts/libraries/UQ112x112.sol",
602
+ "exportedSymbols": {
603
+ "UQ112x112": [
604
+ 3562
605
+ ]
606
+ },
607
+ "id": 3563,
608
+ "nodeType": "SourceUnit",
609
+ "nodes": [
610
+ {
611
+ "id": 3520,
612
+ "literals": [
613
+ "solidity",
614
+ "=",
615
+ "0.6",
616
+ ".6"
617
+ ],
618
+ "nodeType": "PragmaDirective",
619
+ "src": "0:23:11"
620
+ },
621
+ {
622
+ "abstract": false,
623
+ "baseContracts": [],
624
+ "contractDependencies": [],
625
+ "contractKind": "library",
626
+ "documentation": null,
627
+ "fullyImplemented": true,
628
+ "id": 3562,
629
+ "linearizedBaseContracts": [
630
+ 3562
631
+ ],
632
+ "name": "UQ112x112",
633
+ "nodeType": "ContractDefinition",
634
+ "nodes": [
635
+ {
636
+ "constant": true,
637
+ "id": 3525,
638
+ "mutability": "constant",
639
+ "name": "Q112",
640
+ "nodeType": "VariableDeclaration",
641
+ "overrides": null,
642
+ "scope": 3562,
643
+ "src": "303:30:11",
644
+ "stateVariable": true,
645
+ "storageLocation": "default",
646
+ "typeDescriptions": {
647
+ "typeIdentifier": "t_uint224",
648
+ "typeString": "uint224"
649
+ },
650
+ "typeName": {
651
+ "id": 3521,
652
+ "name": "uint224",
653
+ "nodeType": "ElementaryTypeName",
654
+ "src": "303:7:11",
655
+ "typeDescriptions": {
656
+ "typeIdentifier": "t_uint224",
657
+ "typeString": "uint224"
658
+ }
659
+ },
660
+ "value": {
661
+ "argumentTypes": null,
662
+ "commonType": {
663
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
664
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
665
+ },
666
+ "id": 3524,
667
+ "isConstant": false,
668
+ "isLValue": false,
669
+ "isPure": true,
670
+ "lValueRequested": false,
671
+ "leftExpression": {
672
+ "argumentTypes": null,
673
+ "hexValue": "32",
674
+ "id": 3522,
675
+ "isConstant": false,
676
+ "isLValue": false,
677
+ "isPure": true,
678
+ "kind": "number",
679
+ "lValueRequested": false,
680
+ "nodeType": "Literal",
681
+ "src": "327:1:11",
682
+ "subdenomination": null,
683
+ "typeDescriptions": {
684
+ "typeIdentifier": "t_rational_2_by_1",
685
+ "typeString": "int_const 2"
686
+ },
687
+ "value": "2"
688
+ },
689
+ "nodeType": "BinaryOperation",
690
+ "operator": "**",
691
+ "rightExpression": {
692
+ "argumentTypes": null,
693
+ "hexValue": "313132",
694
+ "id": 3523,
695
+ "isConstant": false,
696
+ "isLValue": false,
697
+ "isPure": true,
698
+ "kind": "number",
699
+ "lValueRequested": false,
700
+ "nodeType": "Literal",
701
+ "src": "330:3:11",
702
+ "subdenomination": null,
703
+ "typeDescriptions": {
704
+ "typeIdentifier": "t_rational_112_by_1",
705
+ "typeString": "int_const 112"
706
+ },
707
+ "value": "112"
708
+ },
709
+ "src": "327:6:11",
710
+ "typeDescriptions": {
711
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
712
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
713
+ }
714
+ },
715
+ "visibility": "internal"
716
+ },
717
+ {
718
+ "body": {
719
+ "id": 3541,
720
+ "nodeType": "Block",
721
+ "src": "440:57:11",
722
+ "statements": [
723
+ {
724
+ "expression": {
725
+ "argumentTypes": null,
726
+ "id": 3539,
727
+ "isConstant": false,
728
+ "isLValue": false,
729
+ "isPure": false,
730
+ "lValueRequested": false,
731
+ "leftHandSide": {
732
+ "argumentTypes": null,
733
+ "id": 3532,
734
+ "name": "z",
735
+ "nodeType": "Identifier",
736
+ "overloadedDeclarations": [],
737
+ "referencedDeclaration": 3530,
738
+ "src": "450:1:11",
739
+ "typeDescriptions": {
740
+ "typeIdentifier": "t_uint224",
741
+ "typeString": "uint224"
742
+ }
743
+ },
744
+ "nodeType": "Assignment",
745
+ "operator": "=",
746
+ "rightHandSide": {
747
+ "argumentTypes": null,
748
+ "commonType": {
749
+ "typeIdentifier": "t_uint224",
750
+ "typeString": "uint224"
751
+ },
752
+ "id": 3538,
753
+ "isConstant": false,
754
+ "isLValue": false,
755
+ "isPure": false,
756
+ "lValueRequested": false,
757
+ "leftExpression": {
758
+ "argumentTypes": null,
759
+ "arguments": [
760
+ {
761
+ "argumentTypes": null,
762
+ "id": 3535,
763
+ "name": "y",
764
+ "nodeType": "Identifier",
765
+ "overloadedDeclarations": [],
766
+ "referencedDeclaration": 3527,
767
+ "src": "462:1:11",
768
+ "typeDescriptions": {
769
+ "typeIdentifier": "t_uint112",
770
+ "typeString": "uint112"
771
+ }
772
+ }
773
+ ],
774
+ "expression": {
775
+ "argumentTypes": [
776
+ {
777
+ "typeIdentifier": "t_uint112",
778
+ "typeString": "uint112"
779
+ }
780
+ ],
781
+ "id": 3534,
782
+ "isConstant": false,
783
+ "isLValue": false,
784
+ "isPure": true,
785
+ "lValueRequested": false,
786
+ "nodeType": "ElementaryTypeNameExpression",
787
+ "src": "454:7:11",
788
+ "typeDescriptions": {
789
+ "typeIdentifier": "t_type$_t_uint224_$",
790
+ "typeString": "type(uint224)"
791
+ },
792
+ "typeName": {
793
+ "id": 3533,
794
+ "name": "uint224",
795
+ "nodeType": "ElementaryTypeName",
796
+ "src": "454:7:11",
797
+ "typeDescriptions": {
798
+ "typeIdentifier": null,
799
+ "typeString": null
800
+ }
801
+ }
802
+ },
803
+ "id": 3536,
804
+ "isConstant": false,
805
+ "isLValue": false,
806
+ "isPure": false,
807
+ "kind": "typeConversion",
808
+ "lValueRequested": false,
809
+ "names": [],
810
+ "nodeType": "FunctionCall",
811
+ "src": "454:10:11",
812
+ "tryCall": false,
813
+ "typeDescriptions": {
814
+ "typeIdentifier": "t_uint224",
815
+ "typeString": "uint224"
816
+ }
817
+ },
818
+ "nodeType": "BinaryOperation",
819
+ "operator": "*",
820
+ "rightExpression": {
821
+ "argumentTypes": null,
822
+ "id": 3537,
823
+ "name": "Q112",
824
+ "nodeType": "Identifier",
825
+ "overloadedDeclarations": [],
826
+ "referencedDeclaration": 3525,
827
+ "src": "467:4:11",
828
+ "typeDescriptions": {
829
+ "typeIdentifier": "t_uint224",
830
+ "typeString": "uint224"
831
+ }
832
+ },
833
+ "src": "454:17:11",
834
+ "typeDescriptions": {
835
+ "typeIdentifier": "t_uint224",
836
+ "typeString": "uint224"
837
+ }
838
+ },
839
+ "src": "450:21:11",
840
+ "typeDescriptions": {
841
+ "typeIdentifier": "t_uint224",
842
+ "typeString": "uint224"
843
+ }
844
+ },
845
+ "id": 3540,
846
+ "nodeType": "ExpressionStatement",
847
+ "src": "450:21:11"
848
+ }
849
+ ]
850
+ },
851
+ "documentation": null,
852
+ "id": 3542,
853
+ "implemented": true,
854
+ "kind": "function",
855
+ "modifiers": [],
856
+ "name": "encode",
857
+ "nodeType": "FunctionDefinition",
858
+ "overrides": null,
859
+ "parameters": {
860
+ "id": 3528,
861
+ "nodeType": "ParameterList",
862
+ "parameters": [
863
+ {
864
+ "constant": false,
865
+ "id": 3527,
866
+ "mutability": "mutable",
867
+ "name": "y",
868
+ "nodeType": "VariableDeclaration",
869
+ "overrides": null,
870
+ "scope": 3542,
871
+ "src": "395:9:11",
872
+ "stateVariable": false,
873
+ "storageLocation": "default",
874
+ "typeDescriptions": {
875
+ "typeIdentifier": "t_uint112",
876
+ "typeString": "uint112"
877
+ },
878
+ "typeName": {
879
+ "id": 3526,
880
+ "name": "uint112",
881
+ "nodeType": "ElementaryTypeName",
882
+ "src": "395:7:11",
883
+ "typeDescriptions": {
884
+ "typeIdentifier": "t_uint112",
885
+ "typeString": "uint112"
886
+ }
887
+ },
888
+ "value": null,
889
+ "visibility": "internal"
890
+ }
891
+ ],
892
+ "src": "394:11:11"
893
+ },
894
+ "returnParameters": {
895
+ "id": 3531,
896
+ "nodeType": "ParameterList",
897
+ "parameters": [
898
+ {
899
+ "constant": false,
900
+ "id": 3530,
901
+ "mutability": "mutable",
902
+ "name": "z",
903
+ "nodeType": "VariableDeclaration",
904
+ "overrides": null,
905
+ "scope": 3542,
906
+ "src": "429:9:11",
907
+ "stateVariable": false,
908
+ "storageLocation": "default",
909
+ "typeDescriptions": {
910
+ "typeIdentifier": "t_uint224",
911
+ "typeString": "uint224"
912
+ },
913
+ "typeName": {
914
+ "id": 3529,
915
+ "name": "uint224",
916
+ "nodeType": "ElementaryTypeName",
917
+ "src": "429:7:11",
918
+ "typeDescriptions": {
919
+ "typeIdentifier": "t_uint224",
920
+ "typeString": "uint224"
921
+ }
922
+ },
923
+ "value": null,
924
+ "visibility": "internal"
925
+ }
926
+ ],
927
+ "src": "428:11:11"
928
+ },
929
+ "scope": 3562,
930
+ "src": "379:118:11",
931
+ "stateMutability": "pure",
932
+ "virtual": false,
933
+ "visibility": "internal"
934
+ },
935
+ {
936
+ "body": {
937
+ "id": 3560,
938
+ "nodeType": "Block",
939
+ "src": "636:35:11",
940
+ "statements": [
941
+ {
942
+ "expression": {
943
+ "argumentTypes": null,
944
+ "id": 3558,
945
+ "isConstant": false,
946
+ "isLValue": false,
947
+ "isPure": false,
948
+ "lValueRequested": false,
949
+ "leftHandSide": {
950
+ "argumentTypes": null,
951
+ "id": 3551,
952
+ "name": "z",
953
+ "nodeType": "Identifier",
954
+ "overloadedDeclarations": [],
955
+ "referencedDeclaration": 3549,
956
+ "src": "646:1:11",
957
+ "typeDescriptions": {
958
+ "typeIdentifier": "t_uint224",
959
+ "typeString": "uint224"
960
+ }
961
+ },
962
+ "nodeType": "Assignment",
963
+ "operator": "=",
964
+ "rightHandSide": {
965
+ "argumentTypes": null,
966
+ "commonType": {
967
+ "typeIdentifier": "t_uint224",
968
+ "typeString": "uint224"
969
+ },
970
+ "id": 3557,
971
+ "isConstant": false,
972
+ "isLValue": false,
973
+ "isPure": false,
974
+ "lValueRequested": false,
975
+ "leftExpression": {
976
+ "argumentTypes": null,
977
+ "id": 3552,
978
+ "name": "x",
979
+ "nodeType": "Identifier",
980
+ "overloadedDeclarations": [],
981
+ "referencedDeclaration": 3544,
982
+ "src": "650:1:11",
983
+ "typeDescriptions": {
984
+ "typeIdentifier": "t_uint224",
985
+ "typeString": "uint224"
986
+ }
987
+ },
988
+ "nodeType": "BinaryOperation",
989
+ "operator": "/",
990
+ "rightExpression": {
991
+ "argumentTypes": null,
992
+ "arguments": [
993
+ {
994
+ "argumentTypes": null,
995
+ "id": 3555,
996
+ "name": "y",
997
+ "nodeType": "Identifier",
998
+ "overloadedDeclarations": [],
999
+ "referencedDeclaration": 3546,
1000
+ "src": "662:1:11",
1001
+ "typeDescriptions": {
1002
+ "typeIdentifier": "t_uint112",
1003
+ "typeString": "uint112"
1004
+ }
1005
+ }
1006
+ ],
1007
+ "expression": {
1008
+ "argumentTypes": [
1009
+ {
1010
+ "typeIdentifier": "t_uint112",
1011
+ "typeString": "uint112"
1012
+ }
1013
+ ],
1014
+ "id": 3554,
1015
+ "isConstant": false,
1016
+ "isLValue": false,
1017
+ "isPure": true,
1018
+ "lValueRequested": false,
1019
+ "nodeType": "ElementaryTypeNameExpression",
1020
+ "src": "654:7:11",
1021
+ "typeDescriptions": {
1022
+ "typeIdentifier": "t_type$_t_uint224_$",
1023
+ "typeString": "type(uint224)"
1024
+ },
1025
+ "typeName": {
1026
+ "id": 3553,
1027
+ "name": "uint224",
1028
+ "nodeType": "ElementaryTypeName",
1029
+ "src": "654:7:11",
1030
+ "typeDescriptions": {
1031
+ "typeIdentifier": null,
1032
+ "typeString": null
1033
+ }
1034
+ }
1035
+ },
1036
+ "id": 3556,
1037
+ "isConstant": false,
1038
+ "isLValue": false,
1039
+ "isPure": false,
1040
+ "kind": "typeConversion",
1041
+ "lValueRequested": false,
1042
+ "names": [],
1043
+ "nodeType": "FunctionCall",
1044
+ "src": "654:10:11",
1045
+ "tryCall": false,
1046
+ "typeDescriptions": {
1047
+ "typeIdentifier": "t_uint224",
1048
+ "typeString": "uint224"
1049
+ }
1050
+ },
1051
+ "src": "650:14:11",
1052
+ "typeDescriptions": {
1053
+ "typeIdentifier": "t_uint224",
1054
+ "typeString": "uint224"
1055
+ }
1056
+ },
1057
+ "src": "646:18:11",
1058
+ "typeDescriptions": {
1059
+ "typeIdentifier": "t_uint224",
1060
+ "typeString": "uint224"
1061
+ }
1062
+ },
1063
+ "id": 3559,
1064
+ "nodeType": "ExpressionStatement",
1065
+ "src": "646:18:11"
1066
+ }
1067
+ ]
1068
+ },
1069
+ "documentation": null,
1070
+ "id": 3561,
1071
+ "implemented": true,
1072
+ "kind": "function",
1073
+ "modifiers": [],
1074
+ "name": "uqdiv",
1075
+ "nodeType": "FunctionDefinition",
1076
+ "overrides": null,
1077
+ "parameters": {
1078
+ "id": 3547,
1079
+ "nodeType": "ParameterList",
1080
+ "parameters": [
1081
+ {
1082
+ "constant": false,
1083
+ "id": 3544,
1084
+ "mutability": "mutable",
1085
+ "name": "x",
1086
+ "nodeType": "VariableDeclaration",
1087
+ "overrides": null,
1088
+ "scope": 3561,
1089
+ "src": "580:9:11",
1090
+ "stateVariable": false,
1091
+ "storageLocation": "default",
1092
+ "typeDescriptions": {
1093
+ "typeIdentifier": "t_uint224",
1094
+ "typeString": "uint224"
1095
+ },
1096
+ "typeName": {
1097
+ "id": 3543,
1098
+ "name": "uint224",
1099
+ "nodeType": "ElementaryTypeName",
1100
+ "src": "580:7:11",
1101
+ "typeDescriptions": {
1102
+ "typeIdentifier": "t_uint224",
1103
+ "typeString": "uint224"
1104
+ }
1105
+ },
1106
+ "value": null,
1107
+ "visibility": "internal"
1108
+ },
1109
+ {
1110
+ "constant": false,
1111
+ "id": 3546,
1112
+ "mutability": "mutable",
1113
+ "name": "y",
1114
+ "nodeType": "VariableDeclaration",
1115
+ "overrides": null,
1116
+ "scope": 3561,
1117
+ "src": "591:9:11",
1118
+ "stateVariable": false,
1119
+ "storageLocation": "default",
1120
+ "typeDescriptions": {
1121
+ "typeIdentifier": "t_uint112",
1122
+ "typeString": "uint112"
1123
+ },
1124
+ "typeName": {
1125
+ "id": 3545,
1126
+ "name": "uint112",
1127
+ "nodeType": "ElementaryTypeName",
1128
+ "src": "591:7:11",
1129
+ "typeDescriptions": {
1130
+ "typeIdentifier": "t_uint112",
1131
+ "typeString": "uint112"
1132
+ }
1133
+ },
1134
+ "value": null,
1135
+ "visibility": "internal"
1136
+ }
1137
+ ],
1138
+ "src": "579:22:11"
1139
+ },
1140
+ "returnParameters": {
1141
+ "id": 3550,
1142
+ "nodeType": "ParameterList",
1143
+ "parameters": [
1144
+ {
1145
+ "constant": false,
1146
+ "id": 3549,
1147
+ "mutability": "mutable",
1148
+ "name": "z",
1149
+ "nodeType": "VariableDeclaration",
1150
+ "overrides": null,
1151
+ "scope": 3561,
1152
+ "src": "625:9:11",
1153
+ "stateVariable": false,
1154
+ "storageLocation": "default",
1155
+ "typeDescriptions": {
1156
+ "typeIdentifier": "t_uint224",
1157
+ "typeString": "uint224"
1158
+ },
1159
+ "typeName": {
1160
+ "id": 3548,
1161
+ "name": "uint224",
1162
+ "nodeType": "ElementaryTypeName",
1163
+ "src": "625:7:11",
1164
+ "typeDescriptions": {
1165
+ "typeIdentifier": "t_uint224",
1166
+ "typeString": "uint224"
1167
+ }
1168
+ },
1169
+ "value": null,
1170
+ "visibility": "internal"
1171
+ }
1172
+ ],
1173
+ "src": "624:11:11"
1174
+ },
1175
+ "scope": 3562,
1176
+ "src": "565:106:11",
1177
+ "stateMutability": "pure",
1178
+ "virtual": false,
1179
+ "visibility": "internal"
1180
+ }
1181
+ ],
1182
+ "scope": 3563,
1183
+ "src": "279:394:11"
1184
+ }
1185
+ ],
1186
+ "src": "0:674:11"
1187
+ },
1188
+ "compiler": {
1189
+ "name": "solc",
1190
+ "version": "0.6.6+commit.6c089d02.Emscripten.clang"
1191
+ },
1192
+ "networks": {},
1193
+ "schemaVersion": "3.3.2",
1194
+ "updatedAt": "2021-01-07T23:09:40.205Z",
1195
+ "devdoc": {
1196
+ "methods": {}
1197
+ },
1198
+ "userdoc": {
1199
+ "methods": {}
1200
+ }
1201
+ }