@venusprotocol/isolated-pools 4.3.0-dev.1 → 4.3.0-dev.2

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 (89) hide show
  1. package/deployments/arbitrumone/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_timeBased.json +552 -0
  2. package/deployments/arbitrumone/solcInputs/e39e34c59c5bc8d293cb758a621be058.json +460 -0
  3. package/deployments/arbitrumone.json +352 -0
  4. package/deployments/arbitrumone_addresses.json +1 -0
  5. package/deployments/arbitrumsepolia/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump25000bps_timeBased.json +552 -0
  6. package/deployments/arbitrumsepolia/solcInputs/2779d74bb5f3dd850decc06e31b696d8.json +457 -0
  7. package/deployments/arbitrumsepolia.json +352 -0
  8. package/deployments/arbitrumsepolia_addresses.json +1 -0
  9. package/deployments/basemainnet/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump25000bps_timeBased.json +552 -0
  10. package/deployments/basemainnet/solcInputs/e39e34c59c5bc8d293cb758a621be058.json +460 -0
  11. package/deployments/basemainnet.json +352 -0
  12. package/deployments/basemainnet_addresses.json +1 -0
  13. package/deployments/basesepolia/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump25000bps_timeBased.json +552 -0
  14. package/deployments/basesepolia/solcInputs/2779d74bb5f3dd850decc06e31b696d8.json +457 -0
  15. package/deployments/basesepolia.json +352 -0
  16. package/deployments/basesepolia_addresses.json +1 -0
  17. package/deployments/bscmainnet/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy21024000.json +608 -0
  18. package/deployments/bscmainnet/JumpRateModelV2_base200bps_slope1000bps_jump25000bps_kink8000bps_bpy21024000.json +608 -0
  19. package/deployments/bscmainnet/solcInputs/e39e34c59c5bc8d293cb758a621be058.json +460 -0
  20. package/deployments/bscmainnet.json +797 -151
  21. package/deployments/bscmainnet_addresses.json +2 -1
  22. package/deployments/bsctestnet/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy21024000.json +608 -0
  23. package/deployments/bsctestnet/JumpRateModelV2_base200bps_slope1000bps_jump25000bps_kink7000bps_bpy21024000.json +608 -0
  24. package/deployments/bsctestnet/JumpRateModelV2_base200bps_slope1000bps_jump25000bps_kink8000bps_bpy21024000.json +608 -0
  25. package/deployments/bsctestnet/JumpRateModelV2_base200bps_slope1000bps_jump30000bps_kink5000bps_bpy21024000.json +608 -0
  26. package/deployments/bsctestnet/JumpRateModelV2_base200bps_slope1000bps_jump30000bps_kink7000bps_bpy21024000.json +608 -0
  27. package/deployments/bsctestnet/solcInputs/2779d74bb5f3dd850decc06e31b696d8.json +457 -0
  28. package/deployments/bsctestnet.json +1826 -26
  29. package/deployments/bsctestnet_addresses.json +5 -0
  30. package/deployments/ethereum/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy2628000.json +17 -17
  31. package/deployments/ethereum/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink9200bps_bpy2628000.json +608 -0
  32. package/deployments/ethereum/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_bpy2628000.json +552 -0
  33. package/deployments/ethereum/solcInputs/e39e34c59c5bc8d293cb758a621be058.json +460 -0
  34. package/deployments/ethereum.json +1644 -932
  35. package/deployments/ethereum_addresses.json +3 -1
  36. package/deployments/opbnbmainnet/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy63072000.json +608 -0
  37. package/deployments/opbnbmainnet/solcInputs/e39e34c59c5bc8d293cb758a621be058.json +460 -0
  38. package/deployments/opbnbmainnet.json +360 -0
  39. package/deployments/opbnbmainnet_addresses.json +1 -0
  40. package/deployments/opbnbtestnet/JumpRateModelV2_base0bps_slope1000bps_jump8000bps_kink8000bps_bpy63072000.json +608 -0
  41. package/deployments/opbnbtestnet/solcInputs/2779d74bb5f3dd850decc06e31b696d8.json +457 -0
  42. package/deployments/opbnbtestnet.json +360 -0
  43. package/deployments/opbnbtestnet_addresses.json +1 -0
  44. package/deployments/sepolia/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink8000bps_bpy2628000.json +22 -22
  45. package/deployments/sepolia/JumpRateModelV2_base0bps_slope1000bps_jump25000bps_kink9200bps_bpy2628000.json +608 -0
  46. package/deployments/sepolia/JumpRateModelV2_base0bps_slope1000bps_jump30000bps_kink8000bps_bpy2628000.json +608 -0
  47. package/deployments/sepolia/JumpRateModelV2_base0bps_slope1000bps_jump8000bps_kink8000bps_bpy2628000.json +608 -0
  48. package/deployments/sepolia/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump8000bps_bpy2628000.json +552 -0
  49. package/deployments/sepolia/solcInputs/2779d74bb5f3dd850decc06e31b696d8.json +457 -0
  50. package/deployments/sepolia.json +3177 -1745
  51. package/deployments/sepolia_addresses.json +5 -1
  52. package/deployments/unichainmainnet/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_timeBased.json +552 -0
  53. package/deployments/unichainmainnet/solcInputs/e39e34c59c5bc8d293cb758a621be058.json +460 -0
  54. package/deployments/unichainmainnet.json +352 -0
  55. package/deployments/unichainmainnet_addresses.json +1 -0
  56. package/deployments/unichainsepolia/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump25000bps_timeBased.json +552 -0
  57. package/deployments/unichainsepolia/solcInputs/2779d74bb5f3dd850decc06e31b696d8.json +457 -0
  58. package/deployments/unichainsepolia.json +352 -0
  59. package/deployments/unichainsepolia_addresses.json +1 -0
  60. package/deployments/zksyncmainnet/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump30000bps_timeBased.json +651 -0
  61. package/deployments/zksyncmainnet/solcInputs/7d5e24cf7eed31f5c766d099cfd34b80.json +454 -0
  62. package/deployments/zksyncmainnet.json +352 -0
  63. package/deployments/zksyncmainnet_addresses.json +1 -0
  64. package/deployments/zksyncsepolia/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump25000bps_timeBased.json +651 -0
  65. package/deployments/zksyncsepolia/TwoKinks_base0bps_slope1000bps_kink8000bps_slope27000bps_base20bps_kink29000bps_jump8000bps_timeBased.json +613 -0
  66. package/deployments/zksyncsepolia/solcInputs/7d5e24cf7eed31f5c766d099cfd34b80.json +454 -0
  67. package/deployments/zksyncsepolia.json +704 -0
  68. package/deployments/zksyncsepolia_addresses.json +2 -0
  69. package/dist/deployments/arbitrumone.json +352 -0
  70. package/dist/deployments/arbitrumsepolia.json +352 -0
  71. package/dist/deployments/basemainnet.json +352 -0
  72. package/dist/deployments/basesepolia.json +352 -0
  73. package/dist/deployments/bscmainnet.json +797 -151
  74. package/dist/deployments/bsctestnet.json +1826 -26
  75. package/dist/deployments/ethereum.json +1644 -932
  76. package/dist/deployments/opbnbmainnet.json +360 -0
  77. package/dist/deployments/opbnbtestnet.json +360 -0
  78. package/dist/deployments/sepolia.json +3177 -1745
  79. package/dist/deployments/unichainmainnet.json +352 -0
  80. package/dist/deployments/unichainsepolia.json +352 -0
  81. package/dist/deployments/zksyncmainnet.json +352 -0
  82. package/dist/deployments/zksyncsepolia.json +704 -0
  83. package/dist/helpers/deploymentConfig.js +112 -79
  84. package/dist/typechain/factories/PoolRegistryInterface__factory.d.ts +16 -2
  85. package/dist/typechain/factories/PoolRegistryInterface__factory.js +119 -0
  86. package/package.json +1 -1
  87. package/typechain/PoolRegistryInterface.d.ts +178 -0
  88. package/typechain/factories/PoolRegistryInterface__factory.ts +119 -0
  89. package/deployments/bscmainnet/VToken_vHAY_Stablecoins.json +0 -246
@@ -0,0 +1,552 @@
1
+ {
2
+ "address": "0x2D5bF63B6E72bBf9e0222BbA3d170f45fc9549E7",
3
+ "abi": [
4
+ {
5
+ "inputs": [
6
+ {
7
+ "internalType": "int256",
8
+ "name": "baseRatePerYear_",
9
+ "type": "int256"
10
+ },
11
+ {
12
+ "internalType": "int256",
13
+ "name": "multiplierPerYear_",
14
+ "type": "int256"
15
+ },
16
+ {
17
+ "internalType": "int256",
18
+ "name": "kink1_",
19
+ "type": "int256"
20
+ },
21
+ {
22
+ "internalType": "int256",
23
+ "name": "multiplier2PerYear_",
24
+ "type": "int256"
25
+ },
26
+ {
27
+ "internalType": "int256",
28
+ "name": "baseRate2PerYear_",
29
+ "type": "int256"
30
+ },
31
+ {
32
+ "internalType": "int256",
33
+ "name": "kink2_",
34
+ "type": "int256"
35
+ },
36
+ {
37
+ "internalType": "int256",
38
+ "name": "jumpMultiplierPerYear_",
39
+ "type": "int256"
40
+ },
41
+ {
42
+ "internalType": "bool",
43
+ "name": "timeBased_",
44
+ "type": "bool"
45
+ },
46
+ {
47
+ "internalType": "uint256",
48
+ "name": "blocksPerYear_",
49
+ "type": "uint256"
50
+ }
51
+ ],
52
+ "stateMutability": "nonpayable",
53
+ "type": "constructor"
54
+ },
55
+ {
56
+ "inputs": [],
57
+ "name": "InvalidBlocksPerYear",
58
+ "type": "error"
59
+ },
60
+ {
61
+ "inputs": [],
62
+ "name": "InvalidKink",
63
+ "type": "error"
64
+ },
65
+ {
66
+ "inputs": [],
67
+ "name": "InvalidTimeBasedConfiguration",
68
+ "type": "error"
69
+ },
70
+ {
71
+ "inputs": [],
72
+ "name": "NegativeValueNotAllowed",
73
+ "type": "error"
74
+ },
75
+ {
76
+ "inputs": [],
77
+ "name": "BASE_RATE_2_PER_BLOCK_OR_SECOND",
78
+ "outputs": [
79
+ {
80
+ "internalType": "int256",
81
+ "name": "",
82
+ "type": "int256"
83
+ }
84
+ ],
85
+ "stateMutability": "view",
86
+ "type": "function"
87
+ },
88
+ {
89
+ "inputs": [],
90
+ "name": "BASE_RATE_PER_BLOCK_OR_SECOND",
91
+ "outputs": [
92
+ {
93
+ "internalType": "int256",
94
+ "name": "",
95
+ "type": "int256"
96
+ }
97
+ ],
98
+ "stateMutability": "view",
99
+ "type": "function"
100
+ },
101
+ {
102
+ "inputs": [],
103
+ "name": "JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND",
104
+ "outputs": [
105
+ {
106
+ "internalType": "int256",
107
+ "name": "",
108
+ "type": "int256"
109
+ }
110
+ ],
111
+ "stateMutability": "view",
112
+ "type": "function"
113
+ },
114
+ {
115
+ "inputs": [],
116
+ "name": "KINK_1",
117
+ "outputs": [
118
+ {
119
+ "internalType": "int256",
120
+ "name": "",
121
+ "type": "int256"
122
+ }
123
+ ],
124
+ "stateMutability": "view",
125
+ "type": "function"
126
+ },
127
+ {
128
+ "inputs": [],
129
+ "name": "KINK_2",
130
+ "outputs": [
131
+ {
132
+ "internalType": "int256",
133
+ "name": "",
134
+ "type": "int256"
135
+ }
136
+ ],
137
+ "stateMutability": "view",
138
+ "type": "function"
139
+ },
140
+ {
141
+ "inputs": [],
142
+ "name": "MULTIPLIER_2_PER_BLOCK_OR_SECOND",
143
+ "outputs": [
144
+ {
145
+ "internalType": "int256",
146
+ "name": "",
147
+ "type": "int256"
148
+ }
149
+ ],
150
+ "stateMutability": "view",
151
+ "type": "function"
152
+ },
153
+ {
154
+ "inputs": [],
155
+ "name": "MULTIPLIER_PER_BLOCK_OR_SECOND",
156
+ "outputs": [
157
+ {
158
+ "internalType": "int256",
159
+ "name": "",
160
+ "type": "int256"
161
+ }
162
+ ],
163
+ "stateMutability": "view",
164
+ "type": "function"
165
+ },
166
+ {
167
+ "inputs": [],
168
+ "name": "RATE_1",
169
+ "outputs": [
170
+ {
171
+ "internalType": "int256",
172
+ "name": "",
173
+ "type": "int256"
174
+ }
175
+ ],
176
+ "stateMutability": "view",
177
+ "type": "function"
178
+ },
179
+ {
180
+ "inputs": [],
181
+ "name": "RATE_2",
182
+ "outputs": [
183
+ {
184
+ "internalType": "int256",
185
+ "name": "",
186
+ "type": "int256"
187
+ }
188
+ ],
189
+ "stateMutability": "view",
190
+ "type": "function"
191
+ },
192
+ {
193
+ "inputs": [],
194
+ "name": "blocksOrSecondsPerYear",
195
+ "outputs": [
196
+ {
197
+ "internalType": "uint256",
198
+ "name": "",
199
+ "type": "uint256"
200
+ }
201
+ ],
202
+ "stateMutability": "view",
203
+ "type": "function"
204
+ },
205
+ {
206
+ "inputs": [],
207
+ "name": "getBlockNumberOrTimestamp",
208
+ "outputs": [
209
+ {
210
+ "internalType": "uint256",
211
+ "name": "",
212
+ "type": "uint256"
213
+ }
214
+ ],
215
+ "stateMutability": "view",
216
+ "type": "function"
217
+ },
218
+ {
219
+ "inputs": [
220
+ {
221
+ "internalType": "uint256",
222
+ "name": "cash",
223
+ "type": "uint256"
224
+ },
225
+ {
226
+ "internalType": "uint256",
227
+ "name": "borrows",
228
+ "type": "uint256"
229
+ },
230
+ {
231
+ "internalType": "uint256",
232
+ "name": "reserves",
233
+ "type": "uint256"
234
+ },
235
+ {
236
+ "internalType": "uint256",
237
+ "name": "badDebt",
238
+ "type": "uint256"
239
+ }
240
+ ],
241
+ "name": "getBorrowRate",
242
+ "outputs": [
243
+ {
244
+ "internalType": "uint256",
245
+ "name": "",
246
+ "type": "uint256"
247
+ }
248
+ ],
249
+ "stateMutability": "view",
250
+ "type": "function"
251
+ },
252
+ {
253
+ "inputs": [
254
+ {
255
+ "internalType": "uint256",
256
+ "name": "cash",
257
+ "type": "uint256"
258
+ },
259
+ {
260
+ "internalType": "uint256",
261
+ "name": "borrows",
262
+ "type": "uint256"
263
+ },
264
+ {
265
+ "internalType": "uint256",
266
+ "name": "reserves",
267
+ "type": "uint256"
268
+ },
269
+ {
270
+ "internalType": "uint256",
271
+ "name": "reserveFactorMantissa",
272
+ "type": "uint256"
273
+ },
274
+ {
275
+ "internalType": "uint256",
276
+ "name": "badDebt",
277
+ "type": "uint256"
278
+ }
279
+ ],
280
+ "name": "getSupplyRate",
281
+ "outputs": [
282
+ {
283
+ "internalType": "uint256",
284
+ "name": "",
285
+ "type": "uint256"
286
+ }
287
+ ],
288
+ "stateMutability": "view",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [],
293
+ "name": "isInterestRateModel",
294
+ "outputs": [
295
+ {
296
+ "internalType": "bool",
297
+ "name": "",
298
+ "type": "bool"
299
+ }
300
+ ],
301
+ "stateMutability": "pure",
302
+ "type": "function"
303
+ },
304
+ {
305
+ "inputs": [],
306
+ "name": "isTimeBased",
307
+ "outputs": [
308
+ {
309
+ "internalType": "bool",
310
+ "name": "",
311
+ "type": "bool"
312
+ }
313
+ ],
314
+ "stateMutability": "view",
315
+ "type": "function"
316
+ },
317
+ {
318
+ "inputs": [
319
+ {
320
+ "internalType": "uint256",
321
+ "name": "cash",
322
+ "type": "uint256"
323
+ },
324
+ {
325
+ "internalType": "uint256",
326
+ "name": "borrows",
327
+ "type": "uint256"
328
+ },
329
+ {
330
+ "internalType": "uint256",
331
+ "name": "reserves",
332
+ "type": "uint256"
333
+ },
334
+ {
335
+ "internalType": "uint256",
336
+ "name": "badDebt",
337
+ "type": "uint256"
338
+ }
339
+ ],
340
+ "name": "utilizationRate",
341
+ "outputs": [
342
+ {
343
+ "internalType": "uint256",
344
+ "name": "",
345
+ "type": "uint256"
346
+ }
347
+ ],
348
+ "stateMutability": "pure",
349
+ "type": "function"
350
+ }
351
+ ],
352
+ "transactionHash": "0xe054c65b4b48761b0a428d8ad1021d38f54e5fce91f5e843e472c7ef4e77ab9f",
353
+ "receipt": {
354
+ "to": null,
355
+ "from": "0x2816CB0001234d2539999730E8A9CD65D7f7212b",
356
+ "contractAddress": "0x2D5bF63B6E72bBf9e0222BbA3d170f45fc9549E7",
357
+ "transactionIndex": 30,
358
+ "gasUsed": "537685",
359
+ "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
360
+ "blockHash": "0x37e130fc00daac7c5fad779036f785fdb2617897b606480e6e35765d2fee5102",
361
+ "transactionHash": "0xe054c65b4b48761b0a428d8ad1021d38f54e5fce91f5e843e472c7ef4e77ab9f",
362
+ "logs": [],
363
+ "blockNumber": 22593894,
364
+ "cumulativeGasUsed": "6844329",
365
+ "status": 1,
366
+ "byzantium": true
367
+ },
368
+ "args": [
369
+ "0",
370
+ "100000000000000000",
371
+ "800000000000000000",
372
+ "700000000000000000",
373
+ "0",
374
+ "900000000000000000",
375
+ "3000000000000000000",
376
+ false,
377
+ 2628000
378
+ ],
379
+ "numDeployments": 1,
380
+ "solcInputHash": "e39e34c59c5bc8d293cb758a621be058",
381
+ "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"int256\",\"name\":\"baseRatePerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplierPerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink1_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"multiplier2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"baseRate2PerYear_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"kink2_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"jumpMultiplierPerYear_\",\"type\":\"int256\"},{\"internalType\":\"bool\",\"name\":\"timeBased_\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"blocksPerYear_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InvalidBlocksPerYear\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidKink\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidTimeBasedConfiguration\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NegativeValueNotAllowed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BASE_RATE_2_PER_BLOCK_OR_SECOND\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"BASE_RATE_PER_BLOCK_OR_SECOND\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"KINK_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_2_PER_BLOCK_OR_SECOND\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MULTIPLIER_PER_BLOCK_OR_SECOND\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"blocksOrSecondsPerYear\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockNumberOrTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"badDebt\",\"type\":\"uint256\"}],\"name\":\"getBorrowRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserveFactorMantissa\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"badDebt\",\"type\":\"uint256\"}],\"name\":\"getSupplyRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isInterestRateModel\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isTimeBased\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"cash\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"borrows\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"reserves\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"badDebt\",\"type\":\"uint256\"}],\"name\":\"utilizationRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Venus\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"params\":{\"baseRate2PerYear_\":\"The additonal base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\",\"baseRatePerYear_\":\"The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\",\"blocksPerYear_\":\"The number of blocks per year\",\"jumpMultiplierPerYear_\":\"The multiplier after hitting KINK_2\",\"kink1_\":\"The utilization point at which the multiplier2 is applied\",\"kink2_\":\"The utilization point at which the jump multiplier is applied\",\"multiplier2PerYear_\":\"The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\",\"multiplierPerYear_\":\"The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\",\"timeBased_\":\"A boolean indicating whether the contract is based on time or block.\"}},\"getBlockNumberOrTimestamp()\":{\"details\":\"Function to simply retrieve block number or block timestamp\",\"returns\":{\"_0\":\"Current block number or block timestamp\"}},\"getBorrowRate(uint256,uint256,uint256,uint256)\":{\"params\":{\"badDebt\":\"The amount of badDebt in the market\",\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The borrow rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\"}},\"getSupplyRate(uint256,uint256,uint256,uint256,uint256)\":{\"params\":{\"badDebt\":\"The amount of badDebt in the market\",\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserveFactorMantissa\":\"The current reserve factor for the market\",\"reserves\":\"The amount of reserves in the market\"},\"returns\":{\"_0\":\"The supply rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\"}},\"isInterestRateModel()\":{\"returns\":{\"_0\":\"Always true\"}},\"utilizationRate(uint256,uint256,uint256,uint256)\":{\"params\":{\"badDebt\":\"The amount of badDebt in the market\",\"borrows\":\"The amount of borrows in the market\",\"cash\":\"The amount of cash in the market\",\"reserves\":\"The amount of reserves in the market (currently unused)\"},\"returns\":{\"_0\":\"The utilization rate as a mantissa between [0, MANTISSA_ONE]\"}}},\"title\":\"TwoKinksInterestRateModel\",\"version\":1},\"userdoc\":{\"errors\":{\"InvalidBlocksPerYear()\":[{\"notice\":\"Thrown when blocks per year is invalid\"}],\"InvalidKink()\":[{\"notice\":\"Thrown when the kink points are not in the correct order\"}],\"InvalidTimeBasedConfiguration()\":[{\"notice\":\"Thrown when time based but blocks per year is provided\"}],\"NegativeValueNotAllowed()\":[{\"notice\":\"Thrown when a negative value is not allowed\"}]},\"kind\":\"user\",\"methods\":{\"BASE_RATE_2_PER_BLOCK_OR_SECOND()\":{\"notice\":\"The base interest rate per block or second which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\"},\"BASE_RATE_PER_BLOCK_OR_SECOND()\":{\"notice\":\"The base interest rate per block or second which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\"},\"JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND()\":{\"notice\":\"The multiplier of utilization rate per block or second that gives the slope 3 of interest rate scaled by EXP_SCALE\"},\"KINK_1()\":{\"notice\":\"The utilization point at which the multiplier2 is applied\"},\"KINK_2()\":{\"notice\":\"The utilization point at which the jump multiplier is applied\"},\"MULTIPLIER_2_PER_BLOCK_OR_SECOND()\":{\"notice\":\"The multiplier of utilization rate per block or second that gives the slope 2 of the interest rate scaled by EXP_SCALE\"},\"MULTIPLIER_PER_BLOCK_OR_SECOND()\":{\"notice\":\"The multiplier of utilization rate per block or second that gives the slope 1 of the interest rate scaled by EXP_SCALE\"},\"RATE_1()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"RATE_2()\":{\"notice\":\"The maximum kink interest rate scaled by EXP_SCALE\"},\"blocksOrSecondsPerYear()\":{\"notice\":\"Stores blocksPerYear if isTimeBased is true else secondsPerYear is stored\"},\"constructor\":{\"notice\":\"Construct an interest rate model\"},\"getBorrowRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current borrow rate per slot (block or second)\"},\"getSupplyRate(uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the current supply rate per slot (block or second)\"},\"isInterestRateModel()\":{\"notice\":\"Indicator that this is an InterestRateModel contract (for inspection)\"},\"isTimeBased()\":{\"notice\":\"Acknowledges if a contract is time based or not\"},\"utilizationRate(uint256,uint256,uint256,uint256)\":{\"notice\":\"Calculates the utilization rate of the market: `(borrows + badDebt) / (cash + borrows + badDebt - reserves)`\"}},\"notice\":\"An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TwoKinksInterestRateModel.sol\":\"TwoKinksInterestRateModel\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@venusprotocol/solidity-utilities/contracts/TimeManagerV8.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { SECONDS_PER_YEAR } from \\\"./constants.sol\\\";\\n\\nabstract contract TimeManagerV8 {\\n /// @notice Stores blocksPerYear if isTimeBased is true else secondsPerYear is stored\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n uint256 public immutable blocksOrSecondsPerYear;\\n\\n /// @notice Acknowledges if a contract is time based or not\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n bool public immutable isTimeBased;\\n\\n /// @notice Stores the current block timestamp or block number depending on isTimeBased\\n /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n function() view returns (uint256) private immutable _getCurrentSlot;\\n\\n /**\\n * @dev This empty reserved space is put in place to allow future versions to add new\\n * variables without shifting down storage in the inheritance chain\\n * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n */\\n uint256[48] private __gap;\\n\\n /// @notice Thrown when blocks per year is invalid\\n error InvalidBlocksPerYear();\\n\\n /// @notice Thrown when time based but blocks per year is provided\\n error InvalidTimeBasedConfiguration();\\n\\n /**\\n * @param timeBased_ A boolean indicating whether the contract is based on time or block\\n * If timeBased is true than blocksPerYear_ param is ignored as blocksOrSecondsPerYear is set to SECONDS_PER_YEAR\\n * @param blocksPerYear_ The number of blocks per year\\n * @custom:error InvalidBlocksPerYear is thrown if blocksPerYear entered is zero and timeBased is false\\n * @custom:error InvalidTimeBasedConfiguration is thrown if blocksPerYear entered is non zero and timeBased is true\\n * @custom:oz-upgrades-unsafe-allow constructor\\n */\\n constructor(bool timeBased_, uint256 blocksPerYear_) {\\n if (!timeBased_ && blocksPerYear_ == 0) {\\n revert InvalidBlocksPerYear();\\n }\\n\\n if (timeBased_ && blocksPerYear_ != 0) {\\n revert InvalidTimeBasedConfiguration();\\n }\\n\\n isTimeBased = timeBased_;\\n blocksOrSecondsPerYear = timeBased_ ? SECONDS_PER_YEAR : blocksPerYear_;\\n _getCurrentSlot = timeBased_ ? _getBlockTimestamp : _getBlockNumber;\\n }\\n\\n /**\\n * @dev Function to simply retrieve block number or block timestamp\\n * @return Current block number or block timestamp\\n */\\n function getBlockNumberOrTimestamp() public view virtual returns (uint256) {\\n return _getCurrentSlot();\\n }\\n\\n /**\\n * @dev Returns the current timestamp in seconds\\n * @return The current timestamp\\n */\\n function _getBlockTimestamp() private view returns (uint256) {\\n return block.timestamp;\\n }\\n\\n /**\\n * @dev Returns the current block number\\n * @return The current block number\\n */\\n function _getBlockNumber() private view returns (uint256) {\\n return block.number;\\n }\\n}\\n\",\"keccak256\":\"0x57a2bbb9b8e02b1c0a5c0e305fef1328a22db56c3d4b148c362010a6e767243c\",\"license\":\"BSD-3-Clause\"},\"@venusprotocol/solidity-utilities/contracts/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\",\"keccak256\":\"0x14de93ead464da249af31bea0e3bcfb62ec693bea3475fb4d90f055ac81dc5eb\",\"license\":\"BSD-3-Clause\"},\"contracts/InterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\n/**\\n * @title Compound's InterestRateModel Interface\\n * @author Compound\\n */\\nabstract contract InterestRateModel {\\n /**\\n * @notice Calculates the current borrow interest rate per slot (block or second)\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amount of reserves the market has\\n * @param badDebt The amount of badDebt in the market\\n * @return The borrow rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getBorrowRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 badDebt\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @notice Calculates the current supply interest rate per slot (block or second)\\n * @param cash The total amount of cash the market has\\n * @param borrows The total amount of borrows the market has outstanding\\n * @param reserves The total amount of reserves the market has\\n * @param reserveFactorMantissa The current reserve factor the market has\\n * @param badDebt The amount of badDebt in the market\\n * @return The supply rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa,\\n uint256 badDebt\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @notice Indicator that this is an InterestRateModel contract (for inspection)\\n * @return Always true\\n */\\n function isInterestRateModel() external pure virtual returns (bool) {\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xc4fda1ab75ebe4b187b707c4f10c58780f343cf343c537f641dc75d3cd28ab51\",\"license\":\"BSD-3-Clause\"},\"contracts/TwoKinksInterestRateModel.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity 0.8.25;\\n\\nimport { TimeManagerV8 } from \\\"@venusprotocol/solidity-utilities/contracts/TimeManagerV8.sol\\\";\\nimport { InterestRateModel } from \\\"./InterestRateModel.sol\\\";\\nimport { EXP_SCALE, MANTISSA_ONE } from \\\"./lib/constants.sol\\\";\\n\\n/**\\n * @title TwoKinksInterestRateModel\\n * @author Venus\\n * @notice An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.\\n */\\ncontract TwoKinksInterestRateModel is InterestRateModel, TimeManagerV8 {\\n ////////////////////// SLOPE 1 //////////////////////\\n\\n /**\\n * @notice The multiplier of utilization rate per block or second that gives the slope 1 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_PER_BLOCK_OR_SECOND;\\n\\n /**\\n * @notice The base interest rate per block or second which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_PER_BLOCK_OR_SECOND;\\n\\n ////////////////////// SLOPE 2 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the multiplier2 is applied\\n */\\n int256 public immutable KINK_1;\\n\\n /**\\n * @notice The multiplier of utilization rate per block or second that gives the slope 2 of the interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable MULTIPLIER_2_PER_BLOCK_OR_SECOND;\\n\\n /**\\n * @notice The base interest rate per block or second which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE\\n */\\n int256 public immutable BASE_RATE_2_PER_BLOCK_OR_SECOND;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_1;\\n\\n ////////////////////// SLOPE 3 //////////////////////\\n\\n /**\\n * @notice The utilization point at which the jump multiplier is applied\\n */\\n int256 public immutable KINK_2;\\n\\n /**\\n * @notice The multiplier of utilization rate per block or second that gives the slope 3 of interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND;\\n\\n /**\\n * @notice The maximum kink interest rate scaled by EXP_SCALE\\n */\\n int256 public immutable RATE_2;\\n\\n /**\\n * @notice Thrown when a negative value is not allowed\\n */\\n error NegativeValueNotAllowed();\\n\\n /**\\n * @notice Thrown when the kink points are not in the correct order\\n */\\n error InvalidKink();\\n\\n /**\\n * @notice Construct an interest rate model\\n * @param baseRatePerYear_ The approximate target base APR, as a mantissa (scaled by EXP_SCALE)\\n * @param multiplierPerYear_ The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)\\n * @param kink1_ The utilization point at which the multiplier2 is applied\\n * @param multiplier2PerYear_ The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)\\n * @param baseRate2PerYear_ The additonal base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)\\n * @param kink2_ The utilization point at which the jump multiplier is applied\\n * @param jumpMultiplierPerYear_ The multiplier after hitting KINK_2\\n * @param timeBased_ A boolean indicating whether the contract is based on time or block.\\n * @param blocksPerYear_ The number of blocks per year\\n */\\n constructor(\\n int256 baseRatePerYear_,\\n int256 multiplierPerYear_,\\n int256 kink1_,\\n int256 multiplier2PerYear_,\\n int256 baseRate2PerYear_,\\n int256 kink2_,\\n int256 jumpMultiplierPerYear_,\\n bool timeBased_,\\n uint256 blocksPerYear_\\n ) TimeManagerV8(timeBased_, blocksPerYear_) {\\n if (baseRatePerYear_ < 0 || baseRate2PerYear_ < 0) {\\n revert NegativeValueNotAllowed();\\n }\\n\\n if (kink2_ <= kink1_ || kink1_ <= 0) {\\n revert InvalidKink();\\n }\\n\\n int256 blocksOrSecondsPerYear_ = int256(blocksOrSecondsPerYear);\\n BASE_RATE_PER_BLOCK_OR_SECOND = baseRatePerYear_ / blocksOrSecondsPerYear_;\\n MULTIPLIER_PER_BLOCK_OR_SECOND = multiplierPerYear_ / blocksOrSecondsPerYear_;\\n KINK_1 = kink1_;\\n MULTIPLIER_2_PER_BLOCK_OR_SECOND = multiplier2PerYear_ / blocksOrSecondsPerYear_;\\n BASE_RATE_2_PER_BLOCK_OR_SECOND = baseRate2PerYear_ / blocksOrSecondsPerYear_;\\n KINK_2 = kink2_;\\n JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND = jumpMultiplierPerYear_ / blocksOrSecondsPerYear_;\\n\\n int256 expScale = int256(EXP_SCALE);\\n RATE_1 = (((KINK_1 * MULTIPLIER_PER_BLOCK_OR_SECOND) / expScale) + BASE_RATE_PER_BLOCK_OR_SECOND);\\n\\n int256 slope2Util;\\n unchecked {\\n slope2Util = KINK_2 - KINK_1;\\n }\\n RATE_2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK_OR_SECOND) / expScale) + BASE_RATE_2_PER_BLOCK_OR_SECOND;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block or second)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param badDebt The amount of badDebt in the market\\n * @return The borrow rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getBorrowRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 badDebt\\n ) external view override returns (uint256) {\\n return _getBorrowRate(cash, borrows, reserves, badDebt);\\n }\\n\\n /**\\n * @notice Calculates the current supply rate per slot (block or second)\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param reserveFactorMantissa The current reserve factor for the market\\n * @param badDebt The amount of badDebt in the market\\n * @return The supply rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\\n */\\n function getSupplyRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 reserveFactorMantissa,\\n uint256 badDebt\\n ) public view virtual override returns (uint256) {\\n uint256 oneMinusReserveFactor = MANTISSA_ONE - reserveFactorMantissa;\\n uint256 borrowRate = _getBorrowRate(cash, borrows, reserves, badDebt);\\n uint256 rateToPool = (borrowRate * oneMinusReserveFactor) / EXP_SCALE;\\n uint256 incomeToDistribute = borrows * rateToPool;\\n uint256 supply = cash + borrows + badDebt - reserves;\\n return incomeToDistribute / supply;\\n }\\n\\n /**\\n * @notice Calculates the utilization rate of the market: `(borrows + badDebt) / (cash + borrows + badDebt - reserves)`\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market (currently unused)\\n * @param badDebt The amount of badDebt in the market\\n * @return The utilization rate as a mantissa between [0, MANTISSA_ONE]\\n */\\n function utilizationRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 badDebt\\n ) public pure returns (uint256) {\\n // Utilization rate is 0 when there are no borrows and badDebt\\n if ((borrows + badDebt) == 0) {\\n return 0;\\n }\\n\\n uint256 rate = ((borrows + badDebt) * EXP_SCALE) / (cash + borrows + badDebt - reserves);\\n\\n if (rate > EXP_SCALE) {\\n rate = EXP_SCALE;\\n }\\n\\n return rate;\\n }\\n\\n /**\\n * @notice Calculates the current borrow rate per slot (block or second), with the error code expected by the market\\n * @param cash The amount of cash in the market\\n * @param borrows The amount of borrows in the market\\n * @param reserves The amount of reserves in the market\\n * @param badDebt The amount of badDebt in the market\\n * @return The borrow rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)\\n */\\n function _getBorrowRate(\\n uint256 cash,\\n uint256 borrows,\\n uint256 reserves,\\n uint256 badDebt\\n ) internal view returns (uint256) {\\n int256 util = int256(utilizationRate(cash, borrows, reserves, badDebt));\\n int256 expScale = int256(EXP_SCALE);\\n\\n if (util < KINK_1) {\\n return _minCap(((util * MULTIPLIER_PER_BLOCK_OR_SECOND) / expScale) + BASE_RATE_PER_BLOCK_OR_SECOND);\\n } else if (util < KINK_2) {\\n int256 slope2Util;\\n unchecked {\\n slope2Util = util - KINK_1;\\n }\\n int256 rate2 = ((slope2Util * MULTIPLIER_2_PER_BLOCK_OR_SECOND) / expScale) +\\n BASE_RATE_2_PER_BLOCK_OR_SECOND;\\n\\n return _minCap(RATE_1 + rate2);\\n } else {\\n int256 slope3Util;\\n unchecked {\\n slope3Util = util - KINK_2;\\n }\\n int256 rate3 = ((slope3Util * JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND) / expScale);\\n\\n return _minCap(RATE_1 + RATE_2 + rate3);\\n }\\n }\\n\\n /**\\n * @notice Returns 0 if number is less than 0, otherwise returns the input\\n * @param number The first number\\n * @return The maximum of 0 and input number\\n */\\n function _minCap(int256 number) internal pure returns (uint256) {\\n int256 zero;\\n return uint256(number > zero ? number : zero);\\n }\\n}\\n\",\"keccak256\":\"0x4967cdef63fd2095fbaae94fd426d0900f8c785d64f135fe03a1f83ba290f9b6\",\"license\":\"BSD-3-Clause\"},\"contracts/lib/constants.sol\":{\"content\":\"// SPDX-License-Identifier: BSD-3-Clause\\npragma solidity ^0.8.25;\\n\\n/// @dev The approximate number of seconds per year\\nuint256 constant SECONDS_PER_YEAR = 31_536_000;\\n\\n/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)\\nuint256 constant EXP_SCALE = 1e18;\\n\\n/// @dev A unit (literal one) in EXP_SCALE, usually used in additions/subtractions\\nuint256 constant MANTISSA_ONE = EXP_SCALE;\\n\",\"keccak256\":\"0x54ab3a6f3bc87569ed12370f3470a1ec84cea9796d4d0ccf3d07dd4280c044aa\",\"license\":\"BSD-3-Clause\"}},\"version\":1}",
382
+ "bytecode": "0x61020060405234801561001157600080fd5b50604051610ca8380380610ca883398101604081905261003091610209565b81818115801561003e575080155b1561005c576040516302723dfb60e21b815260040160405180910390fd5b81801561006857508015155b156100865760405163ae0fcab360e01b815260040160405180910390fd5b81151560a05281610097578061009d565b6301e133805b608052816100b45761020160201b610480176100bf565b61020560201b610484175b6001600160401b031660c052505060008912806100dc5750600085125b156100fa576040516341820e7560e11b815260040160405180910390fd5b868413158061010a575060008713155b1561012857604051637099641d60e11b815260040160405180910390fd5b608051610135818b610298565b61010052610143818a610298565b60e0526101208890526101568188610298565b610140526101648187610298565b610160526101a08590526101788185610298565b6101c0526101005160e05161012051670de0b6b3a76400009291839161019e91906102d4565b6101a89190610298565b6101b2919061030a565b61018052610120516101a0516101605161014051929091039183906101d790846102d4565b6101e19190610298565b6101eb919061030a565b6101e052506103329a5050505050505050505050565b4390565b4290565b60008060008060008060008060006101208a8c03121561022857600080fd5b8951985060208a0151975060408a0151965060608a0151955060808a0151945060a08a0151935060c08a0151925060e08a0151801515811461026957600080fd5b809250506101008a015190509295985092959850929598565b634e487b7160e01b600052601160045260246000fd5b6000826102b557634e487b7160e01b600052601260045260246000fd5b600160ff1b8214600019841416156102cf576102cf610282565b500590565b80820260008212600160ff1b841416156102f0576102f0610282565b818105831482151761030457610304610282565b92915050565b808201828112600083128015821682158216171561032a5761032a610282565b505092915050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051610891610417600039600081816102180152610687015260008181610169015261064d0152600081816101ca0152818161053d0152610624015260008181610109015281816105f301526106a80152600081816102c7015261058a0152600081816102f601526105af0152600081816101f1015281816104a401526105650152600081816101a301526104cf01526000818161027901526104f401526000610454015260006102a00152600061023f01526108916000f3fe608060405234801561001057600080fd5b50600436106100ff5760003560e01c80635d0054c411610097578063c7ad089511610066578063c7ad08951461029b578063d783c4c8146102c2578063e1d146fb146102e9578063ef882f19146102f157600080fd5b80635d0054c4146102135780636857249c1461023a57806370d3c43f14610261578063a22ed0f81461027457600080fd5b80632191f92a116100d35780632191f92a1461018b57806333da32671461019e57806338afe9c4146101c55780633b53e888146101ec57600080fd5b8062084e8914610104578063073b8a741461013e5780630cde8d1c1461015157806310c68e4b14610164575b600080fd5b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61012b61014c3660046106e5565b610318565b61012b61015f366004610717565b610331565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b60015b6040519015158152602001610135565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b61026f3660046106e5565b6103c4565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b61044d565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b600061032685858585610488565b90505b949350505050565b60008061034684670de0b6b3a7640000610768565b9050600061035688888887610488565b90506000670de0b6b3a764000061036d8484610781565b61037791906107ae565b90506000610385828a610781565b9050600088876103958c8e6107c2565b61039f91906107c2565b6103a99190610768565b90506103b581836107ae565b9b9a5050505050505050505050565b60006103d082856107c2565b6000036103df57506000610329565b600083836103ed87896107c2565b6103f791906107c2565b6104019190610768565b670de0b6b3a764000061041485886107c2565b61041e9190610781565b61042891906107ae565b9050670de0b6b3a76400008111156103265750670de0b6b3a764000095945050505050565b600061047b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff16565b905090565b4390565b4290565b600080610497868686866103c4565b9050670de0b6b3a76400007f000000000000000000000000000000000000000000000000000000000000000082121561053b576105327f0000000000000000000000000000000000000000000000000000000000000000826105197f0000000000000000000000000000000000000000000000000000000000000000866107d5565b6105239190610805565b61052d9190610833565b6106cc565b92505050610329565b7f0000000000000000000000000000000000000000000000000000000000000000821215610622577f0000000000000000000000000000000000000000000000000000000000000000820360007f0000000000000000000000000000000000000000000000000000000000000000836105d47f0000000000000000000000000000000000000000000000000000000000000000856107d5565b6105de9190610805565b6105e89190610833565b905061061761052d827f0000000000000000000000000000000000000000000000000000000000000000610833565b945050505050610329565b7f000000000000000000000000000000000000000000000000000000000000000082036000826106727f0000000000000000000000000000000000000000000000000000000000000000846107d5565b61067c9190610805565b9050610617816105237f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610833565b6000808083136106dc57806106de565b825b9392505050565b600080600080608085870312156106fb57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080600060a0868803121561072f57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561077b5761077b610752565b92915050565b808202811582820484141761077b5761077b610752565b634e487b7160e01b600052601260045260246000fd5b6000826107bd576107bd610798565b500490565b8082018082111561077b5761077b610752565b80820260008212600160ff1b841416156107f1576107f1610752565b818105831482151761077b5761077b610752565b60008261081457610814610798565b600160ff1b82146000198414161561082e5761082e610752565b500590565b808201828112600083128015821682158216171561085357610853610752565b50509291505056fea264697066735822122041efee9a74a0a97d8aa0303dcaa41d2664d817542f0d86ea7ea347b935e7418464736f6c63430008190033",
383
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c80635d0054c411610097578063c7ad089511610066578063c7ad08951461029b578063d783c4c8146102c2578063e1d146fb146102e9578063ef882f19146102f157600080fd5b80635d0054c4146102135780636857249c1461023a57806370d3c43f14610261578063a22ed0f81461027457600080fd5b80632191f92a116100d35780632191f92a1461018b57806333da32671461019e57806338afe9c4146101c55780633b53e888146101ec57600080fd5b8062084e8914610104578063073b8a741461013e5780630cde8d1c1461015157806310c68e4b14610164575b600080fd5b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61012b61014c3660046106e5565b610318565b61012b61015f366004610717565b610331565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b60015b6040519015158152602001610135565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b61026f3660046106e5565b6103c4565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b61012b61044d565b61012b7f000000000000000000000000000000000000000000000000000000000000000081565b600061032685858585610488565b90505b949350505050565b60008061034684670de0b6b3a7640000610768565b9050600061035688888887610488565b90506000670de0b6b3a764000061036d8484610781565b61037791906107ae565b90506000610385828a610781565b9050600088876103958c8e6107c2565b61039f91906107c2565b6103a99190610768565b90506103b581836107ae565b9b9a5050505050505050505050565b60006103d082856107c2565b6000036103df57506000610329565b600083836103ed87896107c2565b6103f791906107c2565b6104019190610768565b670de0b6b3a764000061041485886107c2565b61041e9190610781565b61042891906107ae565b9050670de0b6b3a76400008111156103265750670de0b6b3a764000095945050505050565b600061047b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff16565b905090565b4390565b4290565b600080610497868686866103c4565b9050670de0b6b3a76400007f000000000000000000000000000000000000000000000000000000000000000082121561053b576105327f0000000000000000000000000000000000000000000000000000000000000000826105197f0000000000000000000000000000000000000000000000000000000000000000866107d5565b6105239190610805565b61052d9190610833565b6106cc565b92505050610329565b7f0000000000000000000000000000000000000000000000000000000000000000821215610622577f0000000000000000000000000000000000000000000000000000000000000000820360007f0000000000000000000000000000000000000000000000000000000000000000836105d47f0000000000000000000000000000000000000000000000000000000000000000856107d5565b6105de9190610805565b6105e89190610833565b905061061761052d827f0000000000000000000000000000000000000000000000000000000000000000610833565b945050505050610329565b7f000000000000000000000000000000000000000000000000000000000000000082036000826106727f0000000000000000000000000000000000000000000000000000000000000000846107d5565b61067c9190610805565b9050610617816105237f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610833565b6000808083136106dc57806106de565b825b9392505050565b600080600080608085870312156106fb57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080600060a0868803121561072f57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561077b5761077b610752565b92915050565b808202811582820484141761077b5761077b610752565b634e487b7160e01b600052601260045260246000fd5b6000826107bd576107bd610798565b500490565b8082018082111561077b5761077b610752565b80820260008212600160ff1b841416156107f1576107f1610752565b818105831482151761077b5761077b610752565b60008261081457610814610798565b600160ff1b82146000198414161561082e5761082e610752565b500590565b808201828112600083128015821682158216171561085357610853610752565b50509291505056fea264697066735822122041efee9a74a0a97d8aa0303dcaa41d2664d817542f0d86ea7ea347b935e7418464736f6c63430008190033",
384
+ "devdoc": {
385
+ "author": "Venus",
386
+ "kind": "dev",
387
+ "methods": {
388
+ "constructor": {
389
+ "params": {
390
+ "baseRate2PerYear_": "The additonal base APR after hitting KINK_1, as a mantissa (scaled by EXP_SCALE)",
391
+ "baseRatePerYear_": "The approximate target base APR, as a mantissa (scaled by EXP_SCALE)",
392
+ "blocksPerYear_": "The number of blocks per year",
393
+ "jumpMultiplierPerYear_": "The multiplier after hitting KINK_2",
394
+ "kink1_": "The utilization point at which the multiplier2 is applied",
395
+ "kink2_": "The utilization point at which the jump multiplier is applied",
396
+ "multiplier2PerYear_": "The rate of increase or decrease in interest rate wrt utilization after hitting KINK_1 (scaled by EXP_SCALE)",
397
+ "multiplierPerYear_": "The rate of increase or decrease in interest rate wrt utilization (scaled by EXP_SCALE)",
398
+ "timeBased_": "A boolean indicating whether the contract is based on time or block."
399
+ }
400
+ },
401
+ "getBlockNumberOrTimestamp()": {
402
+ "details": "Function to simply retrieve block number or block timestamp",
403
+ "returns": {
404
+ "_0": "Current block number or block timestamp"
405
+ }
406
+ },
407
+ "getBorrowRate(uint256,uint256,uint256,uint256)": {
408
+ "params": {
409
+ "badDebt": "The amount of badDebt in the market",
410
+ "borrows": "The amount of borrows in the market",
411
+ "cash": "The amount of cash in the market",
412
+ "reserves": "The amount of reserves in the market"
413
+ },
414
+ "returns": {
415
+ "_0": "The borrow rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)"
416
+ }
417
+ },
418
+ "getSupplyRate(uint256,uint256,uint256,uint256,uint256)": {
419
+ "params": {
420
+ "badDebt": "The amount of badDebt in the market",
421
+ "borrows": "The amount of borrows in the market",
422
+ "cash": "The amount of cash in the market",
423
+ "reserveFactorMantissa": "The current reserve factor for the market",
424
+ "reserves": "The amount of reserves in the market"
425
+ },
426
+ "returns": {
427
+ "_0": "The supply rate percentage per slot (block or second) as a mantissa (scaled by EXP_SCALE)"
428
+ }
429
+ },
430
+ "isInterestRateModel()": {
431
+ "returns": {
432
+ "_0": "Always true"
433
+ }
434
+ },
435
+ "utilizationRate(uint256,uint256,uint256,uint256)": {
436
+ "params": {
437
+ "badDebt": "The amount of badDebt in the market",
438
+ "borrows": "The amount of borrows in the market",
439
+ "cash": "The amount of cash in the market",
440
+ "reserves": "The amount of reserves in the market (currently unused)"
441
+ },
442
+ "returns": {
443
+ "_0": "The utilization rate as a mantissa between [0, MANTISSA_ONE]"
444
+ }
445
+ }
446
+ },
447
+ "title": "TwoKinksInterestRateModel",
448
+ "version": 1
449
+ },
450
+ "userdoc": {
451
+ "errors": {
452
+ "InvalidBlocksPerYear()": [
453
+ {
454
+ "notice": "Thrown when blocks per year is invalid"
455
+ }
456
+ ],
457
+ "InvalidKink()": [
458
+ {
459
+ "notice": "Thrown when the kink points are not in the correct order"
460
+ }
461
+ ],
462
+ "InvalidTimeBasedConfiguration()": [
463
+ {
464
+ "notice": "Thrown when time based but blocks per year is provided"
465
+ }
466
+ ],
467
+ "NegativeValueNotAllowed()": [
468
+ {
469
+ "notice": "Thrown when a negative value is not allowed"
470
+ }
471
+ ]
472
+ },
473
+ "kind": "user",
474
+ "methods": {
475
+ "BASE_RATE_2_PER_BLOCK_OR_SECOND()": {
476
+ "notice": "The base interest rate per block or second which is the y-intercept when utilization rate hits KINK_1 scaled by EXP_SCALE"
477
+ },
478
+ "BASE_RATE_PER_BLOCK_OR_SECOND()": {
479
+ "notice": "The base interest rate per block or second which is the y-intercept when utilization rate is 0 scaled by EXP_SCALE"
480
+ },
481
+ "JUMP_MULTIPLIER_PER_BLOCK_OR_SECOND()": {
482
+ "notice": "The multiplier of utilization rate per block or second that gives the slope 3 of interest rate scaled by EXP_SCALE"
483
+ },
484
+ "KINK_1()": {
485
+ "notice": "The utilization point at which the multiplier2 is applied"
486
+ },
487
+ "KINK_2()": {
488
+ "notice": "The utilization point at which the jump multiplier is applied"
489
+ },
490
+ "MULTIPLIER_2_PER_BLOCK_OR_SECOND()": {
491
+ "notice": "The multiplier of utilization rate per block or second that gives the slope 2 of the interest rate scaled by EXP_SCALE"
492
+ },
493
+ "MULTIPLIER_PER_BLOCK_OR_SECOND()": {
494
+ "notice": "The multiplier of utilization rate per block or second that gives the slope 1 of the interest rate scaled by EXP_SCALE"
495
+ },
496
+ "RATE_1()": {
497
+ "notice": "The maximum kink interest rate scaled by EXP_SCALE"
498
+ },
499
+ "RATE_2()": {
500
+ "notice": "The maximum kink interest rate scaled by EXP_SCALE"
501
+ },
502
+ "blocksOrSecondsPerYear()": {
503
+ "notice": "Stores blocksPerYear if isTimeBased is true else secondsPerYear is stored"
504
+ },
505
+ "constructor": {
506
+ "notice": "Construct an interest rate model"
507
+ },
508
+ "getBorrowRate(uint256,uint256,uint256,uint256)": {
509
+ "notice": "Calculates the current borrow rate per slot (block or second)"
510
+ },
511
+ "getSupplyRate(uint256,uint256,uint256,uint256,uint256)": {
512
+ "notice": "Calculates the current supply rate per slot (block or second)"
513
+ },
514
+ "isInterestRateModel()": {
515
+ "notice": "Indicator that this is an InterestRateModel contract (for inspection)"
516
+ },
517
+ "isTimeBased()": {
518
+ "notice": "Acknowledges if a contract is time based or not"
519
+ },
520
+ "utilizationRate(uint256,uint256,uint256,uint256)": {
521
+ "notice": "Calculates the utilization rate of the market: `(borrows + badDebt) / (cash + borrows + badDebt - reserves)`"
522
+ }
523
+ },
524
+ "notice": "An interest rate model with two different slope increase or decrease each after a certain utilization threshold called **kink** is reached.",
525
+ "version": 1
526
+ },
527
+ "storageLayout": {
528
+ "storage": [
529
+ {
530
+ "astId": 9747,
531
+ "contract": "contracts/TwoKinksInterestRateModel.sol:TwoKinksInterestRateModel",
532
+ "label": "__gap",
533
+ "offset": 0,
534
+ "slot": "0",
535
+ "type": "t_array(t_uint256)48_storage"
536
+ }
537
+ ],
538
+ "types": {
539
+ "t_array(t_uint256)48_storage": {
540
+ "base": "t_uint256",
541
+ "encoding": "inplace",
542
+ "label": "uint256[48]",
543
+ "numberOfBytes": "1536"
544
+ },
545
+ "t_uint256": {
546
+ "encoding": "inplace",
547
+ "label": "uint256",
548
+ "numberOfBytes": "32"
549
+ }
550
+ }
551
+ }
552
+ }