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,2613 @@
1
+ {
2
+ "contractName": "BStorage",
3
+ "abi": [
4
+ {
5
+ "constant": true,
6
+ "inputs": [],
7
+ "name": "accrualTimestamp",
8
+ "outputs": [
9
+ {
10
+ "internalType": "uint32",
11
+ "name": "",
12
+ "type": "uint32"
13
+ }
14
+ ],
15
+ "payable": false,
16
+ "stateMutability": "view",
17
+ "type": "function"
18
+ },
19
+ {
20
+ "constant": true,
21
+ "inputs": [],
22
+ "name": "adjustSpeed",
23
+ "outputs": [
24
+ {
25
+ "internalType": "uint256",
26
+ "name": "",
27
+ "type": "uint256"
28
+ }
29
+ ],
30
+ "payable": false,
31
+ "stateMutability": "view",
32
+ "type": "function"
33
+ },
34
+ {
35
+ "constant": true,
36
+ "inputs": [
37
+ {
38
+ "internalType": "address",
39
+ "name": "",
40
+ "type": "address"
41
+ },
42
+ {
43
+ "internalType": "address",
44
+ "name": "",
45
+ "type": "address"
46
+ }
47
+ ],
48
+ "name": "borrowAllowance",
49
+ "outputs": [
50
+ {
51
+ "internalType": "uint256",
52
+ "name": "",
53
+ "type": "uint256"
54
+ }
55
+ ],
56
+ "payable": false,
57
+ "stateMutability": "view",
58
+ "type": "function"
59
+ },
60
+ {
61
+ "constant": true,
62
+ "inputs": [],
63
+ "name": "borrowIndex",
64
+ "outputs": [
65
+ {
66
+ "internalType": "uint112",
67
+ "name": "",
68
+ "type": "uint112"
69
+ }
70
+ ],
71
+ "payable": false,
72
+ "stateMutability": "view",
73
+ "type": "function"
74
+ },
75
+ {
76
+ "constant": true,
77
+ "inputs": [],
78
+ "name": "borrowRate",
79
+ "outputs": [
80
+ {
81
+ "internalType": "uint48",
82
+ "name": "",
83
+ "type": "uint48"
84
+ }
85
+ ],
86
+ "payable": false,
87
+ "stateMutability": "view",
88
+ "type": "function"
89
+ },
90
+ {
91
+ "constant": true,
92
+ "inputs": [],
93
+ "name": "borrowTracker",
94
+ "outputs": [
95
+ {
96
+ "internalType": "address",
97
+ "name": "",
98
+ "type": "address"
99
+ }
100
+ ],
101
+ "payable": false,
102
+ "stateMutability": "view",
103
+ "type": "function"
104
+ },
105
+ {
106
+ "constant": true,
107
+ "inputs": [],
108
+ "name": "collateral",
109
+ "outputs": [
110
+ {
111
+ "internalType": "address",
112
+ "name": "",
113
+ "type": "address"
114
+ }
115
+ ],
116
+ "payable": false,
117
+ "stateMutability": "view",
118
+ "type": "function"
119
+ },
120
+ {
121
+ "constant": true,
122
+ "inputs": [],
123
+ "name": "exchangeRateLast",
124
+ "outputs": [
125
+ {
126
+ "internalType": "uint256",
127
+ "name": "",
128
+ "type": "uint256"
129
+ }
130
+ ],
131
+ "payable": false,
132
+ "stateMutability": "view",
133
+ "type": "function"
134
+ },
135
+ {
136
+ "constant": true,
137
+ "inputs": [],
138
+ "name": "kinkBorrowRate",
139
+ "outputs": [
140
+ {
141
+ "internalType": "uint48",
142
+ "name": "",
143
+ "type": "uint48"
144
+ }
145
+ ],
146
+ "payable": false,
147
+ "stateMutability": "view",
148
+ "type": "function"
149
+ },
150
+ {
151
+ "constant": true,
152
+ "inputs": [],
153
+ "name": "kinkUtilizationRate",
154
+ "outputs": [
155
+ {
156
+ "internalType": "uint256",
157
+ "name": "",
158
+ "type": "uint256"
159
+ }
160
+ ],
161
+ "payable": false,
162
+ "stateMutability": "view",
163
+ "type": "function"
164
+ },
165
+ {
166
+ "constant": true,
167
+ "inputs": [],
168
+ "name": "rateUpdateTimestamp",
169
+ "outputs": [
170
+ {
171
+ "internalType": "uint32",
172
+ "name": "",
173
+ "type": "uint32"
174
+ }
175
+ ],
176
+ "payable": false,
177
+ "stateMutability": "view",
178
+ "type": "function"
179
+ },
180
+ {
181
+ "constant": true,
182
+ "inputs": [],
183
+ "name": "reserveFactor",
184
+ "outputs": [
185
+ {
186
+ "internalType": "uint256",
187
+ "name": "",
188
+ "type": "uint256"
189
+ }
190
+ ],
191
+ "payable": false,
192
+ "stateMutability": "view",
193
+ "type": "function"
194
+ },
195
+ {
196
+ "constant": true,
197
+ "inputs": [],
198
+ "name": "totalBorrows",
199
+ "outputs": [
200
+ {
201
+ "internalType": "uint112",
202
+ "name": "",
203
+ "type": "uint112"
204
+ }
205
+ ],
206
+ "payable": false,
207
+ "stateMutability": "view",
208
+ "type": "function"
209
+ }
210
+ ],
211
+ "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"accrualTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"adjustSpeed\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"borrowAllowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"borrowIndex\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"\",\"type\":\"uint112\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"borrowRate\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"borrowTracker\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"collateral\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"exchangeRateLast\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"kinkBorrowRate\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"kinkUtilizationRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"rateUpdateTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"reserveFactor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalBorrows\",\"outputs\":[{\"internalType\":\"uint112\",\"name\":\"\",\"type\":\"uint112\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/BStorage.sol\":\"BStorage\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/BStorage.sol\":{\"keccak256\":\"0x3dd747da5b10f85b71ddd313996775044c87003d5877351531f2fe0f286355c9\",\"urls\":[\"bzz-raw://96c21f1c978495c0fb43c6d9b336af80ef6765104e19f85a6cc9b4e76360673a\",\"dweb:/ipfs/QmYjRk4ReG2DyKPmf4wR8cqDXCVSgTNtAs7MjYWhtdQ66K\"]}},\"version\":1}",
212
+ "bytecode": "0x6080604052670de0b6b3a7640000600360006101000a8154816dffffffffffffffffffffffffffff02191690836dffffffffffffffffffffffffffff160217905550640100000000428161004f57fe5b066003601c6101000a81548163ffffffff021916908363ffffffff160217905550635e80a6c0600560066101000a81548165ffffffffffff021916908365ffffffffffff16021790555064010000000042816100a757fe5b066005600c6101000a81548163ffffffff021916908363ffffffff16021790555067016345785d8a00006006556709b6e64a8ec600006007556486bd6db0206008553480156100f557600080fd5b506104dd806101056000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c806391b427451161008c578063be340e3211610066578063be340e32146102c4578063c914b437146102e2578063d8dfeb4514610310578063e12b63061461035a576100cf565b806391b427451461022e578063aa5af0fd1461025c578063b95b92a31461029a576100cf565b80631aebf12f146100d45780632d5231d3146100f25780634322b7141461011057806347bd37181461012e578063559572201461016c5780636bd76d24146101b6575b600080fd5b6100dc610384565b6040518082815260200191505060405180910390f35b6100fa61038a565b6040518082815260200191505060405180910390f35b610118610390565b6040518082815260200191505060405180910390f35b610136610396565b60405180826dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101746103b6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610218600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103dc565b6040518082815260200191505060405180910390f35b610236610401565b604051808265ffffffffffff1665ffffffffffff16815260200191505060405180910390f35b610264610419565b60405180826dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102a2610439565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6102cc61044f565b6040518082815260200191505060405180910390f35b6102ea610455565b604051808265ffffffffffff1665ffffffffffff16815260200191505060405180910390f35b61031861046d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610362610492565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b60075481565b60085481565b60065481565b6003600e9054906101000a90046dffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001602052816000526040600020602052806000526040600020600091509150505481565b600560069054906101000a900465ffffffffffff1681565b600360009054906101000a90046dffffffffffffffffffffffffffff1681565b6003601c9054906101000a900463ffffffff1681565b60045481565b600560009054906101000a900465ffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6005600c9054906101000a900463ffffffff168156fea265627a7a723158207abaae02e0739fcd92ce8e427ae2e5a01cf118dc2a536693a5b5b4f689b50c6064736f6c63430005100032",
213
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806391b427451161008c578063be340e3211610066578063be340e32146102c4578063c914b437146102e2578063d8dfeb4514610310578063e12b63061461035a576100cf565b806391b427451461022e578063aa5af0fd1461025c578063b95b92a31461029a576100cf565b80631aebf12f146100d45780632d5231d3146100f25780634322b7141461011057806347bd37181461012e578063559572201461016c5780636bd76d24146101b6575b600080fd5b6100dc610384565b6040518082815260200191505060405180910390f35b6100fa61038a565b6040518082815260200191505060405180910390f35b610118610390565b6040518082815260200191505060405180910390f35b610136610396565b60405180826dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101746103b6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610218600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103dc565b6040518082815260200191505060405180910390f35b610236610401565b604051808265ffffffffffff1665ffffffffffff16815260200191505060405180910390f35b610264610419565b60405180826dffffffffffffffffffffffffffff166dffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102a2610439565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b6102cc61044f565b6040518082815260200191505060405180910390f35b6102ea610455565b604051808265ffffffffffff1665ffffffffffff16815260200191505060405180910390f35b61031861046d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610362610492565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b60075481565b60085481565b60065481565b6003600e9054906101000a90046dffffffffffffffffffffffffffff1681565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6001602052816000526040600020602052806000526040600020600091509150505481565b600560069054906101000a900465ffffffffffff1681565b600360009054906101000a90046dffffffffffffffffffffffffffff1681565b6003601c9054906101000a900463ffffffff1681565b60045481565b600560009054906101000a900465ffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6005600c9054906101000a900463ffffffff168156fea265627a7a723158207abaae02e0739fcd92ce8e427ae2e5a01cf118dc2a536693a5b5b4f689b50c6064736f6c63430005100032",
214
+ "sourceMap": "28:1120:8:-;;;481:4;452:33;;;;;;;;;;;;;;;;;;;;578:5;560:15;:23;;;;;;520:64;;;;;;;;;;;;;;;;;;;;711:11;680:42;;;;;;;;;;;;;;;;;;;;801:5;783:15;:23;;;;;;740:67;;;;;;;;;;;;;;;;;;;;841:7;813:35;;892:7;858:41;;935:12;909:38;;28:1120;8:9:-1;5:2;;;30:1;27;20:12;5:2;28:1120:8;;;;;;;",
215
+ "deployedSourceMap": "28:1120:8:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;28:1120:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;858:41;;;:::i;:::-;;;;;;;;;;;;;;;;;;;909:38;;;:::i;:::-;;;;;;;;;;;;;;;;;;;813:35;;;:::i;:::-;;;;;;;;;;;;;;;;;;;489:27;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;964:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;83:72;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;83:72:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;680:42;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;452:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;520:64;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;591:28;;;:::i;:::-;;;;;;;;;;;;;;;;;;;652:24;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;52:25;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;740:67;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;858:41;;;;:::o;909:38::-;;;;:::o;813:35::-;;;;:::o;489:27::-;;;;;;;;;;;;;:::o;964:28::-;;;;;;;;;;;;;:::o;83:72::-;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;680:42::-;;;;;;;;;;;;;:::o;452:33::-;;;;;;;;;;;;;:::o;520:64::-;;;;;;;;;;;;;:::o;591:28::-;;;;:::o;652:24::-;;;;;;;;;;;;;:::o;52:25::-;;;;;;;;;;;;;:::o;740:67::-;;;;;;;;;;;;;:::o",
216
+ "source": "pragma solidity =0.5.16;\r\n\r\ncontract BStorage {\r\n\r\n\taddress public collateral;\r\n\r\n\tmapping (address => mapping (address => uint256)) public borrowAllowance; //provo a ridurlo?\r\n\t\r\n\tstruct BorrowSnapshot {\r\n\t\tuint112 principal;\t\t// amount in underlying when the borrow was last updated\r\n\t\tuint112 interestIndex;\t// borrow index when borrow was last updated\r\n\t}\r\n\tmapping(address => BorrowSnapshot) internal borrowBalances;\t\r\n\r\n\t// use one memory slot\r\n\tuint112 public borrowIndex = 1e18;\r\n\tuint112 public totalBorrows;\r\n\tuint32 public accrualTimestamp = uint32(block.timestamp % 2**32);\t\r\n\r\n\tuint public exchangeRateLast;\r\n\t\t\r\n\t// use one memory slot\r\n\tuint48 public borrowRate;\r\n\tuint48 public kinkBorrowRate = 1.5854896e9; //5% per year\r\n\tuint32 public rateUpdateTimestamp = uint32(block.timestamp % 2**32);\r\n\r\n\tuint public reserveFactor = 0.10e18; //10%\r\n\tuint public kinkUtilizationRate = 0.70e18; //70%\r\n\tuint public adjustSpeed = 0.5787037e12; //5% per day\r\n\taddress public borrowTracker;\r\n\r\n function safe112(uint n) internal pure returns (uint112) {\r\n require(n < 2**112, \"Impermax: SAFE112\");\r\n return uint112(n);\r\n }\r\n}",
217
+ "sourcePath": "C:\\Users\\simor\\Desktop\\impermax-x-uniswapv2-periphery\\test\\Contracts\\imx-univ2-core\\BStorage.sol",
218
+ "ast": {
219
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/BStorage.sol",
220
+ "exportedSymbols": {
221
+ "BStorage": [
222
+ 1751
223
+ ]
224
+ },
225
+ "id": 1752,
226
+ "nodeType": "SourceUnit",
227
+ "nodes": [
228
+ {
229
+ "id": 1669,
230
+ "literals": [
231
+ "solidity",
232
+ "=",
233
+ "0.5",
234
+ ".16"
235
+ ],
236
+ "nodeType": "PragmaDirective",
237
+ "src": "0:24:8"
238
+ },
239
+ {
240
+ "baseContracts": [],
241
+ "contractDependencies": [],
242
+ "contractKind": "contract",
243
+ "documentation": null,
244
+ "fullyImplemented": true,
245
+ "id": 1751,
246
+ "linearizedBaseContracts": [
247
+ 1751
248
+ ],
249
+ "name": "BStorage",
250
+ "nodeType": "ContractDefinition",
251
+ "nodes": [
252
+ {
253
+ "constant": false,
254
+ "id": 1671,
255
+ "name": "collateral",
256
+ "nodeType": "VariableDeclaration",
257
+ "scope": 1751,
258
+ "src": "52:25:8",
259
+ "stateVariable": true,
260
+ "storageLocation": "default",
261
+ "typeDescriptions": {
262
+ "typeIdentifier": "t_address",
263
+ "typeString": "address"
264
+ },
265
+ "typeName": {
266
+ "id": 1670,
267
+ "name": "address",
268
+ "nodeType": "ElementaryTypeName",
269
+ "src": "52:7:8",
270
+ "stateMutability": "nonpayable",
271
+ "typeDescriptions": {
272
+ "typeIdentifier": "t_address",
273
+ "typeString": "address"
274
+ }
275
+ },
276
+ "value": null,
277
+ "visibility": "public"
278
+ },
279
+ {
280
+ "constant": false,
281
+ "id": 1677,
282
+ "name": "borrowAllowance",
283
+ "nodeType": "VariableDeclaration",
284
+ "scope": 1751,
285
+ "src": "83:72:8",
286
+ "stateVariable": true,
287
+ "storageLocation": "default",
288
+ "typeDescriptions": {
289
+ "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
290
+ "typeString": "mapping(address => mapping(address => uint256))"
291
+ },
292
+ "typeName": {
293
+ "id": 1676,
294
+ "keyType": {
295
+ "id": 1672,
296
+ "name": "address",
297
+ "nodeType": "ElementaryTypeName",
298
+ "src": "92:7:8",
299
+ "typeDescriptions": {
300
+ "typeIdentifier": "t_address",
301
+ "typeString": "address"
302
+ }
303
+ },
304
+ "nodeType": "Mapping",
305
+ "src": "83:49:8",
306
+ "typeDescriptions": {
307
+ "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
308
+ "typeString": "mapping(address => mapping(address => uint256))"
309
+ },
310
+ "valueType": {
311
+ "id": 1675,
312
+ "keyType": {
313
+ "id": 1673,
314
+ "name": "address",
315
+ "nodeType": "ElementaryTypeName",
316
+ "src": "112:7:8",
317
+ "typeDescriptions": {
318
+ "typeIdentifier": "t_address",
319
+ "typeString": "address"
320
+ }
321
+ },
322
+ "nodeType": "Mapping",
323
+ "src": "103:28:8",
324
+ "typeDescriptions": {
325
+ "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
326
+ "typeString": "mapping(address => uint256)"
327
+ },
328
+ "valueType": {
329
+ "id": 1674,
330
+ "name": "uint256",
331
+ "nodeType": "ElementaryTypeName",
332
+ "src": "123:7:8",
333
+ "typeDescriptions": {
334
+ "typeIdentifier": "t_uint256",
335
+ "typeString": "uint256"
336
+ }
337
+ }
338
+ }
339
+ },
340
+ "value": null,
341
+ "visibility": "public"
342
+ },
343
+ {
344
+ "canonicalName": "BStorage.BorrowSnapshot",
345
+ "id": 1682,
346
+ "members": [
347
+ {
348
+ "constant": false,
349
+ "id": 1679,
350
+ "name": "principal",
351
+ "nodeType": "VariableDeclaration",
352
+ "scope": 1682,
353
+ "src": "208:17:8",
354
+ "stateVariable": false,
355
+ "storageLocation": "default",
356
+ "typeDescriptions": {
357
+ "typeIdentifier": "t_uint112",
358
+ "typeString": "uint112"
359
+ },
360
+ "typeName": {
361
+ "id": 1678,
362
+ "name": "uint112",
363
+ "nodeType": "ElementaryTypeName",
364
+ "src": "208:7:8",
365
+ "typeDescriptions": {
366
+ "typeIdentifier": "t_uint112",
367
+ "typeString": "uint112"
368
+ }
369
+ },
370
+ "value": null,
371
+ "visibility": "internal"
372
+ },
373
+ {
374
+ "constant": false,
375
+ "id": 1681,
376
+ "name": "interestIndex",
377
+ "nodeType": "VariableDeclaration",
378
+ "scope": 1682,
379
+ "src": "288:21:8",
380
+ "stateVariable": false,
381
+ "storageLocation": "default",
382
+ "typeDescriptions": {
383
+ "typeIdentifier": "t_uint112",
384
+ "typeString": "uint112"
385
+ },
386
+ "typeName": {
387
+ "id": 1680,
388
+ "name": "uint112",
389
+ "nodeType": "ElementaryTypeName",
390
+ "src": "288:7:8",
391
+ "typeDescriptions": {
392
+ "typeIdentifier": "t_uint112",
393
+ "typeString": "uint112"
394
+ }
395
+ },
396
+ "value": null,
397
+ "visibility": "internal"
398
+ }
399
+ ],
400
+ "name": "BorrowSnapshot",
401
+ "nodeType": "StructDefinition",
402
+ "scope": 1751,
403
+ "src": "181:178:8",
404
+ "visibility": "public"
405
+ },
406
+ {
407
+ "constant": false,
408
+ "id": 1686,
409
+ "name": "borrowBalances",
410
+ "nodeType": "VariableDeclaration",
411
+ "scope": 1751,
412
+ "src": "362:58:8",
413
+ "stateVariable": true,
414
+ "storageLocation": "default",
415
+ "typeDescriptions": {
416
+ "typeIdentifier": "t_mapping$_t_address_$_t_struct$_BorrowSnapshot_$1682_storage_$",
417
+ "typeString": "mapping(address => struct BStorage.BorrowSnapshot)"
418
+ },
419
+ "typeName": {
420
+ "id": 1685,
421
+ "keyType": {
422
+ "id": 1683,
423
+ "name": "address",
424
+ "nodeType": "ElementaryTypeName",
425
+ "src": "370:7:8",
426
+ "typeDescriptions": {
427
+ "typeIdentifier": "t_address",
428
+ "typeString": "address"
429
+ }
430
+ },
431
+ "nodeType": "Mapping",
432
+ "src": "362:34:8",
433
+ "typeDescriptions": {
434
+ "typeIdentifier": "t_mapping$_t_address_$_t_struct$_BorrowSnapshot_$1682_storage_$",
435
+ "typeString": "mapping(address => struct BStorage.BorrowSnapshot)"
436
+ },
437
+ "valueType": {
438
+ "contractScope": null,
439
+ "id": 1684,
440
+ "name": "BorrowSnapshot",
441
+ "nodeType": "UserDefinedTypeName",
442
+ "referencedDeclaration": 1682,
443
+ "src": "381:14:8",
444
+ "typeDescriptions": {
445
+ "typeIdentifier": "t_struct$_BorrowSnapshot_$1682_storage_ptr",
446
+ "typeString": "struct BStorage.BorrowSnapshot"
447
+ }
448
+ }
449
+ },
450
+ "value": null,
451
+ "visibility": "internal"
452
+ },
453
+ {
454
+ "constant": false,
455
+ "id": 1689,
456
+ "name": "borrowIndex",
457
+ "nodeType": "VariableDeclaration",
458
+ "scope": 1751,
459
+ "src": "452:33:8",
460
+ "stateVariable": true,
461
+ "storageLocation": "default",
462
+ "typeDescriptions": {
463
+ "typeIdentifier": "t_uint112",
464
+ "typeString": "uint112"
465
+ },
466
+ "typeName": {
467
+ "id": 1687,
468
+ "name": "uint112",
469
+ "nodeType": "ElementaryTypeName",
470
+ "src": "452:7:8",
471
+ "typeDescriptions": {
472
+ "typeIdentifier": "t_uint112",
473
+ "typeString": "uint112"
474
+ }
475
+ },
476
+ "value": {
477
+ "argumentTypes": null,
478
+ "hexValue": "31653138",
479
+ "id": 1688,
480
+ "isConstant": false,
481
+ "isLValue": false,
482
+ "isPure": true,
483
+ "kind": "number",
484
+ "lValueRequested": false,
485
+ "nodeType": "Literal",
486
+ "src": "481:4:8",
487
+ "subdenomination": null,
488
+ "typeDescriptions": {
489
+ "typeIdentifier": "t_rational_1000000000000000000_by_1",
490
+ "typeString": "int_const 1000000000000000000"
491
+ },
492
+ "value": "1e18"
493
+ },
494
+ "visibility": "public"
495
+ },
496
+ {
497
+ "constant": false,
498
+ "id": 1691,
499
+ "name": "totalBorrows",
500
+ "nodeType": "VariableDeclaration",
501
+ "scope": 1751,
502
+ "src": "489:27:8",
503
+ "stateVariable": true,
504
+ "storageLocation": "default",
505
+ "typeDescriptions": {
506
+ "typeIdentifier": "t_uint112",
507
+ "typeString": "uint112"
508
+ },
509
+ "typeName": {
510
+ "id": 1690,
511
+ "name": "uint112",
512
+ "nodeType": "ElementaryTypeName",
513
+ "src": "489:7:8",
514
+ "typeDescriptions": {
515
+ "typeIdentifier": "t_uint112",
516
+ "typeString": "uint112"
517
+ }
518
+ },
519
+ "value": null,
520
+ "visibility": "public"
521
+ },
522
+ {
523
+ "constant": false,
524
+ "id": 1701,
525
+ "name": "accrualTimestamp",
526
+ "nodeType": "VariableDeclaration",
527
+ "scope": 1751,
528
+ "src": "520:64:8",
529
+ "stateVariable": true,
530
+ "storageLocation": "default",
531
+ "typeDescriptions": {
532
+ "typeIdentifier": "t_uint32",
533
+ "typeString": "uint32"
534
+ },
535
+ "typeName": {
536
+ "id": 1692,
537
+ "name": "uint32",
538
+ "nodeType": "ElementaryTypeName",
539
+ "src": "520:6:8",
540
+ "typeDescriptions": {
541
+ "typeIdentifier": "t_uint32",
542
+ "typeString": "uint32"
543
+ }
544
+ },
545
+ "value": {
546
+ "argumentTypes": null,
547
+ "arguments": [
548
+ {
549
+ "argumentTypes": null,
550
+ "commonType": {
551
+ "typeIdentifier": "t_uint256",
552
+ "typeString": "uint256"
553
+ },
554
+ "id": 1699,
555
+ "isConstant": false,
556
+ "isLValue": false,
557
+ "isPure": false,
558
+ "lValueRequested": false,
559
+ "leftExpression": {
560
+ "argumentTypes": null,
561
+ "expression": {
562
+ "argumentTypes": null,
563
+ "id": 1694,
564
+ "name": "block",
565
+ "nodeType": "Identifier",
566
+ "overloadedDeclarations": [],
567
+ "referencedDeclaration": 9808,
568
+ "src": "560:5:8",
569
+ "typeDescriptions": {
570
+ "typeIdentifier": "t_magic_block",
571
+ "typeString": "block"
572
+ }
573
+ },
574
+ "id": 1695,
575
+ "isConstant": false,
576
+ "isLValue": false,
577
+ "isPure": false,
578
+ "lValueRequested": false,
579
+ "memberName": "timestamp",
580
+ "nodeType": "MemberAccess",
581
+ "referencedDeclaration": null,
582
+ "src": "560:15:8",
583
+ "typeDescriptions": {
584
+ "typeIdentifier": "t_uint256",
585
+ "typeString": "uint256"
586
+ }
587
+ },
588
+ "nodeType": "BinaryOperation",
589
+ "operator": "%",
590
+ "rightExpression": {
591
+ "argumentTypes": null,
592
+ "commonType": {
593
+ "typeIdentifier": "t_rational_4294967296_by_1",
594
+ "typeString": "int_const 4294967296"
595
+ },
596
+ "id": 1698,
597
+ "isConstant": false,
598
+ "isLValue": false,
599
+ "isPure": true,
600
+ "lValueRequested": false,
601
+ "leftExpression": {
602
+ "argumentTypes": null,
603
+ "hexValue": "32",
604
+ "id": 1696,
605
+ "isConstant": false,
606
+ "isLValue": false,
607
+ "isPure": true,
608
+ "kind": "number",
609
+ "lValueRequested": false,
610
+ "nodeType": "Literal",
611
+ "src": "578:1:8",
612
+ "subdenomination": null,
613
+ "typeDescriptions": {
614
+ "typeIdentifier": "t_rational_2_by_1",
615
+ "typeString": "int_const 2"
616
+ },
617
+ "value": "2"
618
+ },
619
+ "nodeType": "BinaryOperation",
620
+ "operator": "**",
621
+ "rightExpression": {
622
+ "argumentTypes": null,
623
+ "hexValue": "3332",
624
+ "id": 1697,
625
+ "isConstant": false,
626
+ "isLValue": false,
627
+ "isPure": true,
628
+ "kind": "number",
629
+ "lValueRequested": false,
630
+ "nodeType": "Literal",
631
+ "src": "581:2:8",
632
+ "subdenomination": null,
633
+ "typeDescriptions": {
634
+ "typeIdentifier": "t_rational_32_by_1",
635
+ "typeString": "int_const 32"
636
+ },
637
+ "value": "32"
638
+ },
639
+ "src": "578:5:8",
640
+ "typeDescriptions": {
641
+ "typeIdentifier": "t_rational_4294967296_by_1",
642
+ "typeString": "int_const 4294967296"
643
+ }
644
+ },
645
+ "src": "560:23:8",
646
+ "typeDescriptions": {
647
+ "typeIdentifier": "t_uint256",
648
+ "typeString": "uint256"
649
+ }
650
+ }
651
+ ],
652
+ "expression": {
653
+ "argumentTypes": [
654
+ {
655
+ "typeIdentifier": "t_uint256",
656
+ "typeString": "uint256"
657
+ }
658
+ ],
659
+ "id": 1693,
660
+ "isConstant": false,
661
+ "isLValue": false,
662
+ "isPure": true,
663
+ "lValueRequested": false,
664
+ "nodeType": "ElementaryTypeNameExpression",
665
+ "src": "553:6:8",
666
+ "typeDescriptions": {
667
+ "typeIdentifier": "t_type$_t_uint32_$",
668
+ "typeString": "type(uint32)"
669
+ },
670
+ "typeName": "uint32"
671
+ },
672
+ "id": 1700,
673
+ "isConstant": false,
674
+ "isLValue": false,
675
+ "isPure": false,
676
+ "kind": "typeConversion",
677
+ "lValueRequested": false,
678
+ "names": [],
679
+ "nodeType": "FunctionCall",
680
+ "src": "553:31:8",
681
+ "typeDescriptions": {
682
+ "typeIdentifier": "t_uint32",
683
+ "typeString": "uint32"
684
+ }
685
+ },
686
+ "visibility": "public"
687
+ },
688
+ {
689
+ "constant": false,
690
+ "id": 1703,
691
+ "name": "exchangeRateLast",
692
+ "nodeType": "VariableDeclaration",
693
+ "scope": 1751,
694
+ "src": "591:28:8",
695
+ "stateVariable": true,
696
+ "storageLocation": "default",
697
+ "typeDescriptions": {
698
+ "typeIdentifier": "t_uint256",
699
+ "typeString": "uint256"
700
+ },
701
+ "typeName": {
702
+ "id": 1702,
703
+ "name": "uint",
704
+ "nodeType": "ElementaryTypeName",
705
+ "src": "591:4:8",
706
+ "typeDescriptions": {
707
+ "typeIdentifier": "t_uint256",
708
+ "typeString": "uint256"
709
+ }
710
+ },
711
+ "value": null,
712
+ "visibility": "public"
713
+ },
714
+ {
715
+ "constant": false,
716
+ "id": 1705,
717
+ "name": "borrowRate",
718
+ "nodeType": "VariableDeclaration",
719
+ "scope": 1751,
720
+ "src": "652:24:8",
721
+ "stateVariable": true,
722
+ "storageLocation": "default",
723
+ "typeDescriptions": {
724
+ "typeIdentifier": "t_uint48",
725
+ "typeString": "uint48"
726
+ },
727
+ "typeName": {
728
+ "id": 1704,
729
+ "name": "uint48",
730
+ "nodeType": "ElementaryTypeName",
731
+ "src": "652:6:8",
732
+ "typeDescriptions": {
733
+ "typeIdentifier": "t_uint48",
734
+ "typeString": "uint48"
735
+ }
736
+ },
737
+ "value": null,
738
+ "visibility": "public"
739
+ },
740
+ {
741
+ "constant": false,
742
+ "id": 1708,
743
+ "name": "kinkBorrowRate",
744
+ "nodeType": "VariableDeclaration",
745
+ "scope": 1751,
746
+ "src": "680:42:8",
747
+ "stateVariable": true,
748
+ "storageLocation": "default",
749
+ "typeDescriptions": {
750
+ "typeIdentifier": "t_uint48",
751
+ "typeString": "uint48"
752
+ },
753
+ "typeName": {
754
+ "id": 1706,
755
+ "name": "uint48",
756
+ "nodeType": "ElementaryTypeName",
757
+ "src": "680:6:8",
758
+ "typeDescriptions": {
759
+ "typeIdentifier": "t_uint48",
760
+ "typeString": "uint48"
761
+ }
762
+ },
763
+ "value": {
764
+ "argumentTypes": null,
765
+ "hexValue": "312e353835343839366539",
766
+ "id": 1707,
767
+ "isConstant": false,
768
+ "isLValue": false,
769
+ "isPure": true,
770
+ "kind": "number",
771
+ "lValueRequested": false,
772
+ "nodeType": "Literal",
773
+ "src": "711:11:8",
774
+ "subdenomination": null,
775
+ "typeDescriptions": {
776
+ "typeIdentifier": "t_rational_1585489600_by_1",
777
+ "typeString": "int_const 1585489600"
778
+ },
779
+ "value": "1.5854896e9"
780
+ },
781
+ "visibility": "public"
782
+ },
783
+ {
784
+ "constant": false,
785
+ "id": 1718,
786
+ "name": "rateUpdateTimestamp",
787
+ "nodeType": "VariableDeclaration",
788
+ "scope": 1751,
789
+ "src": "740:67:8",
790
+ "stateVariable": true,
791
+ "storageLocation": "default",
792
+ "typeDescriptions": {
793
+ "typeIdentifier": "t_uint32",
794
+ "typeString": "uint32"
795
+ },
796
+ "typeName": {
797
+ "id": 1709,
798
+ "name": "uint32",
799
+ "nodeType": "ElementaryTypeName",
800
+ "src": "740:6:8",
801
+ "typeDescriptions": {
802
+ "typeIdentifier": "t_uint32",
803
+ "typeString": "uint32"
804
+ }
805
+ },
806
+ "value": {
807
+ "argumentTypes": null,
808
+ "arguments": [
809
+ {
810
+ "argumentTypes": null,
811
+ "commonType": {
812
+ "typeIdentifier": "t_uint256",
813
+ "typeString": "uint256"
814
+ },
815
+ "id": 1716,
816
+ "isConstant": false,
817
+ "isLValue": false,
818
+ "isPure": false,
819
+ "lValueRequested": false,
820
+ "leftExpression": {
821
+ "argumentTypes": null,
822
+ "expression": {
823
+ "argumentTypes": null,
824
+ "id": 1711,
825
+ "name": "block",
826
+ "nodeType": "Identifier",
827
+ "overloadedDeclarations": [],
828
+ "referencedDeclaration": 9808,
829
+ "src": "783:5:8",
830
+ "typeDescriptions": {
831
+ "typeIdentifier": "t_magic_block",
832
+ "typeString": "block"
833
+ }
834
+ },
835
+ "id": 1712,
836
+ "isConstant": false,
837
+ "isLValue": false,
838
+ "isPure": false,
839
+ "lValueRequested": false,
840
+ "memberName": "timestamp",
841
+ "nodeType": "MemberAccess",
842
+ "referencedDeclaration": null,
843
+ "src": "783:15:8",
844
+ "typeDescriptions": {
845
+ "typeIdentifier": "t_uint256",
846
+ "typeString": "uint256"
847
+ }
848
+ },
849
+ "nodeType": "BinaryOperation",
850
+ "operator": "%",
851
+ "rightExpression": {
852
+ "argumentTypes": null,
853
+ "commonType": {
854
+ "typeIdentifier": "t_rational_4294967296_by_1",
855
+ "typeString": "int_const 4294967296"
856
+ },
857
+ "id": 1715,
858
+ "isConstant": false,
859
+ "isLValue": false,
860
+ "isPure": true,
861
+ "lValueRequested": false,
862
+ "leftExpression": {
863
+ "argumentTypes": null,
864
+ "hexValue": "32",
865
+ "id": 1713,
866
+ "isConstant": false,
867
+ "isLValue": false,
868
+ "isPure": true,
869
+ "kind": "number",
870
+ "lValueRequested": false,
871
+ "nodeType": "Literal",
872
+ "src": "801:1:8",
873
+ "subdenomination": null,
874
+ "typeDescriptions": {
875
+ "typeIdentifier": "t_rational_2_by_1",
876
+ "typeString": "int_const 2"
877
+ },
878
+ "value": "2"
879
+ },
880
+ "nodeType": "BinaryOperation",
881
+ "operator": "**",
882
+ "rightExpression": {
883
+ "argumentTypes": null,
884
+ "hexValue": "3332",
885
+ "id": 1714,
886
+ "isConstant": false,
887
+ "isLValue": false,
888
+ "isPure": true,
889
+ "kind": "number",
890
+ "lValueRequested": false,
891
+ "nodeType": "Literal",
892
+ "src": "804:2:8",
893
+ "subdenomination": null,
894
+ "typeDescriptions": {
895
+ "typeIdentifier": "t_rational_32_by_1",
896
+ "typeString": "int_const 32"
897
+ },
898
+ "value": "32"
899
+ },
900
+ "src": "801:5:8",
901
+ "typeDescriptions": {
902
+ "typeIdentifier": "t_rational_4294967296_by_1",
903
+ "typeString": "int_const 4294967296"
904
+ }
905
+ },
906
+ "src": "783:23:8",
907
+ "typeDescriptions": {
908
+ "typeIdentifier": "t_uint256",
909
+ "typeString": "uint256"
910
+ }
911
+ }
912
+ ],
913
+ "expression": {
914
+ "argumentTypes": [
915
+ {
916
+ "typeIdentifier": "t_uint256",
917
+ "typeString": "uint256"
918
+ }
919
+ ],
920
+ "id": 1710,
921
+ "isConstant": false,
922
+ "isLValue": false,
923
+ "isPure": true,
924
+ "lValueRequested": false,
925
+ "nodeType": "ElementaryTypeNameExpression",
926
+ "src": "776:6:8",
927
+ "typeDescriptions": {
928
+ "typeIdentifier": "t_type$_t_uint32_$",
929
+ "typeString": "type(uint32)"
930
+ },
931
+ "typeName": "uint32"
932
+ },
933
+ "id": 1717,
934
+ "isConstant": false,
935
+ "isLValue": false,
936
+ "isPure": false,
937
+ "kind": "typeConversion",
938
+ "lValueRequested": false,
939
+ "names": [],
940
+ "nodeType": "FunctionCall",
941
+ "src": "776:31:8",
942
+ "typeDescriptions": {
943
+ "typeIdentifier": "t_uint32",
944
+ "typeString": "uint32"
945
+ }
946
+ },
947
+ "visibility": "public"
948
+ },
949
+ {
950
+ "constant": false,
951
+ "id": 1721,
952
+ "name": "reserveFactor",
953
+ "nodeType": "VariableDeclaration",
954
+ "scope": 1751,
955
+ "src": "813:35:8",
956
+ "stateVariable": true,
957
+ "storageLocation": "default",
958
+ "typeDescriptions": {
959
+ "typeIdentifier": "t_uint256",
960
+ "typeString": "uint256"
961
+ },
962
+ "typeName": {
963
+ "id": 1719,
964
+ "name": "uint",
965
+ "nodeType": "ElementaryTypeName",
966
+ "src": "813:4:8",
967
+ "typeDescriptions": {
968
+ "typeIdentifier": "t_uint256",
969
+ "typeString": "uint256"
970
+ }
971
+ },
972
+ "value": {
973
+ "argumentTypes": null,
974
+ "hexValue": "302e3130653138",
975
+ "id": 1720,
976
+ "isConstant": false,
977
+ "isLValue": false,
978
+ "isPure": true,
979
+ "kind": "number",
980
+ "lValueRequested": false,
981
+ "nodeType": "Literal",
982
+ "src": "841:7:8",
983
+ "subdenomination": null,
984
+ "typeDescriptions": {
985
+ "typeIdentifier": "t_rational_100000000000000000_by_1",
986
+ "typeString": "int_const 100000000000000000"
987
+ },
988
+ "value": "0.10e18"
989
+ },
990
+ "visibility": "public"
991
+ },
992
+ {
993
+ "constant": false,
994
+ "id": 1724,
995
+ "name": "kinkUtilizationRate",
996
+ "nodeType": "VariableDeclaration",
997
+ "scope": 1751,
998
+ "src": "858:41:8",
999
+ "stateVariable": true,
1000
+ "storageLocation": "default",
1001
+ "typeDescriptions": {
1002
+ "typeIdentifier": "t_uint256",
1003
+ "typeString": "uint256"
1004
+ },
1005
+ "typeName": {
1006
+ "id": 1722,
1007
+ "name": "uint",
1008
+ "nodeType": "ElementaryTypeName",
1009
+ "src": "858:4:8",
1010
+ "typeDescriptions": {
1011
+ "typeIdentifier": "t_uint256",
1012
+ "typeString": "uint256"
1013
+ }
1014
+ },
1015
+ "value": {
1016
+ "argumentTypes": null,
1017
+ "hexValue": "302e3730653138",
1018
+ "id": 1723,
1019
+ "isConstant": false,
1020
+ "isLValue": false,
1021
+ "isPure": true,
1022
+ "kind": "number",
1023
+ "lValueRequested": false,
1024
+ "nodeType": "Literal",
1025
+ "src": "892:7:8",
1026
+ "subdenomination": null,
1027
+ "typeDescriptions": {
1028
+ "typeIdentifier": "t_rational_700000000000000000_by_1",
1029
+ "typeString": "int_const 700000000000000000"
1030
+ },
1031
+ "value": "0.70e18"
1032
+ },
1033
+ "visibility": "public"
1034
+ },
1035
+ {
1036
+ "constant": false,
1037
+ "id": 1727,
1038
+ "name": "adjustSpeed",
1039
+ "nodeType": "VariableDeclaration",
1040
+ "scope": 1751,
1041
+ "src": "909:38:8",
1042
+ "stateVariable": true,
1043
+ "storageLocation": "default",
1044
+ "typeDescriptions": {
1045
+ "typeIdentifier": "t_uint256",
1046
+ "typeString": "uint256"
1047
+ },
1048
+ "typeName": {
1049
+ "id": 1725,
1050
+ "name": "uint",
1051
+ "nodeType": "ElementaryTypeName",
1052
+ "src": "909:4:8",
1053
+ "typeDescriptions": {
1054
+ "typeIdentifier": "t_uint256",
1055
+ "typeString": "uint256"
1056
+ }
1057
+ },
1058
+ "value": {
1059
+ "argumentTypes": null,
1060
+ "hexValue": "302e35373837303337653132",
1061
+ "id": 1726,
1062
+ "isConstant": false,
1063
+ "isLValue": false,
1064
+ "isPure": true,
1065
+ "kind": "number",
1066
+ "lValueRequested": false,
1067
+ "nodeType": "Literal",
1068
+ "src": "935:12:8",
1069
+ "subdenomination": null,
1070
+ "typeDescriptions": {
1071
+ "typeIdentifier": "t_rational_578703700000_by_1",
1072
+ "typeString": "int_const 578703700000"
1073
+ },
1074
+ "value": "0.5787037e12"
1075
+ },
1076
+ "visibility": "public"
1077
+ },
1078
+ {
1079
+ "constant": false,
1080
+ "id": 1729,
1081
+ "name": "borrowTracker",
1082
+ "nodeType": "VariableDeclaration",
1083
+ "scope": 1751,
1084
+ "src": "964:28:8",
1085
+ "stateVariable": true,
1086
+ "storageLocation": "default",
1087
+ "typeDescriptions": {
1088
+ "typeIdentifier": "t_address",
1089
+ "typeString": "address"
1090
+ },
1091
+ "typeName": {
1092
+ "id": 1728,
1093
+ "name": "address",
1094
+ "nodeType": "ElementaryTypeName",
1095
+ "src": "964:7:8",
1096
+ "stateMutability": "nonpayable",
1097
+ "typeDescriptions": {
1098
+ "typeIdentifier": "t_address",
1099
+ "typeString": "address"
1100
+ }
1101
+ },
1102
+ "value": null,
1103
+ "visibility": "public"
1104
+ },
1105
+ {
1106
+ "body": {
1107
+ "id": 1749,
1108
+ "nodeType": "Block",
1109
+ "src": "1058:87:8",
1110
+ "statements": [
1111
+ {
1112
+ "expression": {
1113
+ "argumentTypes": null,
1114
+ "arguments": [
1115
+ {
1116
+ "argumentTypes": null,
1117
+ "commonType": {
1118
+ "typeIdentifier": "t_uint256",
1119
+ "typeString": "uint256"
1120
+ },
1121
+ "id": 1741,
1122
+ "isConstant": false,
1123
+ "isLValue": false,
1124
+ "isPure": false,
1125
+ "lValueRequested": false,
1126
+ "leftExpression": {
1127
+ "argumentTypes": null,
1128
+ "id": 1737,
1129
+ "name": "n",
1130
+ "nodeType": "Identifier",
1131
+ "overloadedDeclarations": [],
1132
+ "referencedDeclaration": 1731,
1133
+ "src": "1077:1:8",
1134
+ "typeDescriptions": {
1135
+ "typeIdentifier": "t_uint256",
1136
+ "typeString": "uint256"
1137
+ }
1138
+ },
1139
+ "nodeType": "BinaryOperation",
1140
+ "operator": "<",
1141
+ "rightExpression": {
1142
+ "argumentTypes": null,
1143
+ "commonType": {
1144
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
1145
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
1146
+ },
1147
+ "id": 1740,
1148
+ "isConstant": false,
1149
+ "isLValue": false,
1150
+ "isPure": true,
1151
+ "lValueRequested": false,
1152
+ "leftExpression": {
1153
+ "argumentTypes": null,
1154
+ "hexValue": "32",
1155
+ "id": 1738,
1156
+ "isConstant": false,
1157
+ "isLValue": false,
1158
+ "isPure": true,
1159
+ "kind": "number",
1160
+ "lValueRequested": false,
1161
+ "nodeType": "Literal",
1162
+ "src": "1081:1:8",
1163
+ "subdenomination": null,
1164
+ "typeDescriptions": {
1165
+ "typeIdentifier": "t_rational_2_by_1",
1166
+ "typeString": "int_const 2"
1167
+ },
1168
+ "value": "2"
1169
+ },
1170
+ "nodeType": "BinaryOperation",
1171
+ "operator": "**",
1172
+ "rightExpression": {
1173
+ "argumentTypes": null,
1174
+ "hexValue": "313132",
1175
+ "id": 1739,
1176
+ "isConstant": false,
1177
+ "isLValue": false,
1178
+ "isPure": true,
1179
+ "kind": "number",
1180
+ "lValueRequested": false,
1181
+ "nodeType": "Literal",
1182
+ "src": "1084:3:8",
1183
+ "subdenomination": null,
1184
+ "typeDescriptions": {
1185
+ "typeIdentifier": "t_rational_112_by_1",
1186
+ "typeString": "int_const 112"
1187
+ },
1188
+ "value": "112"
1189
+ },
1190
+ "src": "1081:6:8",
1191
+ "typeDescriptions": {
1192
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
1193
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
1194
+ }
1195
+ },
1196
+ "src": "1077:10:8",
1197
+ "typeDescriptions": {
1198
+ "typeIdentifier": "t_bool",
1199
+ "typeString": "bool"
1200
+ }
1201
+ },
1202
+ {
1203
+ "argumentTypes": null,
1204
+ "hexValue": "496d7065726d61783a2053414645313132",
1205
+ "id": 1742,
1206
+ "isConstant": false,
1207
+ "isLValue": false,
1208
+ "isPure": true,
1209
+ "kind": "string",
1210
+ "lValueRequested": false,
1211
+ "nodeType": "Literal",
1212
+ "src": "1089:19:8",
1213
+ "subdenomination": null,
1214
+ "typeDescriptions": {
1215
+ "typeIdentifier": "t_stringliteral_124d8c74dea96cfaf809cee38fb97d91363857e9122fc3d4c4d5bf2fb9f23176",
1216
+ "typeString": "literal_string \"Impermax: SAFE112\""
1217
+ },
1218
+ "value": "Impermax: SAFE112"
1219
+ }
1220
+ ],
1221
+ "expression": {
1222
+ "argumentTypes": [
1223
+ {
1224
+ "typeIdentifier": "t_bool",
1225
+ "typeString": "bool"
1226
+ },
1227
+ {
1228
+ "typeIdentifier": "t_stringliteral_124d8c74dea96cfaf809cee38fb97d91363857e9122fc3d4c4d5bf2fb9f23176",
1229
+ "typeString": "literal_string \"Impermax: SAFE112\""
1230
+ }
1231
+ ],
1232
+ "id": 1736,
1233
+ "name": "require",
1234
+ "nodeType": "Identifier",
1235
+ "overloadedDeclarations": [
1236
+ 9821,
1237
+ 9822
1238
+ ],
1239
+ "referencedDeclaration": 9822,
1240
+ "src": "1069:7:8",
1241
+ "typeDescriptions": {
1242
+ "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
1243
+ "typeString": "function (bool,string memory) pure"
1244
+ }
1245
+ },
1246
+ "id": 1743,
1247
+ "isConstant": false,
1248
+ "isLValue": false,
1249
+ "isPure": false,
1250
+ "kind": "functionCall",
1251
+ "lValueRequested": false,
1252
+ "names": [],
1253
+ "nodeType": "FunctionCall",
1254
+ "src": "1069:40:8",
1255
+ "typeDescriptions": {
1256
+ "typeIdentifier": "t_tuple$__$",
1257
+ "typeString": "tuple()"
1258
+ }
1259
+ },
1260
+ "id": 1744,
1261
+ "nodeType": "ExpressionStatement",
1262
+ "src": "1069:40:8"
1263
+ },
1264
+ {
1265
+ "expression": {
1266
+ "argumentTypes": null,
1267
+ "arguments": [
1268
+ {
1269
+ "argumentTypes": null,
1270
+ "id": 1746,
1271
+ "name": "n",
1272
+ "nodeType": "Identifier",
1273
+ "overloadedDeclarations": [],
1274
+ "referencedDeclaration": 1731,
1275
+ "src": "1135:1:8",
1276
+ "typeDescriptions": {
1277
+ "typeIdentifier": "t_uint256",
1278
+ "typeString": "uint256"
1279
+ }
1280
+ }
1281
+ ],
1282
+ "expression": {
1283
+ "argumentTypes": [
1284
+ {
1285
+ "typeIdentifier": "t_uint256",
1286
+ "typeString": "uint256"
1287
+ }
1288
+ ],
1289
+ "id": 1745,
1290
+ "isConstant": false,
1291
+ "isLValue": false,
1292
+ "isPure": true,
1293
+ "lValueRequested": false,
1294
+ "nodeType": "ElementaryTypeNameExpression",
1295
+ "src": "1127:7:8",
1296
+ "typeDescriptions": {
1297
+ "typeIdentifier": "t_type$_t_uint112_$",
1298
+ "typeString": "type(uint112)"
1299
+ },
1300
+ "typeName": "uint112"
1301
+ },
1302
+ "id": 1747,
1303
+ "isConstant": false,
1304
+ "isLValue": false,
1305
+ "isPure": false,
1306
+ "kind": "typeConversion",
1307
+ "lValueRequested": false,
1308
+ "names": [],
1309
+ "nodeType": "FunctionCall",
1310
+ "src": "1127:10:8",
1311
+ "typeDescriptions": {
1312
+ "typeIdentifier": "t_uint112",
1313
+ "typeString": "uint112"
1314
+ }
1315
+ },
1316
+ "functionReturnParameters": 1735,
1317
+ "id": 1748,
1318
+ "nodeType": "Return",
1319
+ "src": "1120:17:8"
1320
+ }
1321
+ ]
1322
+ },
1323
+ "documentation": null,
1324
+ "id": 1750,
1325
+ "implemented": true,
1326
+ "kind": "function",
1327
+ "modifiers": [],
1328
+ "name": "safe112",
1329
+ "nodeType": "FunctionDefinition",
1330
+ "parameters": {
1331
+ "id": 1732,
1332
+ "nodeType": "ParameterList",
1333
+ "parameters": [
1334
+ {
1335
+ "constant": false,
1336
+ "id": 1731,
1337
+ "name": "n",
1338
+ "nodeType": "VariableDeclaration",
1339
+ "scope": 1750,
1340
+ "src": "1018:6:8",
1341
+ "stateVariable": false,
1342
+ "storageLocation": "default",
1343
+ "typeDescriptions": {
1344
+ "typeIdentifier": "t_uint256",
1345
+ "typeString": "uint256"
1346
+ },
1347
+ "typeName": {
1348
+ "id": 1730,
1349
+ "name": "uint",
1350
+ "nodeType": "ElementaryTypeName",
1351
+ "src": "1018:4:8",
1352
+ "typeDescriptions": {
1353
+ "typeIdentifier": "t_uint256",
1354
+ "typeString": "uint256"
1355
+ }
1356
+ },
1357
+ "value": null,
1358
+ "visibility": "internal"
1359
+ }
1360
+ ],
1361
+ "src": "1017:8:8"
1362
+ },
1363
+ "returnParameters": {
1364
+ "id": 1735,
1365
+ "nodeType": "ParameterList",
1366
+ "parameters": [
1367
+ {
1368
+ "constant": false,
1369
+ "id": 1734,
1370
+ "name": "",
1371
+ "nodeType": "VariableDeclaration",
1372
+ "scope": 1750,
1373
+ "src": "1049:7:8",
1374
+ "stateVariable": false,
1375
+ "storageLocation": "default",
1376
+ "typeDescriptions": {
1377
+ "typeIdentifier": "t_uint112",
1378
+ "typeString": "uint112"
1379
+ },
1380
+ "typeName": {
1381
+ "id": 1733,
1382
+ "name": "uint112",
1383
+ "nodeType": "ElementaryTypeName",
1384
+ "src": "1049:7:8",
1385
+ "typeDescriptions": {
1386
+ "typeIdentifier": "t_uint112",
1387
+ "typeString": "uint112"
1388
+ }
1389
+ },
1390
+ "value": null,
1391
+ "visibility": "internal"
1392
+ }
1393
+ ],
1394
+ "src": "1048:9:8"
1395
+ },
1396
+ "scope": 1751,
1397
+ "src": "1001:144:8",
1398
+ "stateMutability": "pure",
1399
+ "superFunction": null,
1400
+ "visibility": "internal"
1401
+ }
1402
+ ],
1403
+ "scope": 1752,
1404
+ "src": "28:1120:8"
1405
+ }
1406
+ ],
1407
+ "src": "0:1148:8"
1408
+ },
1409
+ "legacyAST": {
1410
+ "absolutePath": "/C/Users/simor/Desktop/impermax-x-uniswapv2-periphery/test/Contracts/imx-univ2-core/BStorage.sol",
1411
+ "exportedSymbols": {
1412
+ "BStorage": [
1413
+ 1751
1414
+ ]
1415
+ },
1416
+ "id": 1752,
1417
+ "nodeType": "SourceUnit",
1418
+ "nodes": [
1419
+ {
1420
+ "id": 1669,
1421
+ "literals": [
1422
+ "solidity",
1423
+ "=",
1424
+ "0.5",
1425
+ ".16"
1426
+ ],
1427
+ "nodeType": "PragmaDirective",
1428
+ "src": "0:24:8"
1429
+ },
1430
+ {
1431
+ "baseContracts": [],
1432
+ "contractDependencies": [],
1433
+ "contractKind": "contract",
1434
+ "documentation": null,
1435
+ "fullyImplemented": true,
1436
+ "id": 1751,
1437
+ "linearizedBaseContracts": [
1438
+ 1751
1439
+ ],
1440
+ "name": "BStorage",
1441
+ "nodeType": "ContractDefinition",
1442
+ "nodes": [
1443
+ {
1444
+ "constant": false,
1445
+ "id": 1671,
1446
+ "name": "collateral",
1447
+ "nodeType": "VariableDeclaration",
1448
+ "scope": 1751,
1449
+ "src": "52:25:8",
1450
+ "stateVariable": true,
1451
+ "storageLocation": "default",
1452
+ "typeDescriptions": {
1453
+ "typeIdentifier": "t_address",
1454
+ "typeString": "address"
1455
+ },
1456
+ "typeName": {
1457
+ "id": 1670,
1458
+ "name": "address",
1459
+ "nodeType": "ElementaryTypeName",
1460
+ "src": "52:7:8",
1461
+ "stateMutability": "nonpayable",
1462
+ "typeDescriptions": {
1463
+ "typeIdentifier": "t_address",
1464
+ "typeString": "address"
1465
+ }
1466
+ },
1467
+ "value": null,
1468
+ "visibility": "public"
1469
+ },
1470
+ {
1471
+ "constant": false,
1472
+ "id": 1677,
1473
+ "name": "borrowAllowance",
1474
+ "nodeType": "VariableDeclaration",
1475
+ "scope": 1751,
1476
+ "src": "83:72:8",
1477
+ "stateVariable": true,
1478
+ "storageLocation": "default",
1479
+ "typeDescriptions": {
1480
+ "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
1481
+ "typeString": "mapping(address => mapping(address => uint256))"
1482
+ },
1483
+ "typeName": {
1484
+ "id": 1676,
1485
+ "keyType": {
1486
+ "id": 1672,
1487
+ "name": "address",
1488
+ "nodeType": "ElementaryTypeName",
1489
+ "src": "92:7:8",
1490
+ "typeDescriptions": {
1491
+ "typeIdentifier": "t_address",
1492
+ "typeString": "address"
1493
+ }
1494
+ },
1495
+ "nodeType": "Mapping",
1496
+ "src": "83:49:8",
1497
+ "typeDescriptions": {
1498
+ "typeIdentifier": "t_mapping$_t_address_$_t_mapping$_t_address_$_t_uint256_$_$",
1499
+ "typeString": "mapping(address => mapping(address => uint256))"
1500
+ },
1501
+ "valueType": {
1502
+ "id": 1675,
1503
+ "keyType": {
1504
+ "id": 1673,
1505
+ "name": "address",
1506
+ "nodeType": "ElementaryTypeName",
1507
+ "src": "112:7:8",
1508
+ "typeDescriptions": {
1509
+ "typeIdentifier": "t_address",
1510
+ "typeString": "address"
1511
+ }
1512
+ },
1513
+ "nodeType": "Mapping",
1514
+ "src": "103:28:8",
1515
+ "typeDescriptions": {
1516
+ "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
1517
+ "typeString": "mapping(address => uint256)"
1518
+ },
1519
+ "valueType": {
1520
+ "id": 1674,
1521
+ "name": "uint256",
1522
+ "nodeType": "ElementaryTypeName",
1523
+ "src": "123:7:8",
1524
+ "typeDescriptions": {
1525
+ "typeIdentifier": "t_uint256",
1526
+ "typeString": "uint256"
1527
+ }
1528
+ }
1529
+ }
1530
+ },
1531
+ "value": null,
1532
+ "visibility": "public"
1533
+ },
1534
+ {
1535
+ "canonicalName": "BStorage.BorrowSnapshot",
1536
+ "id": 1682,
1537
+ "members": [
1538
+ {
1539
+ "constant": false,
1540
+ "id": 1679,
1541
+ "name": "principal",
1542
+ "nodeType": "VariableDeclaration",
1543
+ "scope": 1682,
1544
+ "src": "208:17:8",
1545
+ "stateVariable": false,
1546
+ "storageLocation": "default",
1547
+ "typeDescriptions": {
1548
+ "typeIdentifier": "t_uint112",
1549
+ "typeString": "uint112"
1550
+ },
1551
+ "typeName": {
1552
+ "id": 1678,
1553
+ "name": "uint112",
1554
+ "nodeType": "ElementaryTypeName",
1555
+ "src": "208:7:8",
1556
+ "typeDescriptions": {
1557
+ "typeIdentifier": "t_uint112",
1558
+ "typeString": "uint112"
1559
+ }
1560
+ },
1561
+ "value": null,
1562
+ "visibility": "internal"
1563
+ },
1564
+ {
1565
+ "constant": false,
1566
+ "id": 1681,
1567
+ "name": "interestIndex",
1568
+ "nodeType": "VariableDeclaration",
1569
+ "scope": 1682,
1570
+ "src": "288:21:8",
1571
+ "stateVariable": false,
1572
+ "storageLocation": "default",
1573
+ "typeDescriptions": {
1574
+ "typeIdentifier": "t_uint112",
1575
+ "typeString": "uint112"
1576
+ },
1577
+ "typeName": {
1578
+ "id": 1680,
1579
+ "name": "uint112",
1580
+ "nodeType": "ElementaryTypeName",
1581
+ "src": "288:7:8",
1582
+ "typeDescriptions": {
1583
+ "typeIdentifier": "t_uint112",
1584
+ "typeString": "uint112"
1585
+ }
1586
+ },
1587
+ "value": null,
1588
+ "visibility": "internal"
1589
+ }
1590
+ ],
1591
+ "name": "BorrowSnapshot",
1592
+ "nodeType": "StructDefinition",
1593
+ "scope": 1751,
1594
+ "src": "181:178:8",
1595
+ "visibility": "public"
1596
+ },
1597
+ {
1598
+ "constant": false,
1599
+ "id": 1686,
1600
+ "name": "borrowBalances",
1601
+ "nodeType": "VariableDeclaration",
1602
+ "scope": 1751,
1603
+ "src": "362:58:8",
1604
+ "stateVariable": true,
1605
+ "storageLocation": "default",
1606
+ "typeDescriptions": {
1607
+ "typeIdentifier": "t_mapping$_t_address_$_t_struct$_BorrowSnapshot_$1682_storage_$",
1608
+ "typeString": "mapping(address => struct BStorage.BorrowSnapshot)"
1609
+ },
1610
+ "typeName": {
1611
+ "id": 1685,
1612
+ "keyType": {
1613
+ "id": 1683,
1614
+ "name": "address",
1615
+ "nodeType": "ElementaryTypeName",
1616
+ "src": "370:7:8",
1617
+ "typeDescriptions": {
1618
+ "typeIdentifier": "t_address",
1619
+ "typeString": "address"
1620
+ }
1621
+ },
1622
+ "nodeType": "Mapping",
1623
+ "src": "362:34:8",
1624
+ "typeDescriptions": {
1625
+ "typeIdentifier": "t_mapping$_t_address_$_t_struct$_BorrowSnapshot_$1682_storage_$",
1626
+ "typeString": "mapping(address => struct BStorage.BorrowSnapshot)"
1627
+ },
1628
+ "valueType": {
1629
+ "contractScope": null,
1630
+ "id": 1684,
1631
+ "name": "BorrowSnapshot",
1632
+ "nodeType": "UserDefinedTypeName",
1633
+ "referencedDeclaration": 1682,
1634
+ "src": "381:14:8",
1635
+ "typeDescriptions": {
1636
+ "typeIdentifier": "t_struct$_BorrowSnapshot_$1682_storage_ptr",
1637
+ "typeString": "struct BStorage.BorrowSnapshot"
1638
+ }
1639
+ }
1640
+ },
1641
+ "value": null,
1642
+ "visibility": "internal"
1643
+ },
1644
+ {
1645
+ "constant": false,
1646
+ "id": 1689,
1647
+ "name": "borrowIndex",
1648
+ "nodeType": "VariableDeclaration",
1649
+ "scope": 1751,
1650
+ "src": "452:33:8",
1651
+ "stateVariable": true,
1652
+ "storageLocation": "default",
1653
+ "typeDescriptions": {
1654
+ "typeIdentifier": "t_uint112",
1655
+ "typeString": "uint112"
1656
+ },
1657
+ "typeName": {
1658
+ "id": 1687,
1659
+ "name": "uint112",
1660
+ "nodeType": "ElementaryTypeName",
1661
+ "src": "452:7:8",
1662
+ "typeDescriptions": {
1663
+ "typeIdentifier": "t_uint112",
1664
+ "typeString": "uint112"
1665
+ }
1666
+ },
1667
+ "value": {
1668
+ "argumentTypes": null,
1669
+ "hexValue": "31653138",
1670
+ "id": 1688,
1671
+ "isConstant": false,
1672
+ "isLValue": false,
1673
+ "isPure": true,
1674
+ "kind": "number",
1675
+ "lValueRequested": false,
1676
+ "nodeType": "Literal",
1677
+ "src": "481:4:8",
1678
+ "subdenomination": null,
1679
+ "typeDescriptions": {
1680
+ "typeIdentifier": "t_rational_1000000000000000000_by_1",
1681
+ "typeString": "int_const 1000000000000000000"
1682
+ },
1683
+ "value": "1e18"
1684
+ },
1685
+ "visibility": "public"
1686
+ },
1687
+ {
1688
+ "constant": false,
1689
+ "id": 1691,
1690
+ "name": "totalBorrows",
1691
+ "nodeType": "VariableDeclaration",
1692
+ "scope": 1751,
1693
+ "src": "489:27:8",
1694
+ "stateVariable": true,
1695
+ "storageLocation": "default",
1696
+ "typeDescriptions": {
1697
+ "typeIdentifier": "t_uint112",
1698
+ "typeString": "uint112"
1699
+ },
1700
+ "typeName": {
1701
+ "id": 1690,
1702
+ "name": "uint112",
1703
+ "nodeType": "ElementaryTypeName",
1704
+ "src": "489:7:8",
1705
+ "typeDescriptions": {
1706
+ "typeIdentifier": "t_uint112",
1707
+ "typeString": "uint112"
1708
+ }
1709
+ },
1710
+ "value": null,
1711
+ "visibility": "public"
1712
+ },
1713
+ {
1714
+ "constant": false,
1715
+ "id": 1701,
1716
+ "name": "accrualTimestamp",
1717
+ "nodeType": "VariableDeclaration",
1718
+ "scope": 1751,
1719
+ "src": "520:64:8",
1720
+ "stateVariable": true,
1721
+ "storageLocation": "default",
1722
+ "typeDescriptions": {
1723
+ "typeIdentifier": "t_uint32",
1724
+ "typeString": "uint32"
1725
+ },
1726
+ "typeName": {
1727
+ "id": 1692,
1728
+ "name": "uint32",
1729
+ "nodeType": "ElementaryTypeName",
1730
+ "src": "520:6:8",
1731
+ "typeDescriptions": {
1732
+ "typeIdentifier": "t_uint32",
1733
+ "typeString": "uint32"
1734
+ }
1735
+ },
1736
+ "value": {
1737
+ "argumentTypes": null,
1738
+ "arguments": [
1739
+ {
1740
+ "argumentTypes": null,
1741
+ "commonType": {
1742
+ "typeIdentifier": "t_uint256",
1743
+ "typeString": "uint256"
1744
+ },
1745
+ "id": 1699,
1746
+ "isConstant": false,
1747
+ "isLValue": false,
1748
+ "isPure": false,
1749
+ "lValueRequested": false,
1750
+ "leftExpression": {
1751
+ "argumentTypes": null,
1752
+ "expression": {
1753
+ "argumentTypes": null,
1754
+ "id": 1694,
1755
+ "name": "block",
1756
+ "nodeType": "Identifier",
1757
+ "overloadedDeclarations": [],
1758
+ "referencedDeclaration": 9808,
1759
+ "src": "560:5:8",
1760
+ "typeDescriptions": {
1761
+ "typeIdentifier": "t_magic_block",
1762
+ "typeString": "block"
1763
+ }
1764
+ },
1765
+ "id": 1695,
1766
+ "isConstant": false,
1767
+ "isLValue": false,
1768
+ "isPure": false,
1769
+ "lValueRequested": false,
1770
+ "memberName": "timestamp",
1771
+ "nodeType": "MemberAccess",
1772
+ "referencedDeclaration": null,
1773
+ "src": "560:15:8",
1774
+ "typeDescriptions": {
1775
+ "typeIdentifier": "t_uint256",
1776
+ "typeString": "uint256"
1777
+ }
1778
+ },
1779
+ "nodeType": "BinaryOperation",
1780
+ "operator": "%",
1781
+ "rightExpression": {
1782
+ "argumentTypes": null,
1783
+ "commonType": {
1784
+ "typeIdentifier": "t_rational_4294967296_by_1",
1785
+ "typeString": "int_const 4294967296"
1786
+ },
1787
+ "id": 1698,
1788
+ "isConstant": false,
1789
+ "isLValue": false,
1790
+ "isPure": true,
1791
+ "lValueRequested": false,
1792
+ "leftExpression": {
1793
+ "argumentTypes": null,
1794
+ "hexValue": "32",
1795
+ "id": 1696,
1796
+ "isConstant": false,
1797
+ "isLValue": false,
1798
+ "isPure": true,
1799
+ "kind": "number",
1800
+ "lValueRequested": false,
1801
+ "nodeType": "Literal",
1802
+ "src": "578:1:8",
1803
+ "subdenomination": null,
1804
+ "typeDescriptions": {
1805
+ "typeIdentifier": "t_rational_2_by_1",
1806
+ "typeString": "int_const 2"
1807
+ },
1808
+ "value": "2"
1809
+ },
1810
+ "nodeType": "BinaryOperation",
1811
+ "operator": "**",
1812
+ "rightExpression": {
1813
+ "argumentTypes": null,
1814
+ "hexValue": "3332",
1815
+ "id": 1697,
1816
+ "isConstant": false,
1817
+ "isLValue": false,
1818
+ "isPure": true,
1819
+ "kind": "number",
1820
+ "lValueRequested": false,
1821
+ "nodeType": "Literal",
1822
+ "src": "581:2:8",
1823
+ "subdenomination": null,
1824
+ "typeDescriptions": {
1825
+ "typeIdentifier": "t_rational_32_by_1",
1826
+ "typeString": "int_const 32"
1827
+ },
1828
+ "value": "32"
1829
+ },
1830
+ "src": "578:5:8",
1831
+ "typeDescriptions": {
1832
+ "typeIdentifier": "t_rational_4294967296_by_1",
1833
+ "typeString": "int_const 4294967296"
1834
+ }
1835
+ },
1836
+ "src": "560:23:8",
1837
+ "typeDescriptions": {
1838
+ "typeIdentifier": "t_uint256",
1839
+ "typeString": "uint256"
1840
+ }
1841
+ }
1842
+ ],
1843
+ "expression": {
1844
+ "argumentTypes": [
1845
+ {
1846
+ "typeIdentifier": "t_uint256",
1847
+ "typeString": "uint256"
1848
+ }
1849
+ ],
1850
+ "id": 1693,
1851
+ "isConstant": false,
1852
+ "isLValue": false,
1853
+ "isPure": true,
1854
+ "lValueRequested": false,
1855
+ "nodeType": "ElementaryTypeNameExpression",
1856
+ "src": "553:6:8",
1857
+ "typeDescriptions": {
1858
+ "typeIdentifier": "t_type$_t_uint32_$",
1859
+ "typeString": "type(uint32)"
1860
+ },
1861
+ "typeName": "uint32"
1862
+ },
1863
+ "id": 1700,
1864
+ "isConstant": false,
1865
+ "isLValue": false,
1866
+ "isPure": false,
1867
+ "kind": "typeConversion",
1868
+ "lValueRequested": false,
1869
+ "names": [],
1870
+ "nodeType": "FunctionCall",
1871
+ "src": "553:31:8",
1872
+ "typeDescriptions": {
1873
+ "typeIdentifier": "t_uint32",
1874
+ "typeString": "uint32"
1875
+ }
1876
+ },
1877
+ "visibility": "public"
1878
+ },
1879
+ {
1880
+ "constant": false,
1881
+ "id": 1703,
1882
+ "name": "exchangeRateLast",
1883
+ "nodeType": "VariableDeclaration",
1884
+ "scope": 1751,
1885
+ "src": "591:28:8",
1886
+ "stateVariable": true,
1887
+ "storageLocation": "default",
1888
+ "typeDescriptions": {
1889
+ "typeIdentifier": "t_uint256",
1890
+ "typeString": "uint256"
1891
+ },
1892
+ "typeName": {
1893
+ "id": 1702,
1894
+ "name": "uint",
1895
+ "nodeType": "ElementaryTypeName",
1896
+ "src": "591:4:8",
1897
+ "typeDescriptions": {
1898
+ "typeIdentifier": "t_uint256",
1899
+ "typeString": "uint256"
1900
+ }
1901
+ },
1902
+ "value": null,
1903
+ "visibility": "public"
1904
+ },
1905
+ {
1906
+ "constant": false,
1907
+ "id": 1705,
1908
+ "name": "borrowRate",
1909
+ "nodeType": "VariableDeclaration",
1910
+ "scope": 1751,
1911
+ "src": "652:24:8",
1912
+ "stateVariable": true,
1913
+ "storageLocation": "default",
1914
+ "typeDescriptions": {
1915
+ "typeIdentifier": "t_uint48",
1916
+ "typeString": "uint48"
1917
+ },
1918
+ "typeName": {
1919
+ "id": 1704,
1920
+ "name": "uint48",
1921
+ "nodeType": "ElementaryTypeName",
1922
+ "src": "652:6:8",
1923
+ "typeDescriptions": {
1924
+ "typeIdentifier": "t_uint48",
1925
+ "typeString": "uint48"
1926
+ }
1927
+ },
1928
+ "value": null,
1929
+ "visibility": "public"
1930
+ },
1931
+ {
1932
+ "constant": false,
1933
+ "id": 1708,
1934
+ "name": "kinkBorrowRate",
1935
+ "nodeType": "VariableDeclaration",
1936
+ "scope": 1751,
1937
+ "src": "680:42:8",
1938
+ "stateVariable": true,
1939
+ "storageLocation": "default",
1940
+ "typeDescriptions": {
1941
+ "typeIdentifier": "t_uint48",
1942
+ "typeString": "uint48"
1943
+ },
1944
+ "typeName": {
1945
+ "id": 1706,
1946
+ "name": "uint48",
1947
+ "nodeType": "ElementaryTypeName",
1948
+ "src": "680:6:8",
1949
+ "typeDescriptions": {
1950
+ "typeIdentifier": "t_uint48",
1951
+ "typeString": "uint48"
1952
+ }
1953
+ },
1954
+ "value": {
1955
+ "argumentTypes": null,
1956
+ "hexValue": "312e353835343839366539",
1957
+ "id": 1707,
1958
+ "isConstant": false,
1959
+ "isLValue": false,
1960
+ "isPure": true,
1961
+ "kind": "number",
1962
+ "lValueRequested": false,
1963
+ "nodeType": "Literal",
1964
+ "src": "711:11:8",
1965
+ "subdenomination": null,
1966
+ "typeDescriptions": {
1967
+ "typeIdentifier": "t_rational_1585489600_by_1",
1968
+ "typeString": "int_const 1585489600"
1969
+ },
1970
+ "value": "1.5854896e9"
1971
+ },
1972
+ "visibility": "public"
1973
+ },
1974
+ {
1975
+ "constant": false,
1976
+ "id": 1718,
1977
+ "name": "rateUpdateTimestamp",
1978
+ "nodeType": "VariableDeclaration",
1979
+ "scope": 1751,
1980
+ "src": "740:67:8",
1981
+ "stateVariable": true,
1982
+ "storageLocation": "default",
1983
+ "typeDescriptions": {
1984
+ "typeIdentifier": "t_uint32",
1985
+ "typeString": "uint32"
1986
+ },
1987
+ "typeName": {
1988
+ "id": 1709,
1989
+ "name": "uint32",
1990
+ "nodeType": "ElementaryTypeName",
1991
+ "src": "740:6:8",
1992
+ "typeDescriptions": {
1993
+ "typeIdentifier": "t_uint32",
1994
+ "typeString": "uint32"
1995
+ }
1996
+ },
1997
+ "value": {
1998
+ "argumentTypes": null,
1999
+ "arguments": [
2000
+ {
2001
+ "argumentTypes": null,
2002
+ "commonType": {
2003
+ "typeIdentifier": "t_uint256",
2004
+ "typeString": "uint256"
2005
+ },
2006
+ "id": 1716,
2007
+ "isConstant": false,
2008
+ "isLValue": false,
2009
+ "isPure": false,
2010
+ "lValueRequested": false,
2011
+ "leftExpression": {
2012
+ "argumentTypes": null,
2013
+ "expression": {
2014
+ "argumentTypes": null,
2015
+ "id": 1711,
2016
+ "name": "block",
2017
+ "nodeType": "Identifier",
2018
+ "overloadedDeclarations": [],
2019
+ "referencedDeclaration": 9808,
2020
+ "src": "783:5:8",
2021
+ "typeDescriptions": {
2022
+ "typeIdentifier": "t_magic_block",
2023
+ "typeString": "block"
2024
+ }
2025
+ },
2026
+ "id": 1712,
2027
+ "isConstant": false,
2028
+ "isLValue": false,
2029
+ "isPure": false,
2030
+ "lValueRequested": false,
2031
+ "memberName": "timestamp",
2032
+ "nodeType": "MemberAccess",
2033
+ "referencedDeclaration": null,
2034
+ "src": "783:15:8",
2035
+ "typeDescriptions": {
2036
+ "typeIdentifier": "t_uint256",
2037
+ "typeString": "uint256"
2038
+ }
2039
+ },
2040
+ "nodeType": "BinaryOperation",
2041
+ "operator": "%",
2042
+ "rightExpression": {
2043
+ "argumentTypes": null,
2044
+ "commonType": {
2045
+ "typeIdentifier": "t_rational_4294967296_by_1",
2046
+ "typeString": "int_const 4294967296"
2047
+ },
2048
+ "id": 1715,
2049
+ "isConstant": false,
2050
+ "isLValue": false,
2051
+ "isPure": true,
2052
+ "lValueRequested": false,
2053
+ "leftExpression": {
2054
+ "argumentTypes": null,
2055
+ "hexValue": "32",
2056
+ "id": 1713,
2057
+ "isConstant": false,
2058
+ "isLValue": false,
2059
+ "isPure": true,
2060
+ "kind": "number",
2061
+ "lValueRequested": false,
2062
+ "nodeType": "Literal",
2063
+ "src": "801:1:8",
2064
+ "subdenomination": null,
2065
+ "typeDescriptions": {
2066
+ "typeIdentifier": "t_rational_2_by_1",
2067
+ "typeString": "int_const 2"
2068
+ },
2069
+ "value": "2"
2070
+ },
2071
+ "nodeType": "BinaryOperation",
2072
+ "operator": "**",
2073
+ "rightExpression": {
2074
+ "argumentTypes": null,
2075
+ "hexValue": "3332",
2076
+ "id": 1714,
2077
+ "isConstant": false,
2078
+ "isLValue": false,
2079
+ "isPure": true,
2080
+ "kind": "number",
2081
+ "lValueRequested": false,
2082
+ "nodeType": "Literal",
2083
+ "src": "804:2:8",
2084
+ "subdenomination": null,
2085
+ "typeDescriptions": {
2086
+ "typeIdentifier": "t_rational_32_by_1",
2087
+ "typeString": "int_const 32"
2088
+ },
2089
+ "value": "32"
2090
+ },
2091
+ "src": "801:5:8",
2092
+ "typeDescriptions": {
2093
+ "typeIdentifier": "t_rational_4294967296_by_1",
2094
+ "typeString": "int_const 4294967296"
2095
+ }
2096
+ },
2097
+ "src": "783:23:8",
2098
+ "typeDescriptions": {
2099
+ "typeIdentifier": "t_uint256",
2100
+ "typeString": "uint256"
2101
+ }
2102
+ }
2103
+ ],
2104
+ "expression": {
2105
+ "argumentTypes": [
2106
+ {
2107
+ "typeIdentifier": "t_uint256",
2108
+ "typeString": "uint256"
2109
+ }
2110
+ ],
2111
+ "id": 1710,
2112
+ "isConstant": false,
2113
+ "isLValue": false,
2114
+ "isPure": true,
2115
+ "lValueRequested": false,
2116
+ "nodeType": "ElementaryTypeNameExpression",
2117
+ "src": "776:6:8",
2118
+ "typeDescriptions": {
2119
+ "typeIdentifier": "t_type$_t_uint32_$",
2120
+ "typeString": "type(uint32)"
2121
+ },
2122
+ "typeName": "uint32"
2123
+ },
2124
+ "id": 1717,
2125
+ "isConstant": false,
2126
+ "isLValue": false,
2127
+ "isPure": false,
2128
+ "kind": "typeConversion",
2129
+ "lValueRequested": false,
2130
+ "names": [],
2131
+ "nodeType": "FunctionCall",
2132
+ "src": "776:31:8",
2133
+ "typeDescriptions": {
2134
+ "typeIdentifier": "t_uint32",
2135
+ "typeString": "uint32"
2136
+ }
2137
+ },
2138
+ "visibility": "public"
2139
+ },
2140
+ {
2141
+ "constant": false,
2142
+ "id": 1721,
2143
+ "name": "reserveFactor",
2144
+ "nodeType": "VariableDeclaration",
2145
+ "scope": 1751,
2146
+ "src": "813:35:8",
2147
+ "stateVariable": true,
2148
+ "storageLocation": "default",
2149
+ "typeDescriptions": {
2150
+ "typeIdentifier": "t_uint256",
2151
+ "typeString": "uint256"
2152
+ },
2153
+ "typeName": {
2154
+ "id": 1719,
2155
+ "name": "uint",
2156
+ "nodeType": "ElementaryTypeName",
2157
+ "src": "813:4:8",
2158
+ "typeDescriptions": {
2159
+ "typeIdentifier": "t_uint256",
2160
+ "typeString": "uint256"
2161
+ }
2162
+ },
2163
+ "value": {
2164
+ "argumentTypes": null,
2165
+ "hexValue": "302e3130653138",
2166
+ "id": 1720,
2167
+ "isConstant": false,
2168
+ "isLValue": false,
2169
+ "isPure": true,
2170
+ "kind": "number",
2171
+ "lValueRequested": false,
2172
+ "nodeType": "Literal",
2173
+ "src": "841:7:8",
2174
+ "subdenomination": null,
2175
+ "typeDescriptions": {
2176
+ "typeIdentifier": "t_rational_100000000000000000_by_1",
2177
+ "typeString": "int_const 100000000000000000"
2178
+ },
2179
+ "value": "0.10e18"
2180
+ },
2181
+ "visibility": "public"
2182
+ },
2183
+ {
2184
+ "constant": false,
2185
+ "id": 1724,
2186
+ "name": "kinkUtilizationRate",
2187
+ "nodeType": "VariableDeclaration",
2188
+ "scope": 1751,
2189
+ "src": "858:41:8",
2190
+ "stateVariable": true,
2191
+ "storageLocation": "default",
2192
+ "typeDescriptions": {
2193
+ "typeIdentifier": "t_uint256",
2194
+ "typeString": "uint256"
2195
+ },
2196
+ "typeName": {
2197
+ "id": 1722,
2198
+ "name": "uint",
2199
+ "nodeType": "ElementaryTypeName",
2200
+ "src": "858:4:8",
2201
+ "typeDescriptions": {
2202
+ "typeIdentifier": "t_uint256",
2203
+ "typeString": "uint256"
2204
+ }
2205
+ },
2206
+ "value": {
2207
+ "argumentTypes": null,
2208
+ "hexValue": "302e3730653138",
2209
+ "id": 1723,
2210
+ "isConstant": false,
2211
+ "isLValue": false,
2212
+ "isPure": true,
2213
+ "kind": "number",
2214
+ "lValueRequested": false,
2215
+ "nodeType": "Literal",
2216
+ "src": "892:7:8",
2217
+ "subdenomination": null,
2218
+ "typeDescriptions": {
2219
+ "typeIdentifier": "t_rational_700000000000000000_by_1",
2220
+ "typeString": "int_const 700000000000000000"
2221
+ },
2222
+ "value": "0.70e18"
2223
+ },
2224
+ "visibility": "public"
2225
+ },
2226
+ {
2227
+ "constant": false,
2228
+ "id": 1727,
2229
+ "name": "adjustSpeed",
2230
+ "nodeType": "VariableDeclaration",
2231
+ "scope": 1751,
2232
+ "src": "909:38:8",
2233
+ "stateVariable": true,
2234
+ "storageLocation": "default",
2235
+ "typeDescriptions": {
2236
+ "typeIdentifier": "t_uint256",
2237
+ "typeString": "uint256"
2238
+ },
2239
+ "typeName": {
2240
+ "id": 1725,
2241
+ "name": "uint",
2242
+ "nodeType": "ElementaryTypeName",
2243
+ "src": "909:4:8",
2244
+ "typeDescriptions": {
2245
+ "typeIdentifier": "t_uint256",
2246
+ "typeString": "uint256"
2247
+ }
2248
+ },
2249
+ "value": {
2250
+ "argumentTypes": null,
2251
+ "hexValue": "302e35373837303337653132",
2252
+ "id": 1726,
2253
+ "isConstant": false,
2254
+ "isLValue": false,
2255
+ "isPure": true,
2256
+ "kind": "number",
2257
+ "lValueRequested": false,
2258
+ "nodeType": "Literal",
2259
+ "src": "935:12:8",
2260
+ "subdenomination": null,
2261
+ "typeDescriptions": {
2262
+ "typeIdentifier": "t_rational_578703700000_by_1",
2263
+ "typeString": "int_const 578703700000"
2264
+ },
2265
+ "value": "0.5787037e12"
2266
+ },
2267
+ "visibility": "public"
2268
+ },
2269
+ {
2270
+ "constant": false,
2271
+ "id": 1729,
2272
+ "name": "borrowTracker",
2273
+ "nodeType": "VariableDeclaration",
2274
+ "scope": 1751,
2275
+ "src": "964:28:8",
2276
+ "stateVariable": true,
2277
+ "storageLocation": "default",
2278
+ "typeDescriptions": {
2279
+ "typeIdentifier": "t_address",
2280
+ "typeString": "address"
2281
+ },
2282
+ "typeName": {
2283
+ "id": 1728,
2284
+ "name": "address",
2285
+ "nodeType": "ElementaryTypeName",
2286
+ "src": "964:7:8",
2287
+ "stateMutability": "nonpayable",
2288
+ "typeDescriptions": {
2289
+ "typeIdentifier": "t_address",
2290
+ "typeString": "address"
2291
+ }
2292
+ },
2293
+ "value": null,
2294
+ "visibility": "public"
2295
+ },
2296
+ {
2297
+ "body": {
2298
+ "id": 1749,
2299
+ "nodeType": "Block",
2300
+ "src": "1058:87:8",
2301
+ "statements": [
2302
+ {
2303
+ "expression": {
2304
+ "argumentTypes": null,
2305
+ "arguments": [
2306
+ {
2307
+ "argumentTypes": null,
2308
+ "commonType": {
2309
+ "typeIdentifier": "t_uint256",
2310
+ "typeString": "uint256"
2311
+ },
2312
+ "id": 1741,
2313
+ "isConstant": false,
2314
+ "isLValue": false,
2315
+ "isPure": false,
2316
+ "lValueRequested": false,
2317
+ "leftExpression": {
2318
+ "argumentTypes": null,
2319
+ "id": 1737,
2320
+ "name": "n",
2321
+ "nodeType": "Identifier",
2322
+ "overloadedDeclarations": [],
2323
+ "referencedDeclaration": 1731,
2324
+ "src": "1077:1:8",
2325
+ "typeDescriptions": {
2326
+ "typeIdentifier": "t_uint256",
2327
+ "typeString": "uint256"
2328
+ }
2329
+ },
2330
+ "nodeType": "BinaryOperation",
2331
+ "operator": "<",
2332
+ "rightExpression": {
2333
+ "argumentTypes": null,
2334
+ "commonType": {
2335
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
2336
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
2337
+ },
2338
+ "id": 1740,
2339
+ "isConstant": false,
2340
+ "isLValue": false,
2341
+ "isPure": true,
2342
+ "lValueRequested": false,
2343
+ "leftExpression": {
2344
+ "argumentTypes": null,
2345
+ "hexValue": "32",
2346
+ "id": 1738,
2347
+ "isConstant": false,
2348
+ "isLValue": false,
2349
+ "isPure": true,
2350
+ "kind": "number",
2351
+ "lValueRequested": false,
2352
+ "nodeType": "Literal",
2353
+ "src": "1081:1:8",
2354
+ "subdenomination": null,
2355
+ "typeDescriptions": {
2356
+ "typeIdentifier": "t_rational_2_by_1",
2357
+ "typeString": "int_const 2"
2358
+ },
2359
+ "value": "2"
2360
+ },
2361
+ "nodeType": "BinaryOperation",
2362
+ "operator": "**",
2363
+ "rightExpression": {
2364
+ "argumentTypes": null,
2365
+ "hexValue": "313132",
2366
+ "id": 1739,
2367
+ "isConstant": false,
2368
+ "isLValue": false,
2369
+ "isPure": true,
2370
+ "kind": "number",
2371
+ "lValueRequested": false,
2372
+ "nodeType": "Literal",
2373
+ "src": "1084:3:8",
2374
+ "subdenomination": null,
2375
+ "typeDescriptions": {
2376
+ "typeIdentifier": "t_rational_112_by_1",
2377
+ "typeString": "int_const 112"
2378
+ },
2379
+ "value": "112"
2380
+ },
2381
+ "src": "1081:6:8",
2382
+ "typeDescriptions": {
2383
+ "typeIdentifier": "t_rational_5192296858534827628530496329220096_by_1",
2384
+ "typeString": "int_const 5192...(26 digits omitted)...0096"
2385
+ }
2386
+ },
2387
+ "src": "1077:10:8",
2388
+ "typeDescriptions": {
2389
+ "typeIdentifier": "t_bool",
2390
+ "typeString": "bool"
2391
+ }
2392
+ },
2393
+ {
2394
+ "argumentTypes": null,
2395
+ "hexValue": "496d7065726d61783a2053414645313132",
2396
+ "id": 1742,
2397
+ "isConstant": false,
2398
+ "isLValue": false,
2399
+ "isPure": true,
2400
+ "kind": "string",
2401
+ "lValueRequested": false,
2402
+ "nodeType": "Literal",
2403
+ "src": "1089:19:8",
2404
+ "subdenomination": null,
2405
+ "typeDescriptions": {
2406
+ "typeIdentifier": "t_stringliteral_124d8c74dea96cfaf809cee38fb97d91363857e9122fc3d4c4d5bf2fb9f23176",
2407
+ "typeString": "literal_string \"Impermax: SAFE112\""
2408
+ },
2409
+ "value": "Impermax: SAFE112"
2410
+ }
2411
+ ],
2412
+ "expression": {
2413
+ "argumentTypes": [
2414
+ {
2415
+ "typeIdentifier": "t_bool",
2416
+ "typeString": "bool"
2417
+ },
2418
+ {
2419
+ "typeIdentifier": "t_stringliteral_124d8c74dea96cfaf809cee38fb97d91363857e9122fc3d4c4d5bf2fb9f23176",
2420
+ "typeString": "literal_string \"Impermax: SAFE112\""
2421
+ }
2422
+ ],
2423
+ "id": 1736,
2424
+ "name": "require",
2425
+ "nodeType": "Identifier",
2426
+ "overloadedDeclarations": [
2427
+ 9821,
2428
+ 9822
2429
+ ],
2430
+ "referencedDeclaration": 9822,
2431
+ "src": "1069:7:8",
2432
+ "typeDescriptions": {
2433
+ "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
2434
+ "typeString": "function (bool,string memory) pure"
2435
+ }
2436
+ },
2437
+ "id": 1743,
2438
+ "isConstant": false,
2439
+ "isLValue": false,
2440
+ "isPure": false,
2441
+ "kind": "functionCall",
2442
+ "lValueRequested": false,
2443
+ "names": [],
2444
+ "nodeType": "FunctionCall",
2445
+ "src": "1069:40:8",
2446
+ "typeDescriptions": {
2447
+ "typeIdentifier": "t_tuple$__$",
2448
+ "typeString": "tuple()"
2449
+ }
2450
+ },
2451
+ "id": 1744,
2452
+ "nodeType": "ExpressionStatement",
2453
+ "src": "1069:40:8"
2454
+ },
2455
+ {
2456
+ "expression": {
2457
+ "argumentTypes": null,
2458
+ "arguments": [
2459
+ {
2460
+ "argumentTypes": null,
2461
+ "id": 1746,
2462
+ "name": "n",
2463
+ "nodeType": "Identifier",
2464
+ "overloadedDeclarations": [],
2465
+ "referencedDeclaration": 1731,
2466
+ "src": "1135:1:8",
2467
+ "typeDescriptions": {
2468
+ "typeIdentifier": "t_uint256",
2469
+ "typeString": "uint256"
2470
+ }
2471
+ }
2472
+ ],
2473
+ "expression": {
2474
+ "argumentTypes": [
2475
+ {
2476
+ "typeIdentifier": "t_uint256",
2477
+ "typeString": "uint256"
2478
+ }
2479
+ ],
2480
+ "id": 1745,
2481
+ "isConstant": false,
2482
+ "isLValue": false,
2483
+ "isPure": true,
2484
+ "lValueRequested": false,
2485
+ "nodeType": "ElementaryTypeNameExpression",
2486
+ "src": "1127:7:8",
2487
+ "typeDescriptions": {
2488
+ "typeIdentifier": "t_type$_t_uint112_$",
2489
+ "typeString": "type(uint112)"
2490
+ },
2491
+ "typeName": "uint112"
2492
+ },
2493
+ "id": 1747,
2494
+ "isConstant": false,
2495
+ "isLValue": false,
2496
+ "isPure": false,
2497
+ "kind": "typeConversion",
2498
+ "lValueRequested": false,
2499
+ "names": [],
2500
+ "nodeType": "FunctionCall",
2501
+ "src": "1127:10:8",
2502
+ "typeDescriptions": {
2503
+ "typeIdentifier": "t_uint112",
2504
+ "typeString": "uint112"
2505
+ }
2506
+ },
2507
+ "functionReturnParameters": 1735,
2508
+ "id": 1748,
2509
+ "nodeType": "Return",
2510
+ "src": "1120:17:8"
2511
+ }
2512
+ ]
2513
+ },
2514
+ "documentation": null,
2515
+ "id": 1750,
2516
+ "implemented": true,
2517
+ "kind": "function",
2518
+ "modifiers": [],
2519
+ "name": "safe112",
2520
+ "nodeType": "FunctionDefinition",
2521
+ "parameters": {
2522
+ "id": 1732,
2523
+ "nodeType": "ParameterList",
2524
+ "parameters": [
2525
+ {
2526
+ "constant": false,
2527
+ "id": 1731,
2528
+ "name": "n",
2529
+ "nodeType": "VariableDeclaration",
2530
+ "scope": 1750,
2531
+ "src": "1018:6:8",
2532
+ "stateVariable": false,
2533
+ "storageLocation": "default",
2534
+ "typeDescriptions": {
2535
+ "typeIdentifier": "t_uint256",
2536
+ "typeString": "uint256"
2537
+ },
2538
+ "typeName": {
2539
+ "id": 1730,
2540
+ "name": "uint",
2541
+ "nodeType": "ElementaryTypeName",
2542
+ "src": "1018:4:8",
2543
+ "typeDescriptions": {
2544
+ "typeIdentifier": "t_uint256",
2545
+ "typeString": "uint256"
2546
+ }
2547
+ },
2548
+ "value": null,
2549
+ "visibility": "internal"
2550
+ }
2551
+ ],
2552
+ "src": "1017:8:8"
2553
+ },
2554
+ "returnParameters": {
2555
+ "id": 1735,
2556
+ "nodeType": "ParameterList",
2557
+ "parameters": [
2558
+ {
2559
+ "constant": false,
2560
+ "id": 1734,
2561
+ "name": "",
2562
+ "nodeType": "VariableDeclaration",
2563
+ "scope": 1750,
2564
+ "src": "1049:7:8",
2565
+ "stateVariable": false,
2566
+ "storageLocation": "default",
2567
+ "typeDescriptions": {
2568
+ "typeIdentifier": "t_uint112",
2569
+ "typeString": "uint112"
2570
+ },
2571
+ "typeName": {
2572
+ "id": 1733,
2573
+ "name": "uint112",
2574
+ "nodeType": "ElementaryTypeName",
2575
+ "src": "1049:7:8",
2576
+ "typeDescriptions": {
2577
+ "typeIdentifier": "t_uint112",
2578
+ "typeString": "uint112"
2579
+ }
2580
+ },
2581
+ "value": null,
2582
+ "visibility": "internal"
2583
+ }
2584
+ ],
2585
+ "src": "1048:9:8"
2586
+ },
2587
+ "scope": 1751,
2588
+ "src": "1001:144:8",
2589
+ "stateMutability": "pure",
2590
+ "superFunction": null,
2591
+ "visibility": "internal"
2592
+ }
2593
+ ],
2594
+ "scope": 1752,
2595
+ "src": "28:1120:8"
2596
+ }
2597
+ ],
2598
+ "src": "0:1148:8"
2599
+ },
2600
+ "compiler": {
2601
+ "name": "solc",
2602
+ "version": "0.5.16+commit.9c3226ce.Emscripten.clang"
2603
+ },
2604
+ "networks": {},
2605
+ "schemaVersion": "3.3.2",
2606
+ "updatedAt": "2021-01-07T23:07:24.729Z",
2607
+ "devdoc": {
2608
+ "methods": {}
2609
+ },
2610
+ "userdoc": {
2611
+ "methods": {}
2612
+ }
2613
+ }