@gitmyabi/loanmanagerownable2stepwithshortcut 0.0.0-stage → 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.
- package/README.md +107 -2
- package/contracts/LoanManagerOwnable2StepWithShortcut.d.ts +2282 -0
- package/contracts/LoanManagerOwnable2StepWithShortcut.js +2256 -0
- package/contracts/LoanManagerOwnable2StepWithShortcut.ts +2981 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +40 -3
|
@@ -0,0 +1,2256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoanManagerOwnable2StepWithShortcut = exports.LoanManagerOwnable2StepWithShortcutAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* LoanManagerOwnable2StepWithShortcut ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.LoanManagerOwnable2StepWithShortcutAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address[]",
|
|
15
|
+
"name": "_executors",
|
|
16
|
+
"type": "address[]"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "address payable",
|
|
20
|
+
"name": "_wnative",
|
|
21
|
+
"type": "address"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"internalType": "Id",
|
|
25
|
+
"name": "_marketId",
|
|
26
|
+
"type": "bytes32"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"internalType": "uint256",
|
|
30
|
+
"name": "_minHealthFactor",
|
|
31
|
+
"type": "uint256"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"internalType": "contract IMorpho",
|
|
35
|
+
"name": "_morphoBlue",
|
|
36
|
+
"type": "address"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"internalType": "address",
|
|
40
|
+
"name": "_merkleDistributor",
|
|
41
|
+
"type": "address"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"stateMutability": "nonpayable",
|
|
45
|
+
"type": "constructor"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [
|
|
49
|
+
{
|
|
50
|
+
"internalType": "address",
|
|
51
|
+
"name": "owner",
|
|
52
|
+
"type": "address"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"name": "OwnableInvalidOwner",
|
|
56
|
+
"type": "error"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"inputs": [
|
|
60
|
+
{
|
|
61
|
+
"internalType": "address",
|
|
62
|
+
"name": "account",
|
|
63
|
+
"type": "address"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"name": "OwnableUnauthorizedAccount",
|
|
67
|
+
"type": "error"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"inputs": [
|
|
71
|
+
{
|
|
72
|
+
"internalType": "address",
|
|
73
|
+
"name": "token",
|
|
74
|
+
"type": "address"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"name": "SafeERC20FailedOperation",
|
|
78
|
+
"type": "error"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"anonymous": false,
|
|
82
|
+
"inputs": [
|
|
83
|
+
{
|
|
84
|
+
"indexed": true,
|
|
85
|
+
"internalType": "address",
|
|
86
|
+
"name": "token",
|
|
87
|
+
"type": "address"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"indexed": false,
|
|
91
|
+
"internalType": "address",
|
|
92
|
+
"name": "guy",
|
|
93
|
+
"type": "address"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"indexed": false,
|
|
97
|
+
"internalType": "uint256",
|
|
98
|
+
"name": "wad",
|
|
99
|
+
"type": "uint256"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"name": "ApproveToken",
|
|
103
|
+
"type": "event"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"anonymous": false,
|
|
107
|
+
"inputs": [
|
|
108
|
+
{
|
|
109
|
+
"indexed": true,
|
|
110
|
+
"internalType": "address",
|
|
111
|
+
"name": "caller",
|
|
112
|
+
"type": "address"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"indexed": false,
|
|
116
|
+
"internalType": "address[]",
|
|
117
|
+
"name": "tokens",
|
|
118
|
+
"type": "address[]"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"indexed": false,
|
|
122
|
+
"internalType": "uint256[]",
|
|
123
|
+
"name": "values",
|
|
124
|
+
"type": "uint256[]"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"name": "ClaimMerkleRewards",
|
|
128
|
+
"type": "event"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"anonymous": false,
|
|
132
|
+
"inputs": [
|
|
133
|
+
{
|
|
134
|
+
"indexed": true,
|
|
135
|
+
"internalType": "address",
|
|
136
|
+
"name": "executor",
|
|
137
|
+
"type": "address"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"indexed": false,
|
|
141
|
+
"internalType": "bool",
|
|
142
|
+
"name": "enabled",
|
|
143
|
+
"type": "bool"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"name": "ExecutorUpdated",
|
|
147
|
+
"type": "event"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"anonymous": false,
|
|
151
|
+
"inputs": [
|
|
152
|
+
{
|
|
153
|
+
"indexed": true,
|
|
154
|
+
"internalType": "address",
|
|
155
|
+
"name": "_to",
|
|
156
|
+
"type": "address"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"indexed": true,
|
|
160
|
+
"internalType": "address",
|
|
161
|
+
"name": "_asset_address",
|
|
162
|
+
"type": "address"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"indexed": false,
|
|
166
|
+
"internalType": "uint256",
|
|
167
|
+
"name": "amount",
|
|
168
|
+
"type": "uint256"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"name": "LogWithdraw",
|
|
172
|
+
"type": "event"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"anonymous": false,
|
|
176
|
+
"inputs": [
|
|
177
|
+
{
|
|
178
|
+
"indexed": true,
|
|
179
|
+
"internalType": "address",
|
|
180
|
+
"name": "previousOwner",
|
|
181
|
+
"type": "address"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"indexed": true,
|
|
185
|
+
"internalType": "address",
|
|
186
|
+
"name": "newOwner",
|
|
187
|
+
"type": "address"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"name": "OwnershipTransferStarted",
|
|
191
|
+
"type": "event"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"anonymous": false,
|
|
195
|
+
"inputs": [
|
|
196
|
+
{
|
|
197
|
+
"indexed": true,
|
|
198
|
+
"internalType": "address",
|
|
199
|
+
"name": "previousOwner",
|
|
200
|
+
"type": "address"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"indexed": true,
|
|
204
|
+
"internalType": "address",
|
|
205
|
+
"name": "newOwner",
|
|
206
|
+
"type": "address"
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
"name": "OwnershipTransferred",
|
|
210
|
+
"type": "event"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"anonymous": false,
|
|
214
|
+
"inputs": [
|
|
215
|
+
{
|
|
216
|
+
"indexed": true,
|
|
217
|
+
"internalType": "enum LoanManager.SnapshotUpdateAction",
|
|
218
|
+
"name": "action",
|
|
219
|
+
"type": "uint8"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"indexed": false,
|
|
223
|
+
"internalType": "uint256",
|
|
224
|
+
"name": "amount",
|
|
225
|
+
"type": "uint256"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"indexed": false,
|
|
229
|
+
"internalType": "address",
|
|
230
|
+
"name": "executor",
|
|
231
|
+
"type": "address"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"indexed": false,
|
|
235
|
+
"internalType": "address",
|
|
236
|
+
"name": "supplyToken",
|
|
237
|
+
"type": "address"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"indexed": false,
|
|
241
|
+
"internalType": "address",
|
|
242
|
+
"name": "borrowToken",
|
|
243
|
+
"type": "address"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"indexed": false,
|
|
247
|
+
"internalType": "uint256",
|
|
248
|
+
"name": "totalSupplied",
|
|
249
|
+
"type": "uint256"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"indexed": false,
|
|
253
|
+
"internalType": "uint256",
|
|
254
|
+
"name": "totalDebt",
|
|
255
|
+
"type": "uint256"
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"name": "SnapshotUpdate",
|
|
259
|
+
"type": "event"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"anonymous": false,
|
|
263
|
+
"inputs": [
|
|
264
|
+
{
|
|
265
|
+
"components": [
|
|
266
|
+
{
|
|
267
|
+
"internalType": "address",
|
|
268
|
+
"name": "supplyAddress",
|
|
269
|
+
"type": "address"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"internalType": "address",
|
|
273
|
+
"name": "borrowAddress",
|
|
274
|
+
"type": "address"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"internalType": "uint256",
|
|
278
|
+
"name": "minHealthFactor",
|
|
279
|
+
"type": "uint256"
|
|
280
|
+
}
|
|
281
|
+
],
|
|
282
|
+
"indexed": false,
|
|
283
|
+
"internalType": "struct ILoanManager.LoanConfig",
|
|
284
|
+
"name": "oldConfig",
|
|
285
|
+
"type": "tuple"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"components": [
|
|
289
|
+
{
|
|
290
|
+
"internalType": "address",
|
|
291
|
+
"name": "supplyAddress",
|
|
292
|
+
"type": "address"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"internalType": "address",
|
|
296
|
+
"name": "borrowAddress",
|
|
297
|
+
"type": "address"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"internalType": "uint256",
|
|
301
|
+
"name": "minHealthFactor",
|
|
302
|
+
"type": "uint256"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
"indexed": false,
|
|
306
|
+
"internalType": "struct ILoanManager.LoanConfig",
|
|
307
|
+
"name": "newConfig",
|
|
308
|
+
"type": "tuple"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"indexed": false,
|
|
312
|
+
"internalType": "Id",
|
|
313
|
+
"name": "oldMarketId",
|
|
314
|
+
"type": "bytes32"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"indexed": false,
|
|
318
|
+
"internalType": "Id",
|
|
319
|
+
"name": "newMarketId",
|
|
320
|
+
"type": "bytes32"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"name": "UpdateLoanConfig",
|
|
324
|
+
"type": "event"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"anonymous": false,
|
|
328
|
+
"inputs": [
|
|
329
|
+
{
|
|
330
|
+
"indexed": true,
|
|
331
|
+
"internalType": "address",
|
|
332
|
+
"name": "caller",
|
|
333
|
+
"type": "address"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"indexed": false,
|
|
337
|
+
"internalType": "address",
|
|
338
|
+
"name": "merkle_distributor",
|
|
339
|
+
"type": "address"
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
"name": "UpdateMerkleDistributor",
|
|
343
|
+
"type": "event"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"anonymous": false,
|
|
347
|
+
"inputs": [
|
|
348
|
+
{
|
|
349
|
+
"indexed": false,
|
|
350
|
+
"internalType": "contract IMorpho",
|
|
351
|
+
"name": "oldPool",
|
|
352
|
+
"type": "address"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"indexed": false,
|
|
356
|
+
"internalType": "contract IMorpho",
|
|
357
|
+
"name": "newPool",
|
|
358
|
+
"type": "address"
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"name": "UpdateMorphoBlue",
|
|
362
|
+
"type": "event"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"inputs": [],
|
|
366
|
+
"name": "WNATIVE",
|
|
367
|
+
"outputs": [
|
|
368
|
+
{
|
|
369
|
+
"internalType": "address payable",
|
|
370
|
+
"name": "",
|
|
371
|
+
"type": "address"
|
|
372
|
+
}
|
|
373
|
+
],
|
|
374
|
+
"stateMutability": "view",
|
|
375
|
+
"type": "function"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"inputs": [],
|
|
379
|
+
"name": "acceptOwnership",
|
|
380
|
+
"outputs": [],
|
|
381
|
+
"stateMutability": "nonpayable",
|
|
382
|
+
"type": "function"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"inputs": [
|
|
386
|
+
{
|
|
387
|
+
"internalType": "address",
|
|
388
|
+
"name": "_executor",
|
|
389
|
+
"type": "address"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
"name": "addExecutor",
|
|
393
|
+
"outputs": [],
|
|
394
|
+
"stateMutability": "nonpayable",
|
|
395
|
+
"type": "function"
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"inputs": [
|
|
399
|
+
{
|
|
400
|
+
"internalType": "address",
|
|
401
|
+
"name": "_token",
|
|
402
|
+
"type": "address"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"internalType": "address",
|
|
406
|
+
"name": "_guy",
|
|
407
|
+
"type": "address"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"internalType": "uint256",
|
|
411
|
+
"name": "_wad",
|
|
412
|
+
"type": "uint256"
|
|
413
|
+
}
|
|
414
|
+
],
|
|
415
|
+
"name": "approveToken",
|
|
416
|
+
"outputs": [],
|
|
417
|
+
"stateMutability": "nonpayable",
|
|
418
|
+
"type": "function"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"inputs": [
|
|
422
|
+
{
|
|
423
|
+
"internalType": "address",
|
|
424
|
+
"name": "_asset_address",
|
|
425
|
+
"type": "address"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"internalType": "address",
|
|
429
|
+
"name": "_account",
|
|
430
|
+
"type": "address"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"name": "balanceOf",
|
|
434
|
+
"outputs": [
|
|
435
|
+
{
|
|
436
|
+
"internalType": "uint256",
|
|
437
|
+
"name": "",
|
|
438
|
+
"type": "uint256"
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
"stateMutability": "view",
|
|
442
|
+
"type": "function"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"inputs": [
|
|
446
|
+
{
|
|
447
|
+
"internalType": "address[]",
|
|
448
|
+
"name": "_tos",
|
|
449
|
+
"type": "address[]"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"internalType": "uint256[]",
|
|
453
|
+
"name": "_values",
|
|
454
|
+
"type": "uint256[]"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"internalType": "bytes[]",
|
|
458
|
+
"name": "_datas",
|
|
459
|
+
"type": "bytes[]"
|
|
460
|
+
}
|
|
461
|
+
],
|
|
462
|
+
"name": "batchExecute",
|
|
463
|
+
"outputs": [],
|
|
464
|
+
"stateMutability": "payable",
|
|
465
|
+
"type": "function"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"inputs": [
|
|
469
|
+
{
|
|
470
|
+
"internalType": "uint256",
|
|
471
|
+
"name": "_amount",
|
|
472
|
+
"type": "uint256"
|
|
473
|
+
}
|
|
474
|
+
],
|
|
475
|
+
"name": "borrow",
|
|
476
|
+
"outputs": [],
|
|
477
|
+
"stateMutability": "nonpayable",
|
|
478
|
+
"type": "function"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"inputs": [],
|
|
482
|
+
"name": "claimRewards",
|
|
483
|
+
"outputs": [
|
|
484
|
+
{
|
|
485
|
+
"internalType": "address[]",
|
|
486
|
+
"name": "",
|
|
487
|
+
"type": "address[]"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"internalType": "uint256[]",
|
|
491
|
+
"name": "",
|
|
492
|
+
"type": "uint256[]"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"stateMutability": "view",
|
|
496
|
+
"type": "function"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"inputs": [
|
|
500
|
+
{
|
|
501
|
+
"components": [
|
|
502
|
+
{
|
|
503
|
+
"internalType": "address[]",
|
|
504
|
+
"name": "users",
|
|
505
|
+
"type": "address[]"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"internalType": "address[]",
|
|
509
|
+
"name": "tokens",
|
|
510
|
+
"type": "address[]"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"internalType": "uint256[]",
|
|
514
|
+
"name": "values",
|
|
515
|
+
"type": "uint256[]"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"internalType": "bytes32[][]",
|
|
519
|
+
"name": "proof",
|
|
520
|
+
"type": "bytes32[][]"
|
|
521
|
+
}
|
|
522
|
+
],
|
|
523
|
+
"internalType": "struct LoanManager.MerkleClaimData",
|
|
524
|
+
"name": "_merkle_claim_data",
|
|
525
|
+
"type": "tuple"
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
"name": "claimRewards",
|
|
529
|
+
"outputs": [
|
|
530
|
+
{
|
|
531
|
+
"internalType": "address[]",
|
|
532
|
+
"name": "merkle_tokens_out",
|
|
533
|
+
"type": "address[]"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"internalType": "uint256[]",
|
|
537
|
+
"name": "merkle_amounts_out",
|
|
538
|
+
"type": "uint256[]"
|
|
539
|
+
}
|
|
540
|
+
],
|
|
541
|
+
"stateMutability": "nonpayable",
|
|
542
|
+
"type": "function"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"inputs": [
|
|
546
|
+
{
|
|
547
|
+
"internalType": "uint256",
|
|
548
|
+
"name": "_amount",
|
|
549
|
+
"type": "uint256"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
"internalType": "uint256",
|
|
553
|
+
"name": "",
|
|
554
|
+
"type": "uint256"
|
|
555
|
+
}
|
|
556
|
+
],
|
|
557
|
+
"name": "deposit",
|
|
558
|
+
"outputs": [],
|
|
559
|
+
"stateMutability": "nonpayable",
|
|
560
|
+
"type": "function"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"inputs": [
|
|
564
|
+
{
|
|
565
|
+
"internalType": "address",
|
|
566
|
+
"name": "_to",
|
|
567
|
+
"type": "address"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"internalType": "uint256",
|
|
571
|
+
"name": "_value",
|
|
572
|
+
"type": "uint256"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
"internalType": "bytes",
|
|
576
|
+
"name": "_data",
|
|
577
|
+
"type": "bytes"
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
"name": "execute",
|
|
581
|
+
"outputs": [],
|
|
582
|
+
"stateMutability": "payable",
|
|
583
|
+
"type": "function"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"inputs": [
|
|
587
|
+
{
|
|
588
|
+
"internalType": "address",
|
|
589
|
+
"name": "",
|
|
590
|
+
"type": "address"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
"name": "executors",
|
|
594
|
+
"outputs": [
|
|
595
|
+
{
|
|
596
|
+
"internalType": "bool",
|
|
597
|
+
"name": "",
|
|
598
|
+
"type": "bool"
|
|
599
|
+
}
|
|
600
|
+
],
|
|
601
|
+
"stateMutability": "view",
|
|
602
|
+
"type": "function"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
"inputs": [],
|
|
606
|
+
"name": "getBorrow",
|
|
607
|
+
"outputs": [
|
|
608
|
+
{
|
|
609
|
+
"internalType": "uint256",
|
|
610
|
+
"name": "borrowed",
|
|
611
|
+
"type": "uint256"
|
|
612
|
+
}
|
|
613
|
+
],
|
|
614
|
+
"stateMutability": "view",
|
|
615
|
+
"type": "function"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"inputs": [],
|
|
619
|
+
"name": "getBorrowRate",
|
|
620
|
+
"outputs": [
|
|
621
|
+
{
|
|
622
|
+
"internalType": "uint256",
|
|
623
|
+
"name": "borrowRate",
|
|
624
|
+
"type": "uint256"
|
|
625
|
+
}
|
|
626
|
+
],
|
|
627
|
+
"stateMutability": "view",
|
|
628
|
+
"type": "function"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"inputs": [],
|
|
632
|
+
"name": "getConfig",
|
|
633
|
+
"outputs": [
|
|
634
|
+
{
|
|
635
|
+
"components": [
|
|
636
|
+
{
|
|
637
|
+
"internalType": "address",
|
|
638
|
+
"name": "supplyAddress",
|
|
639
|
+
"type": "address"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"internalType": "address",
|
|
643
|
+
"name": "borrowAddress",
|
|
644
|
+
"type": "address"
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
"internalType": "uint256",
|
|
648
|
+
"name": "minHealthFactor",
|
|
649
|
+
"type": "uint256"
|
|
650
|
+
}
|
|
651
|
+
],
|
|
652
|
+
"internalType": "struct ILoanManager.LoanConfig",
|
|
653
|
+
"name": "config",
|
|
654
|
+
"type": "tuple"
|
|
655
|
+
}
|
|
656
|
+
],
|
|
657
|
+
"stateMutability": "view",
|
|
658
|
+
"type": "function"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
"inputs": [],
|
|
662
|
+
"name": "getHealthFactor",
|
|
663
|
+
"outputs": [
|
|
664
|
+
{
|
|
665
|
+
"internalType": "uint256",
|
|
666
|
+
"name": "healthFactor",
|
|
667
|
+
"type": "uint256"
|
|
668
|
+
}
|
|
669
|
+
],
|
|
670
|
+
"stateMutability": "view",
|
|
671
|
+
"type": "function"
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"inputs": [
|
|
675
|
+
{
|
|
676
|
+
"internalType": "address",
|
|
677
|
+
"name": "",
|
|
678
|
+
"type": "address"
|
|
679
|
+
}
|
|
680
|
+
],
|
|
681
|
+
"name": "getLiquidationThreshold",
|
|
682
|
+
"outputs": [
|
|
683
|
+
{
|
|
684
|
+
"internalType": "uint256",
|
|
685
|
+
"name": "",
|
|
686
|
+
"type": "uint256"
|
|
687
|
+
}
|
|
688
|
+
],
|
|
689
|
+
"stateMutability": "view",
|
|
690
|
+
"type": "function"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
"inputs": [],
|
|
694
|
+
"name": "getLiquidityAndShortFall",
|
|
695
|
+
"outputs": [
|
|
696
|
+
{
|
|
697
|
+
"internalType": "uint256",
|
|
698
|
+
"name": "liquidity",
|
|
699
|
+
"type": "uint256"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"internalType": "uint256",
|
|
703
|
+
"name": "shortfall",
|
|
704
|
+
"type": "uint256"
|
|
705
|
+
}
|
|
706
|
+
],
|
|
707
|
+
"stateMutability": "view",
|
|
708
|
+
"type": "function"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"inputs": [],
|
|
712
|
+
"name": "getMarketParams",
|
|
713
|
+
"outputs": [
|
|
714
|
+
{
|
|
715
|
+
"components": [
|
|
716
|
+
{
|
|
717
|
+
"internalType": "address",
|
|
718
|
+
"name": "loanToken",
|
|
719
|
+
"type": "address"
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"internalType": "address",
|
|
723
|
+
"name": "collateralToken",
|
|
724
|
+
"type": "address"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"internalType": "address",
|
|
728
|
+
"name": "oracle",
|
|
729
|
+
"type": "address"
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"internalType": "address",
|
|
733
|
+
"name": "irm",
|
|
734
|
+
"type": "address"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"internalType": "uint256",
|
|
738
|
+
"name": "lltv",
|
|
739
|
+
"type": "uint256"
|
|
740
|
+
}
|
|
741
|
+
],
|
|
742
|
+
"internalType": "struct MarketParams",
|
|
743
|
+
"name": "",
|
|
744
|
+
"type": "tuple"
|
|
745
|
+
}
|
|
746
|
+
],
|
|
747
|
+
"stateMutability": "view",
|
|
748
|
+
"type": "function"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"inputs": [],
|
|
752
|
+
"name": "getMarketsData",
|
|
753
|
+
"outputs": [
|
|
754
|
+
{
|
|
755
|
+
"internalType": "uint256",
|
|
756
|
+
"name": "supplyMarketDeposits",
|
|
757
|
+
"type": "uint256"
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
"internalType": "uint256",
|
|
761
|
+
"name": "supplyMarketDebt",
|
|
762
|
+
"type": "uint256"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"internalType": "uint256",
|
|
766
|
+
"name": "supplyMarketAssetPrice",
|
|
767
|
+
"type": "uint256"
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
"internalType": "uint256",
|
|
771
|
+
"name": "borrowMarketDeposits",
|
|
772
|
+
"type": "uint256"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"internalType": "uint256",
|
|
776
|
+
"name": "borrowMarketDebt",
|
|
777
|
+
"type": "uint256"
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"internalType": "uint256",
|
|
781
|
+
"name": "borrowMarketAssetPrice",
|
|
782
|
+
"type": "uint256"
|
|
783
|
+
}
|
|
784
|
+
],
|
|
785
|
+
"stateMutability": "view",
|
|
786
|
+
"type": "function"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"inputs": [],
|
|
790
|
+
"name": "getPositionAssets",
|
|
791
|
+
"outputs": [
|
|
792
|
+
{
|
|
793
|
+
"internalType": "address[]",
|
|
794
|
+
"name": "",
|
|
795
|
+
"type": "address[]"
|
|
796
|
+
}
|
|
797
|
+
],
|
|
798
|
+
"stateMutability": "view",
|
|
799
|
+
"type": "function"
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
"inputs": [],
|
|
803
|
+
"name": "getPositionDataSnapshot",
|
|
804
|
+
"outputs": [
|
|
805
|
+
{
|
|
806
|
+
"internalType": "uint256",
|
|
807
|
+
"name": "healthFactor",
|
|
808
|
+
"type": "uint256"
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"internalType": "uint256",
|
|
812
|
+
"name": "liquidity",
|
|
813
|
+
"type": "uint256"
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"internalType": "uint256",
|
|
817
|
+
"name": "shortfall",
|
|
818
|
+
"type": "uint256"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
"internalType": "uint256",
|
|
822
|
+
"name": "supplied",
|
|
823
|
+
"type": "uint256"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"internalType": "uint256",
|
|
827
|
+
"name": "borrowed",
|
|
828
|
+
"type": "uint256"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
"internalType": "uint256",
|
|
832
|
+
"name": "supplyRate",
|
|
833
|
+
"type": "uint256"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"internalType": "uint256",
|
|
837
|
+
"name": "borrowRate",
|
|
838
|
+
"type": "uint256"
|
|
839
|
+
}
|
|
840
|
+
],
|
|
841
|
+
"stateMutability": "view",
|
|
842
|
+
"type": "function"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
"inputs": [],
|
|
846
|
+
"name": "getPrices",
|
|
847
|
+
"outputs": [
|
|
848
|
+
{
|
|
849
|
+
"internalType": "uint256",
|
|
850
|
+
"name": "supplyTokenPrice",
|
|
851
|
+
"type": "uint256"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"internalType": "uint256",
|
|
855
|
+
"name": "borrowTokenPrice",
|
|
856
|
+
"type": "uint256"
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
"stateMutability": "view",
|
|
860
|
+
"type": "function"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
"inputs": [],
|
|
864
|
+
"name": "getSupply",
|
|
865
|
+
"outputs": [
|
|
866
|
+
{
|
|
867
|
+
"internalType": "uint256",
|
|
868
|
+
"name": "supplied",
|
|
869
|
+
"type": "uint256"
|
|
870
|
+
}
|
|
871
|
+
],
|
|
872
|
+
"stateMutability": "view",
|
|
873
|
+
"type": "function"
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"inputs": [],
|
|
877
|
+
"name": "getSupplyRate",
|
|
878
|
+
"outputs": [
|
|
879
|
+
{
|
|
880
|
+
"internalType": "uint256",
|
|
881
|
+
"name": "supplyRate",
|
|
882
|
+
"type": "uint256"
|
|
883
|
+
}
|
|
884
|
+
],
|
|
885
|
+
"stateMutability": "pure",
|
|
886
|
+
"type": "function"
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
"inputs": [],
|
|
890
|
+
"name": "loanConfig",
|
|
891
|
+
"outputs": [
|
|
892
|
+
{
|
|
893
|
+
"internalType": "address",
|
|
894
|
+
"name": "supplyAddress",
|
|
895
|
+
"type": "address"
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"internalType": "address",
|
|
899
|
+
"name": "borrowAddress",
|
|
900
|
+
"type": "address"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
"internalType": "uint256",
|
|
904
|
+
"name": "minHealthFactor",
|
|
905
|
+
"type": "uint256"
|
|
906
|
+
}
|
|
907
|
+
],
|
|
908
|
+
"stateMutability": "view",
|
|
909
|
+
"type": "function"
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
"inputs": [],
|
|
913
|
+
"name": "marketId",
|
|
914
|
+
"outputs": [
|
|
915
|
+
{
|
|
916
|
+
"internalType": "Id",
|
|
917
|
+
"name": "",
|
|
918
|
+
"type": "bytes32"
|
|
919
|
+
}
|
|
920
|
+
],
|
|
921
|
+
"stateMutability": "view",
|
|
922
|
+
"type": "function"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"inputs": [],
|
|
926
|
+
"name": "merkleDistributor",
|
|
927
|
+
"outputs": [
|
|
928
|
+
{
|
|
929
|
+
"internalType": "contract IMerkleDistributor",
|
|
930
|
+
"name": "",
|
|
931
|
+
"type": "address"
|
|
932
|
+
}
|
|
933
|
+
],
|
|
934
|
+
"stateMutability": "view",
|
|
935
|
+
"type": "function"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"inputs": [],
|
|
939
|
+
"name": "morphoBlue",
|
|
940
|
+
"outputs": [
|
|
941
|
+
{
|
|
942
|
+
"internalType": "contract IMorpho",
|
|
943
|
+
"name": "",
|
|
944
|
+
"type": "address"
|
|
945
|
+
}
|
|
946
|
+
],
|
|
947
|
+
"stateMutability": "view",
|
|
948
|
+
"type": "function"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"inputs": [],
|
|
952
|
+
"name": "owner",
|
|
953
|
+
"outputs": [
|
|
954
|
+
{
|
|
955
|
+
"internalType": "address",
|
|
956
|
+
"name": "",
|
|
957
|
+
"type": "address"
|
|
958
|
+
}
|
|
959
|
+
],
|
|
960
|
+
"stateMutability": "view",
|
|
961
|
+
"type": "function"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"inputs": [],
|
|
965
|
+
"name": "pendingOwner",
|
|
966
|
+
"outputs": [
|
|
967
|
+
{
|
|
968
|
+
"internalType": "address",
|
|
969
|
+
"name": "",
|
|
970
|
+
"type": "address"
|
|
971
|
+
}
|
|
972
|
+
],
|
|
973
|
+
"stateMutability": "view",
|
|
974
|
+
"type": "function"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"inputs": [
|
|
978
|
+
{
|
|
979
|
+
"internalType": "address",
|
|
980
|
+
"name": "_executor",
|
|
981
|
+
"type": "address"
|
|
982
|
+
}
|
|
983
|
+
],
|
|
984
|
+
"name": "removeExecutor",
|
|
985
|
+
"outputs": [],
|
|
986
|
+
"stateMutability": "nonpayable",
|
|
987
|
+
"type": "function"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"inputs": [],
|
|
991
|
+
"name": "renounceOwnership",
|
|
992
|
+
"outputs": [],
|
|
993
|
+
"stateMutability": "nonpayable",
|
|
994
|
+
"type": "function"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"inputs": [
|
|
998
|
+
{
|
|
999
|
+
"internalType": "uint256",
|
|
1000
|
+
"name": "_amount",
|
|
1001
|
+
"type": "uint256"
|
|
1002
|
+
}
|
|
1003
|
+
],
|
|
1004
|
+
"name": "repay",
|
|
1005
|
+
"outputs": [],
|
|
1006
|
+
"stateMutability": "nonpayable",
|
|
1007
|
+
"type": "function"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"inputs": [],
|
|
1011
|
+
"name": "repayAll",
|
|
1012
|
+
"outputs": [],
|
|
1013
|
+
"stateMutability": "nonpayable",
|
|
1014
|
+
"type": "function"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
"inputs": [],
|
|
1018
|
+
"name": "repayAllAndWithdrawSupplyAll",
|
|
1019
|
+
"outputs": [
|
|
1020
|
+
{
|
|
1021
|
+
"internalType": "uint256",
|
|
1022
|
+
"name": "amountWithdrawn",
|
|
1023
|
+
"type": "uint256"
|
|
1024
|
+
}
|
|
1025
|
+
],
|
|
1026
|
+
"stateMutability": "nonpayable",
|
|
1027
|
+
"type": "function"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
"inputs": [
|
|
1031
|
+
{
|
|
1032
|
+
"internalType": "address",
|
|
1033
|
+
"name": "_token",
|
|
1034
|
+
"type": "address"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
"internalType": "address",
|
|
1038
|
+
"name": "_guy",
|
|
1039
|
+
"type": "address"
|
|
1040
|
+
}
|
|
1041
|
+
],
|
|
1042
|
+
"name": "revokeToken",
|
|
1043
|
+
"outputs": [],
|
|
1044
|
+
"stateMutability": "nonpayable",
|
|
1045
|
+
"type": "function"
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
"inputs": [
|
|
1049
|
+
{
|
|
1050
|
+
"internalType": "Id",
|
|
1051
|
+
"name": "_marketId",
|
|
1052
|
+
"type": "bytes32"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
"internalType": "uint256",
|
|
1056
|
+
"name": "_minHealthFactor",
|
|
1057
|
+
"type": "uint256"
|
|
1058
|
+
}
|
|
1059
|
+
],
|
|
1060
|
+
"name": "setConfig",
|
|
1061
|
+
"outputs": [],
|
|
1062
|
+
"stateMutability": "nonpayable",
|
|
1063
|
+
"type": "function"
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
"inputs": [
|
|
1067
|
+
{
|
|
1068
|
+
"internalType": "address",
|
|
1069
|
+
"name": "",
|
|
1070
|
+
"type": "address"
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"internalType": "address",
|
|
1074
|
+
"name": "",
|
|
1075
|
+
"type": "address"
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
"internalType": "uint256",
|
|
1079
|
+
"name": "",
|
|
1080
|
+
"type": "uint256"
|
|
1081
|
+
}
|
|
1082
|
+
],
|
|
1083
|
+
"name": "setConfig",
|
|
1084
|
+
"outputs": [],
|
|
1085
|
+
"stateMutability": "pure",
|
|
1086
|
+
"type": "function"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"inputs": [
|
|
1090
|
+
{
|
|
1091
|
+
"internalType": "uint256",
|
|
1092
|
+
"name": "_amount",
|
|
1093
|
+
"type": "uint256"
|
|
1094
|
+
}
|
|
1095
|
+
],
|
|
1096
|
+
"name": "supply",
|
|
1097
|
+
"outputs": [],
|
|
1098
|
+
"stateMutability": "nonpayable",
|
|
1099
|
+
"type": "function"
|
|
1100
|
+
},
|
|
1101
|
+
{
|
|
1102
|
+
"inputs": [
|
|
1103
|
+
{
|
|
1104
|
+
"internalType": "address",
|
|
1105
|
+
"name": "newOwner",
|
|
1106
|
+
"type": "address"
|
|
1107
|
+
}
|
|
1108
|
+
],
|
|
1109
|
+
"name": "transferOwnership",
|
|
1110
|
+
"outputs": [],
|
|
1111
|
+
"stateMutability": "nonpayable",
|
|
1112
|
+
"type": "function"
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
"inputs": [
|
|
1116
|
+
{
|
|
1117
|
+
"internalType": "address",
|
|
1118
|
+
"name": "newOwner",
|
|
1119
|
+
"type": "address"
|
|
1120
|
+
}
|
|
1121
|
+
],
|
|
1122
|
+
"name": "transferOwnership1Step",
|
|
1123
|
+
"outputs": [],
|
|
1124
|
+
"stateMutability": "nonpayable",
|
|
1125
|
+
"type": "function"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
"inputs": [
|
|
1129
|
+
{
|
|
1130
|
+
"internalType": "uint256",
|
|
1131
|
+
"name": "_amount",
|
|
1132
|
+
"type": "uint256"
|
|
1133
|
+
}
|
|
1134
|
+
],
|
|
1135
|
+
"name": "unwrapNative",
|
|
1136
|
+
"outputs": [],
|
|
1137
|
+
"stateMutability": "nonpayable",
|
|
1138
|
+
"type": "function"
|
|
1139
|
+
},
|
|
1140
|
+
{
|
|
1141
|
+
"inputs": [
|
|
1142
|
+
{
|
|
1143
|
+
"internalType": "address",
|
|
1144
|
+
"name": "_merkle_distributor",
|
|
1145
|
+
"type": "address"
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
"name": "updateMerkleDistributor",
|
|
1149
|
+
"outputs": [],
|
|
1150
|
+
"stateMutability": "nonpayable",
|
|
1151
|
+
"type": "function"
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
"inputs": [
|
|
1155
|
+
{
|
|
1156
|
+
"internalType": "contract IMorpho",
|
|
1157
|
+
"name": "_address",
|
|
1158
|
+
"type": "address"
|
|
1159
|
+
}
|
|
1160
|
+
],
|
|
1161
|
+
"name": "updateMorphoBlue",
|
|
1162
|
+
"outputs": [],
|
|
1163
|
+
"stateMutability": "nonpayable",
|
|
1164
|
+
"type": "function"
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
"inputs": [
|
|
1168
|
+
{
|
|
1169
|
+
"internalType": "address",
|
|
1170
|
+
"name": "_asset_address",
|
|
1171
|
+
"type": "address"
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
"internalType": "uint256",
|
|
1175
|
+
"name": "_amount",
|
|
1176
|
+
"type": "uint256"
|
|
1177
|
+
}
|
|
1178
|
+
],
|
|
1179
|
+
"name": "withdraw",
|
|
1180
|
+
"outputs": [],
|
|
1181
|
+
"stateMutability": "nonpayable",
|
|
1182
|
+
"type": "function"
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
"inputs": [
|
|
1186
|
+
{
|
|
1187
|
+
"internalType": "address",
|
|
1188
|
+
"name": "_asset_address",
|
|
1189
|
+
"type": "address"
|
|
1190
|
+
}
|
|
1191
|
+
],
|
|
1192
|
+
"name": "withdrawAll",
|
|
1193
|
+
"outputs": [],
|
|
1194
|
+
"stateMutability": "nonpayable",
|
|
1195
|
+
"type": "function"
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
"inputs": [
|
|
1199
|
+
{
|
|
1200
|
+
"internalType": "address",
|
|
1201
|
+
"name": "_asset_address",
|
|
1202
|
+
"type": "address"
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"internalType": "address payable",
|
|
1206
|
+
"name": "_to",
|
|
1207
|
+
"type": "address"
|
|
1208
|
+
}
|
|
1209
|
+
],
|
|
1210
|
+
"name": "withdrawAllTo",
|
|
1211
|
+
"outputs": [],
|
|
1212
|
+
"stateMutability": "nonpayable",
|
|
1213
|
+
"type": "function"
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
"inputs": [
|
|
1217
|
+
{
|
|
1218
|
+
"internalType": "uint256",
|
|
1219
|
+
"name": "_amount",
|
|
1220
|
+
"type": "uint256"
|
|
1221
|
+
}
|
|
1222
|
+
],
|
|
1223
|
+
"name": "withdrawSupply",
|
|
1224
|
+
"outputs": [],
|
|
1225
|
+
"stateMutability": "nonpayable",
|
|
1226
|
+
"type": "function"
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
"inputs": [],
|
|
1230
|
+
"name": "withdrawSupplyAll",
|
|
1231
|
+
"outputs": [],
|
|
1232
|
+
"stateMutability": "nonpayable",
|
|
1233
|
+
"type": "function"
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
"inputs": [
|
|
1237
|
+
{
|
|
1238
|
+
"internalType": "address",
|
|
1239
|
+
"name": "_asset_address",
|
|
1240
|
+
"type": "address"
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
"internalType": "uint256",
|
|
1244
|
+
"name": "_amount",
|
|
1245
|
+
"type": "uint256"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"internalType": "address payable",
|
|
1249
|
+
"name": "_to",
|
|
1250
|
+
"type": "address"
|
|
1251
|
+
}
|
|
1252
|
+
],
|
|
1253
|
+
"name": "withdrawTo",
|
|
1254
|
+
"outputs": [],
|
|
1255
|
+
"stateMutability": "nonpayable",
|
|
1256
|
+
"type": "function"
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
"inputs": [
|
|
1260
|
+
{
|
|
1261
|
+
"internalType": "uint256",
|
|
1262
|
+
"name": "_amount",
|
|
1263
|
+
"type": "uint256"
|
|
1264
|
+
}
|
|
1265
|
+
],
|
|
1266
|
+
"name": "wrapNative",
|
|
1267
|
+
"outputs": [],
|
|
1268
|
+
"stateMutability": "nonpayable",
|
|
1269
|
+
"type": "function"
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
"stateMutability": "payable",
|
|
1273
|
+
"type": "receive"
|
|
1274
|
+
}
|
|
1275
|
+
];
|
|
1276
|
+
/**
|
|
1277
|
+
* LoanManagerOwnable2StepWithShortcut Contract Class
|
|
1278
|
+
*
|
|
1279
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
1280
|
+
*
|
|
1281
|
+
* @example
|
|
1282
|
+
* ```typescript
|
|
1283
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
1284
|
+
* import { mainnet } from 'viem/chains';
|
|
1285
|
+
* import { LoanManagerOwnable2StepWithShortcut } from 'LoanManagerOwnable2StepWithShortcut';
|
|
1286
|
+
*
|
|
1287
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
1288
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
1289
|
+
*
|
|
1290
|
+
* const contract = new LoanManagerOwnable2StepWithShortcut('0x...', { publicClient, walletClient });
|
|
1291
|
+
*
|
|
1292
|
+
* // Read functions
|
|
1293
|
+
* const result = await contract.balanceOf('0x...');
|
|
1294
|
+
*
|
|
1295
|
+
* // Write functions
|
|
1296
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
1297
|
+
*
|
|
1298
|
+
* // Simulate transactions (dry-run)
|
|
1299
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
1300
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
1301
|
+
*
|
|
1302
|
+
* // Watch events
|
|
1303
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1304
|
+
* console.log('Transfer event:', event);
|
|
1305
|
+
* });
|
|
1306
|
+
* ```
|
|
1307
|
+
*/
|
|
1308
|
+
class LoanManagerOwnable2StepWithShortcut {
|
|
1309
|
+
constructor(address, clients) {
|
|
1310
|
+
this.contractAddress = address;
|
|
1311
|
+
this.publicClient = clients.publicClient;
|
|
1312
|
+
this.contract = (0, viem_1.getContract)({
|
|
1313
|
+
address,
|
|
1314
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
1315
|
+
client: {
|
|
1316
|
+
public: clients.publicClient,
|
|
1317
|
+
wallet: clients.walletClient,
|
|
1318
|
+
},
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Get the contract address
|
|
1323
|
+
*/
|
|
1324
|
+
get address() {
|
|
1325
|
+
return this.contractAddress;
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Get the underlying viem contract instance.
|
|
1329
|
+
*/
|
|
1330
|
+
getContract() {
|
|
1331
|
+
return this.contract;
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* WNATIVE
|
|
1335
|
+
* view
|
|
1336
|
+
*/
|
|
1337
|
+
async WNATIVE() {
|
|
1338
|
+
return this.contract.read.WNATIVE();
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* balanceOf
|
|
1342
|
+
* view
|
|
1343
|
+
*/
|
|
1344
|
+
async balanceOf(_asset_address, _account) {
|
|
1345
|
+
return this.contract.read.balanceOf([_asset_address, _account]);
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* executors
|
|
1349
|
+
* view
|
|
1350
|
+
*/
|
|
1351
|
+
async executors(arg0) {
|
|
1352
|
+
return this.contract.read.executors([arg0]);
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* getBorrow
|
|
1356
|
+
* view
|
|
1357
|
+
*/
|
|
1358
|
+
async getBorrow() {
|
|
1359
|
+
return this.contract.read.getBorrow();
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* getBorrowRate
|
|
1363
|
+
* view
|
|
1364
|
+
*/
|
|
1365
|
+
async getBorrowRate() {
|
|
1366
|
+
return this.contract.read.getBorrowRate();
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* getConfig
|
|
1370
|
+
* view
|
|
1371
|
+
*/
|
|
1372
|
+
async getConfig() {
|
|
1373
|
+
return this.contract.read.getConfig();
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* getHealthFactor
|
|
1377
|
+
* view
|
|
1378
|
+
*/
|
|
1379
|
+
async getHealthFactor() {
|
|
1380
|
+
return this.contract.read.getHealthFactor();
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* getLiquidationThreshold
|
|
1384
|
+
* view
|
|
1385
|
+
*/
|
|
1386
|
+
async getLiquidationThreshold(arg0) {
|
|
1387
|
+
return this.contract.read.getLiquidationThreshold([arg0]);
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* getLiquidityAndShortFall
|
|
1391
|
+
* view
|
|
1392
|
+
*/
|
|
1393
|
+
async getLiquidityAndShortFall() {
|
|
1394
|
+
return this.contract.read.getLiquidityAndShortFall();
|
|
1395
|
+
}
|
|
1396
|
+
/**
|
|
1397
|
+
* getMarketParams
|
|
1398
|
+
* view
|
|
1399
|
+
*/
|
|
1400
|
+
async getMarketParams() {
|
|
1401
|
+
return this.contract.read.getMarketParams();
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* getMarketsData
|
|
1405
|
+
* view
|
|
1406
|
+
*/
|
|
1407
|
+
async getMarketsData() {
|
|
1408
|
+
return this.contract.read.getMarketsData();
|
|
1409
|
+
}
|
|
1410
|
+
/**
|
|
1411
|
+
* getPositionAssets
|
|
1412
|
+
* view
|
|
1413
|
+
*/
|
|
1414
|
+
async getPositionAssets() {
|
|
1415
|
+
return this.contract.read.getPositionAssets();
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* getPositionDataSnapshot
|
|
1419
|
+
* view
|
|
1420
|
+
*/
|
|
1421
|
+
async getPositionDataSnapshot() {
|
|
1422
|
+
return this.contract.read.getPositionDataSnapshot();
|
|
1423
|
+
}
|
|
1424
|
+
/**
|
|
1425
|
+
* getPrices
|
|
1426
|
+
* view
|
|
1427
|
+
*/
|
|
1428
|
+
async getPrices() {
|
|
1429
|
+
return this.contract.read.getPrices();
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* getSupply
|
|
1433
|
+
* view
|
|
1434
|
+
*/
|
|
1435
|
+
async getSupply() {
|
|
1436
|
+
return this.contract.read.getSupply();
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* getSupplyRate
|
|
1440
|
+
* pure
|
|
1441
|
+
*/
|
|
1442
|
+
async getSupplyRate() {
|
|
1443
|
+
return this.contract.read.getSupplyRate();
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* loanConfig
|
|
1447
|
+
* view
|
|
1448
|
+
*/
|
|
1449
|
+
async loanConfig() {
|
|
1450
|
+
return this.contract.read.loanConfig();
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* marketId
|
|
1454
|
+
* view
|
|
1455
|
+
*/
|
|
1456
|
+
async marketId() {
|
|
1457
|
+
return this.contract.read.marketId();
|
|
1458
|
+
}
|
|
1459
|
+
/**
|
|
1460
|
+
* merkleDistributor
|
|
1461
|
+
* view
|
|
1462
|
+
*/
|
|
1463
|
+
async merkleDistributor() {
|
|
1464
|
+
return this.contract.read.merkleDistributor();
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* morphoBlue
|
|
1468
|
+
* view
|
|
1469
|
+
*/
|
|
1470
|
+
async morphoBlue() {
|
|
1471
|
+
return this.contract.read.morphoBlue();
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* owner
|
|
1475
|
+
* view
|
|
1476
|
+
*/
|
|
1477
|
+
async owner() {
|
|
1478
|
+
return this.contract.read.owner();
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* pendingOwner
|
|
1482
|
+
* view
|
|
1483
|
+
*/
|
|
1484
|
+
async pendingOwner() {
|
|
1485
|
+
return this.contract.read.pendingOwner();
|
|
1486
|
+
}
|
|
1487
|
+
/**
|
|
1488
|
+
* acceptOwnership
|
|
1489
|
+
* nonpayable
|
|
1490
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1491
|
+
*/
|
|
1492
|
+
async acceptOwnership(options) {
|
|
1493
|
+
if (!this.contract.write) {
|
|
1494
|
+
throw new Error('Wallet client is required for write operations');
|
|
1495
|
+
}
|
|
1496
|
+
return this.contract.write.acceptOwnership(options);
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* addExecutor
|
|
1500
|
+
* nonpayable
|
|
1501
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1502
|
+
*/
|
|
1503
|
+
async addExecutor(_executor, options) {
|
|
1504
|
+
if (!this.contract.write) {
|
|
1505
|
+
throw new Error('Wallet client is required for write operations');
|
|
1506
|
+
}
|
|
1507
|
+
return this.contract.write.addExecutor([_executor], options);
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* approveToken
|
|
1511
|
+
* nonpayable
|
|
1512
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1513
|
+
*/
|
|
1514
|
+
async approveToken(_token, _guy, _wad, options) {
|
|
1515
|
+
if (!this.contract.write) {
|
|
1516
|
+
throw new Error('Wallet client is required for write operations');
|
|
1517
|
+
}
|
|
1518
|
+
return this.contract.write.approveToken([_token, _guy, _wad], options);
|
|
1519
|
+
}
|
|
1520
|
+
/**
|
|
1521
|
+
* batchExecute
|
|
1522
|
+
* payable
|
|
1523
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1524
|
+
*/
|
|
1525
|
+
async batchExecute(_tos, _values, _datas, options) {
|
|
1526
|
+
if (!this.contract.write) {
|
|
1527
|
+
throw new Error('Wallet client is required for write operations');
|
|
1528
|
+
}
|
|
1529
|
+
return this.contract.write.batchExecute([_tos, _values, _datas], options);
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* borrow
|
|
1533
|
+
* nonpayable
|
|
1534
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1535
|
+
*/
|
|
1536
|
+
async borrow(_amount, options) {
|
|
1537
|
+
if (!this.contract.write) {
|
|
1538
|
+
throw new Error('Wallet client is required for write operations');
|
|
1539
|
+
}
|
|
1540
|
+
return this.contract.write.borrow([_amount], options);
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* deposit
|
|
1544
|
+
* nonpayable
|
|
1545
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1546
|
+
*/
|
|
1547
|
+
async deposit(_amount, arg1, options) {
|
|
1548
|
+
if (!this.contract.write) {
|
|
1549
|
+
throw new Error('Wallet client is required for write operations');
|
|
1550
|
+
}
|
|
1551
|
+
return this.contract.write.deposit([_amount, arg1], options);
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* execute
|
|
1555
|
+
* payable
|
|
1556
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1557
|
+
*/
|
|
1558
|
+
async execute(_to, _value, _data, options) {
|
|
1559
|
+
if (!this.contract.write) {
|
|
1560
|
+
throw new Error('Wallet client is required for write operations');
|
|
1561
|
+
}
|
|
1562
|
+
return this.contract.write.execute([_to, _value, _data], options);
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* removeExecutor
|
|
1566
|
+
* nonpayable
|
|
1567
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1568
|
+
*/
|
|
1569
|
+
async removeExecutor(_executor, options) {
|
|
1570
|
+
if (!this.contract.write) {
|
|
1571
|
+
throw new Error('Wallet client is required for write operations');
|
|
1572
|
+
}
|
|
1573
|
+
return this.contract.write.removeExecutor([_executor], options);
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* renounceOwnership
|
|
1577
|
+
* nonpayable
|
|
1578
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1579
|
+
*/
|
|
1580
|
+
async renounceOwnership(options) {
|
|
1581
|
+
if (!this.contract.write) {
|
|
1582
|
+
throw new Error('Wallet client is required for write operations');
|
|
1583
|
+
}
|
|
1584
|
+
return this.contract.write.renounceOwnership(options);
|
|
1585
|
+
}
|
|
1586
|
+
/**
|
|
1587
|
+
* repay
|
|
1588
|
+
* nonpayable
|
|
1589
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1590
|
+
*/
|
|
1591
|
+
async repay(_amount, options) {
|
|
1592
|
+
if (!this.contract.write) {
|
|
1593
|
+
throw new Error('Wallet client is required for write operations');
|
|
1594
|
+
}
|
|
1595
|
+
return this.contract.write.repay([_amount], options);
|
|
1596
|
+
}
|
|
1597
|
+
/**
|
|
1598
|
+
* repayAll
|
|
1599
|
+
* nonpayable
|
|
1600
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1601
|
+
*/
|
|
1602
|
+
async repayAll(options) {
|
|
1603
|
+
if (!this.contract.write) {
|
|
1604
|
+
throw new Error('Wallet client is required for write operations');
|
|
1605
|
+
}
|
|
1606
|
+
return this.contract.write.repayAll(options);
|
|
1607
|
+
}
|
|
1608
|
+
/**
|
|
1609
|
+
* repayAllAndWithdrawSupplyAll
|
|
1610
|
+
* nonpayable
|
|
1611
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1612
|
+
*/
|
|
1613
|
+
async repayAllAndWithdrawSupplyAll(options) {
|
|
1614
|
+
if (!this.contract.write) {
|
|
1615
|
+
throw new Error('Wallet client is required for write operations');
|
|
1616
|
+
}
|
|
1617
|
+
return this.contract.write.repayAllAndWithdrawSupplyAll(options);
|
|
1618
|
+
}
|
|
1619
|
+
/**
|
|
1620
|
+
* revokeToken
|
|
1621
|
+
* nonpayable
|
|
1622
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1623
|
+
*/
|
|
1624
|
+
async revokeToken(_token, _guy, options) {
|
|
1625
|
+
if (!this.contract.write) {
|
|
1626
|
+
throw new Error('Wallet client is required for write operations');
|
|
1627
|
+
}
|
|
1628
|
+
return this.contract.write.revokeToken([_token, _guy], options);
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* supply
|
|
1632
|
+
* nonpayable
|
|
1633
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1634
|
+
*/
|
|
1635
|
+
async supply(_amount, options) {
|
|
1636
|
+
if (!this.contract.write) {
|
|
1637
|
+
throw new Error('Wallet client is required for write operations');
|
|
1638
|
+
}
|
|
1639
|
+
return this.contract.write.supply([_amount], options);
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* transferOwnership
|
|
1643
|
+
* nonpayable
|
|
1644
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1645
|
+
*/
|
|
1646
|
+
async transferOwnership(newOwner, options) {
|
|
1647
|
+
if (!this.contract.write) {
|
|
1648
|
+
throw new Error('Wallet client is required for write operations');
|
|
1649
|
+
}
|
|
1650
|
+
return this.contract.write.transferOwnership([newOwner], options);
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* transferOwnership1Step
|
|
1654
|
+
* nonpayable
|
|
1655
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1656
|
+
*/
|
|
1657
|
+
async transferOwnership1Step(newOwner, options) {
|
|
1658
|
+
if (!this.contract.write) {
|
|
1659
|
+
throw new Error('Wallet client is required for write operations');
|
|
1660
|
+
}
|
|
1661
|
+
return this.contract.write.transferOwnership1Step([newOwner], options);
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* unwrapNative
|
|
1665
|
+
* nonpayable
|
|
1666
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1667
|
+
*/
|
|
1668
|
+
async unwrapNative(_amount, options) {
|
|
1669
|
+
if (!this.contract.write) {
|
|
1670
|
+
throw new Error('Wallet client is required for write operations');
|
|
1671
|
+
}
|
|
1672
|
+
return this.contract.write.unwrapNative([_amount], options);
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* updateMerkleDistributor
|
|
1676
|
+
* nonpayable
|
|
1677
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1678
|
+
*/
|
|
1679
|
+
async updateMerkleDistributor(_merkle_distributor, options) {
|
|
1680
|
+
if (!this.contract.write) {
|
|
1681
|
+
throw new Error('Wallet client is required for write operations');
|
|
1682
|
+
}
|
|
1683
|
+
return this.contract.write.updateMerkleDistributor([_merkle_distributor], options);
|
|
1684
|
+
}
|
|
1685
|
+
/**
|
|
1686
|
+
* updateMorphoBlue
|
|
1687
|
+
* nonpayable
|
|
1688
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1689
|
+
*/
|
|
1690
|
+
async updateMorphoBlue(_address, options) {
|
|
1691
|
+
if (!this.contract.write) {
|
|
1692
|
+
throw new Error('Wallet client is required for write operations');
|
|
1693
|
+
}
|
|
1694
|
+
return this.contract.write.updateMorphoBlue([_address], options);
|
|
1695
|
+
}
|
|
1696
|
+
/**
|
|
1697
|
+
* withdraw
|
|
1698
|
+
* nonpayable
|
|
1699
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1700
|
+
*/
|
|
1701
|
+
async withdraw(_asset_address, _amount, options) {
|
|
1702
|
+
if (!this.contract.write) {
|
|
1703
|
+
throw new Error('Wallet client is required for write operations');
|
|
1704
|
+
}
|
|
1705
|
+
return this.contract.write.withdraw([_asset_address, _amount], options);
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* withdrawAll
|
|
1709
|
+
* nonpayable
|
|
1710
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1711
|
+
*/
|
|
1712
|
+
async withdrawAll(_asset_address, options) {
|
|
1713
|
+
if (!this.contract.write) {
|
|
1714
|
+
throw new Error('Wallet client is required for write operations');
|
|
1715
|
+
}
|
|
1716
|
+
return this.contract.write.withdrawAll([_asset_address], options);
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* withdrawAllTo
|
|
1720
|
+
* nonpayable
|
|
1721
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1722
|
+
*/
|
|
1723
|
+
async withdrawAllTo(_asset_address, _to, options) {
|
|
1724
|
+
if (!this.contract.write) {
|
|
1725
|
+
throw new Error('Wallet client is required for write operations');
|
|
1726
|
+
}
|
|
1727
|
+
return this.contract.write.withdrawAllTo([_asset_address, _to], options);
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* withdrawSupply
|
|
1731
|
+
* nonpayable
|
|
1732
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1733
|
+
*/
|
|
1734
|
+
async withdrawSupply(_amount, options) {
|
|
1735
|
+
if (!this.contract.write) {
|
|
1736
|
+
throw new Error('Wallet client is required for write operations');
|
|
1737
|
+
}
|
|
1738
|
+
return this.contract.write.withdrawSupply([_amount], options);
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* withdrawSupplyAll
|
|
1742
|
+
* nonpayable
|
|
1743
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1744
|
+
*/
|
|
1745
|
+
async withdrawSupplyAll(options) {
|
|
1746
|
+
if (!this.contract.write) {
|
|
1747
|
+
throw new Error('Wallet client is required for write operations');
|
|
1748
|
+
}
|
|
1749
|
+
return this.contract.write.withdrawSupplyAll(options);
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* withdrawTo
|
|
1753
|
+
* nonpayable
|
|
1754
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1755
|
+
*/
|
|
1756
|
+
async withdrawTo(_asset_address, _amount, _to, options) {
|
|
1757
|
+
if (!this.contract.write) {
|
|
1758
|
+
throw new Error('Wallet client is required for write operations');
|
|
1759
|
+
}
|
|
1760
|
+
return this.contract.write.withdrawTo([_asset_address, _amount, _to], options);
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* wrapNative
|
|
1764
|
+
* nonpayable
|
|
1765
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1766
|
+
*/
|
|
1767
|
+
async wrapNative(_amount, options) {
|
|
1768
|
+
if (!this.contract.write) {
|
|
1769
|
+
throw new Error('Wallet client is required for write operations');
|
|
1770
|
+
}
|
|
1771
|
+
return this.contract.write.wrapNative([_amount], options);
|
|
1772
|
+
}
|
|
1773
|
+
async claimRewards(...args) {
|
|
1774
|
+
// Try read first (for view/pure functions)
|
|
1775
|
+
if (this.contract.read && typeof this.contract.read.claimRewards === 'function') {
|
|
1776
|
+
try {
|
|
1777
|
+
return await this.contract.read.claimRewards(args);
|
|
1778
|
+
}
|
|
1779
|
+
catch (e) {
|
|
1780
|
+
// If read fails, try write
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
// Try write (for state-changing functions)
|
|
1784
|
+
if (this.contract.write && typeof this.contract.write.claimRewards === 'function') {
|
|
1785
|
+
if (!this.contract.write) {
|
|
1786
|
+
throw new Error('Wallet client is required for write operations');
|
|
1787
|
+
}
|
|
1788
|
+
return this.contract.write.claimRewards(args);
|
|
1789
|
+
}
|
|
1790
|
+
throw new Error(`Method claimRewards not found in contract`);
|
|
1791
|
+
}
|
|
1792
|
+
async setConfig(...args) {
|
|
1793
|
+
// Try read first (for view/pure functions)
|
|
1794
|
+
if (this.contract.read && typeof this.contract.read.setConfig === 'function') {
|
|
1795
|
+
try {
|
|
1796
|
+
return await this.contract.read.setConfig(args);
|
|
1797
|
+
}
|
|
1798
|
+
catch (e) {
|
|
1799
|
+
// If read fails, try write
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
// Try write (for state-changing functions)
|
|
1803
|
+
if (this.contract.write && typeof this.contract.write.setConfig === 'function') {
|
|
1804
|
+
if (!this.contract.write) {
|
|
1805
|
+
throw new Error('Wallet client is required for write operations');
|
|
1806
|
+
}
|
|
1807
|
+
return this.contract.write.setConfig(args);
|
|
1808
|
+
}
|
|
1809
|
+
throw new Error(`Method setConfig not found in contract`);
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1813
|
+
*
|
|
1814
|
+
* @example
|
|
1815
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1816
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1817
|
+
* console.log('Would succeed:', result.result);
|
|
1818
|
+
*/
|
|
1819
|
+
get simulate() {
|
|
1820
|
+
const contract = this.contract;
|
|
1821
|
+
if (!contract.simulate) {
|
|
1822
|
+
throw new Error('Public client is required for simulation');
|
|
1823
|
+
}
|
|
1824
|
+
return {
|
|
1825
|
+
/**
|
|
1826
|
+
* Simulate acceptOwnership
|
|
1827
|
+
* Returns gas estimate and result without sending transaction
|
|
1828
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1829
|
+
*/
|
|
1830
|
+
async acceptOwnership(options) {
|
|
1831
|
+
return contract.simulate.acceptOwnership(options);
|
|
1832
|
+
},
|
|
1833
|
+
/**
|
|
1834
|
+
* Simulate addExecutor
|
|
1835
|
+
* Returns gas estimate and result without sending transaction
|
|
1836
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1837
|
+
*/
|
|
1838
|
+
async addExecutor(_executor, options) {
|
|
1839
|
+
return contract.simulate.addExecutor([_executor], options);
|
|
1840
|
+
},
|
|
1841
|
+
/**
|
|
1842
|
+
* Simulate approveToken
|
|
1843
|
+
* Returns gas estimate and result without sending transaction
|
|
1844
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1845
|
+
*/
|
|
1846
|
+
async approveToken(_token, _guy, _wad, options) {
|
|
1847
|
+
return contract.simulate.approveToken([_token, _guy, _wad], options);
|
|
1848
|
+
},
|
|
1849
|
+
/**
|
|
1850
|
+
* Simulate batchExecute
|
|
1851
|
+
* Returns gas estimate and result without sending transaction
|
|
1852
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1853
|
+
*/
|
|
1854
|
+
async batchExecute(_tos, _values, _datas, options) {
|
|
1855
|
+
return contract.simulate.batchExecute([_tos, _values, _datas], options);
|
|
1856
|
+
},
|
|
1857
|
+
/**
|
|
1858
|
+
* Simulate borrow
|
|
1859
|
+
* Returns gas estimate and result without sending transaction
|
|
1860
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1861
|
+
*/
|
|
1862
|
+
async borrow(_amount, options) {
|
|
1863
|
+
return contract.simulate.borrow([_amount], options);
|
|
1864
|
+
},
|
|
1865
|
+
/**
|
|
1866
|
+
* Simulate claimRewards
|
|
1867
|
+
* Returns gas estimate and result without sending transaction
|
|
1868
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1869
|
+
*/
|
|
1870
|
+
async claimRewards(_merkle_claim_data, options) {
|
|
1871
|
+
return contract.simulate.claimRewards([_merkle_claim_data], options);
|
|
1872
|
+
},
|
|
1873
|
+
/**
|
|
1874
|
+
* Simulate deposit
|
|
1875
|
+
* Returns gas estimate and result without sending transaction
|
|
1876
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1877
|
+
*/
|
|
1878
|
+
async deposit(_amount, arg1, options) {
|
|
1879
|
+
return contract.simulate.deposit([_amount, arg1], options);
|
|
1880
|
+
},
|
|
1881
|
+
/**
|
|
1882
|
+
* Simulate execute
|
|
1883
|
+
* Returns gas estimate and result without sending transaction
|
|
1884
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1885
|
+
*/
|
|
1886
|
+
async execute(_to, _value, _data, options) {
|
|
1887
|
+
return contract.simulate.execute([_to, _value, _data], options);
|
|
1888
|
+
},
|
|
1889
|
+
/**
|
|
1890
|
+
* Simulate removeExecutor
|
|
1891
|
+
* Returns gas estimate and result without sending transaction
|
|
1892
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1893
|
+
*/
|
|
1894
|
+
async removeExecutor(_executor, options) {
|
|
1895
|
+
return contract.simulate.removeExecutor([_executor], options);
|
|
1896
|
+
},
|
|
1897
|
+
/**
|
|
1898
|
+
* Simulate renounceOwnership
|
|
1899
|
+
* Returns gas estimate and result without sending transaction
|
|
1900
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1901
|
+
*/
|
|
1902
|
+
async renounceOwnership(options) {
|
|
1903
|
+
return contract.simulate.renounceOwnership(options);
|
|
1904
|
+
},
|
|
1905
|
+
/**
|
|
1906
|
+
* Simulate repay
|
|
1907
|
+
* Returns gas estimate and result without sending transaction
|
|
1908
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1909
|
+
*/
|
|
1910
|
+
async repay(_amount, options) {
|
|
1911
|
+
return contract.simulate.repay([_amount], options);
|
|
1912
|
+
},
|
|
1913
|
+
/**
|
|
1914
|
+
* Simulate repayAll
|
|
1915
|
+
* Returns gas estimate and result without sending transaction
|
|
1916
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1917
|
+
*/
|
|
1918
|
+
async repayAll(options) {
|
|
1919
|
+
return contract.simulate.repayAll(options);
|
|
1920
|
+
},
|
|
1921
|
+
/**
|
|
1922
|
+
* Simulate repayAllAndWithdrawSupplyAll
|
|
1923
|
+
* Returns gas estimate and result without sending transaction
|
|
1924
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1925
|
+
*/
|
|
1926
|
+
async repayAllAndWithdrawSupplyAll(options) {
|
|
1927
|
+
return contract.simulate.repayAllAndWithdrawSupplyAll(options);
|
|
1928
|
+
},
|
|
1929
|
+
/**
|
|
1930
|
+
* Simulate revokeToken
|
|
1931
|
+
* Returns gas estimate and result without sending transaction
|
|
1932
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1933
|
+
*/
|
|
1934
|
+
async revokeToken(_token, _guy, options) {
|
|
1935
|
+
return contract.simulate.revokeToken([_token, _guy], options);
|
|
1936
|
+
},
|
|
1937
|
+
/**
|
|
1938
|
+
* Simulate setConfig
|
|
1939
|
+
* Returns gas estimate and result without sending transaction
|
|
1940
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1941
|
+
*/
|
|
1942
|
+
async setConfig(_marketId, _minHealthFactor, options) {
|
|
1943
|
+
return contract.simulate.setConfig([_marketId, _minHealthFactor], options);
|
|
1944
|
+
},
|
|
1945
|
+
/**
|
|
1946
|
+
* Simulate supply
|
|
1947
|
+
* Returns gas estimate and result without sending transaction
|
|
1948
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1949
|
+
*/
|
|
1950
|
+
async supply(_amount, options) {
|
|
1951
|
+
return contract.simulate.supply([_amount], options);
|
|
1952
|
+
},
|
|
1953
|
+
/**
|
|
1954
|
+
* Simulate transferOwnership
|
|
1955
|
+
* Returns gas estimate and result without sending transaction
|
|
1956
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1957
|
+
*/
|
|
1958
|
+
async transferOwnership(newOwner, options) {
|
|
1959
|
+
return contract.simulate.transferOwnership([newOwner], options);
|
|
1960
|
+
},
|
|
1961
|
+
/**
|
|
1962
|
+
* Simulate transferOwnership1Step
|
|
1963
|
+
* Returns gas estimate and result without sending transaction
|
|
1964
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1965
|
+
*/
|
|
1966
|
+
async transferOwnership1Step(newOwner, options) {
|
|
1967
|
+
return contract.simulate.transferOwnership1Step([newOwner], options);
|
|
1968
|
+
},
|
|
1969
|
+
/**
|
|
1970
|
+
* Simulate unwrapNative
|
|
1971
|
+
* Returns gas estimate and result without sending transaction
|
|
1972
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1973
|
+
*/
|
|
1974
|
+
async unwrapNative(_amount, options) {
|
|
1975
|
+
return contract.simulate.unwrapNative([_amount], options);
|
|
1976
|
+
},
|
|
1977
|
+
/**
|
|
1978
|
+
* Simulate updateMerkleDistributor
|
|
1979
|
+
* Returns gas estimate and result without sending transaction
|
|
1980
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1981
|
+
*/
|
|
1982
|
+
async updateMerkleDistributor(_merkle_distributor, options) {
|
|
1983
|
+
return contract.simulate.updateMerkleDistributor([_merkle_distributor], options);
|
|
1984
|
+
},
|
|
1985
|
+
/**
|
|
1986
|
+
* Simulate updateMorphoBlue
|
|
1987
|
+
* Returns gas estimate and result without sending transaction
|
|
1988
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1989
|
+
*/
|
|
1990
|
+
async updateMorphoBlue(_address, options) {
|
|
1991
|
+
return contract.simulate.updateMorphoBlue([_address], options);
|
|
1992
|
+
},
|
|
1993
|
+
/**
|
|
1994
|
+
* Simulate withdraw
|
|
1995
|
+
* Returns gas estimate and result without sending transaction
|
|
1996
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1997
|
+
*/
|
|
1998
|
+
async withdraw(_asset_address, _amount, options) {
|
|
1999
|
+
return contract.simulate.withdraw([_asset_address, _amount], options);
|
|
2000
|
+
},
|
|
2001
|
+
/**
|
|
2002
|
+
* Simulate withdrawAll
|
|
2003
|
+
* Returns gas estimate and result without sending transaction
|
|
2004
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2005
|
+
*/
|
|
2006
|
+
async withdrawAll(_asset_address, options) {
|
|
2007
|
+
return contract.simulate.withdrawAll([_asset_address], options);
|
|
2008
|
+
},
|
|
2009
|
+
/**
|
|
2010
|
+
* Simulate withdrawAllTo
|
|
2011
|
+
* Returns gas estimate and result without sending transaction
|
|
2012
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2013
|
+
*/
|
|
2014
|
+
async withdrawAllTo(_asset_address, _to, options) {
|
|
2015
|
+
return contract.simulate.withdrawAllTo([_asset_address, _to], options);
|
|
2016
|
+
},
|
|
2017
|
+
/**
|
|
2018
|
+
* Simulate withdrawSupply
|
|
2019
|
+
* Returns gas estimate and result without sending transaction
|
|
2020
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2021
|
+
*/
|
|
2022
|
+
async withdrawSupply(_amount, options) {
|
|
2023
|
+
return contract.simulate.withdrawSupply([_amount], options);
|
|
2024
|
+
},
|
|
2025
|
+
/**
|
|
2026
|
+
* Simulate withdrawSupplyAll
|
|
2027
|
+
* Returns gas estimate and result without sending transaction
|
|
2028
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2029
|
+
*/
|
|
2030
|
+
async withdrawSupplyAll(options) {
|
|
2031
|
+
return contract.simulate.withdrawSupplyAll(options);
|
|
2032
|
+
},
|
|
2033
|
+
/**
|
|
2034
|
+
* Simulate withdrawTo
|
|
2035
|
+
* Returns gas estimate and result without sending transaction
|
|
2036
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2037
|
+
*/
|
|
2038
|
+
async withdrawTo(_asset_address, _amount, _to, options) {
|
|
2039
|
+
return contract.simulate.withdrawTo([_asset_address, _amount, _to], options);
|
|
2040
|
+
},
|
|
2041
|
+
/**
|
|
2042
|
+
* Simulate wrapNative
|
|
2043
|
+
* Returns gas estimate and result without sending transaction
|
|
2044
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
2045
|
+
*/
|
|
2046
|
+
async wrapNative(_amount, options) {
|
|
2047
|
+
return contract.simulate.wrapNative([_amount], options);
|
|
2048
|
+
}
|
|
2049
|
+
};
|
|
2050
|
+
}
|
|
2051
|
+
/**
|
|
2052
|
+
* Watch contract events
|
|
2053
|
+
*
|
|
2054
|
+
* @example
|
|
2055
|
+
* // Watch all Transfer events
|
|
2056
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
2057
|
+
* console.log('Transfer:', event);
|
|
2058
|
+
* });
|
|
2059
|
+
*
|
|
2060
|
+
* // Stop watching
|
|
2061
|
+
* unwatch();
|
|
2062
|
+
*/
|
|
2063
|
+
get watch() {
|
|
2064
|
+
return {
|
|
2065
|
+
/**
|
|
2066
|
+
* Watch ApproveToken events
|
|
2067
|
+
* @param callback Function to call when event is emitted
|
|
2068
|
+
* @param filter Optional filter for indexed parameters
|
|
2069
|
+
* @returns Unwatch function to stop listening
|
|
2070
|
+
*/
|
|
2071
|
+
ApproveToken: (callback, filter) => {
|
|
2072
|
+
return this.publicClient.watchContractEvent({
|
|
2073
|
+
address: this.contractAddress,
|
|
2074
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2075
|
+
eventName: 'ApproveToken',
|
|
2076
|
+
args: filter,
|
|
2077
|
+
onLogs: (logs) => {
|
|
2078
|
+
logs.forEach((log) => {
|
|
2079
|
+
callback(log.args);
|
|
2080
|
+
});
|
|
2081
|
+
},
|
|
2082
|
+
});
|
|
2083
|
+
},
|
|
2084
|
+
/**
|
|
2085
|
+
* Watch ClaimMerkleRewards events
|
|
2086
|
+
* @param callback Function to call when event is emitted
|
|
2087
|
+
* @param filter Optional filter for indexed parameters
|
|
2088
|
+
* @returns Unwatch function to stop listening
|
|
2089
|
+
*/
|
|
2090
|
+
ClaimMerkleRewards: (callback, filter) => {
|
|
2091
|
+
return this.publicClient.watchContractEvent({
|
|
2092
|
+
address: this.contractAddress,
|
|
2093
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2094
|
+
eventName: 'ClaimMerkleRewards',
|
|
2095
|
+
args: filter,
|
|
2096
|
+
onLogs: (logs) => {
|
|
2097
|
+
logs.forEach((log) => {
|
|
2098
|
+
callback(log.args);
|
|
2099
|
+
});
|
|
2100
|
+
},
|
|
2101
|
+
});
|
|
2102
|
+
},
|
|
2103
|
+
/**
|
|
2104
|
+
* Watch ExecutorUpdated events
|
|
2105
|
+
* @param callback Function to call when event is emitted
|
|
2106
|
+
* @param filter Optional filter for indexed parameters
|
|
2107
|
+
* @returns Unwatch function to stop listening
|
|
2108
|
+
*/
|
|
2109
|
+
ExecutorUpdated: (callback, filter) => {
|
|
2110
|
+
return this.publicClient.watchContractEvent({
|
|
2111
|
+
address: this.contractAddress,
|
|
2112
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2113
|
+
eventName: 'ExecutorUpdated',
|
|
2114
|
+
args: filter,
|
|
2115
|
+
onLogs: (logs) => {
|
|
2116
|
+
logs.forEach((log) => {
|
|
2117
|
+
callback(log.args);
|
|
2118
|
+
});
|
|
2119
|
+
},
|
|
2120
|
+
});
|
|
2121
|
+
},
|
|
2122
|
+
/**
|
|
2123
|
+
* Watch LogWithdraw events
|
|
2124
|
+
* @param callback Function to call when event is emitted
|
|
2125
|
+
* @param filter Optional filter for indexed parameters
|
|
2126
|
+
* @returns Unwatch function to stop listening
|
|
2127
|
+
*/
|
|
2128
|
+
LogWithdraw: (callback, filter) => {
|
|
2129
|
+
return this.publicClient.watchContractEvent({
|
|
2130
|
+
address: this.contractAddress,
|
|
2131
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2132
|
+
eventName: 'LogWithdraw',
|
|
2133
|
+
args: filter,
|
|
2134
|
+
onLogs: (logs) => {
|
|
2135
|
+
logs.forEach((log) => {
|
|
2136
|
+
callback(log.args);
|
|
2137
|
+
});
|
|
2138
|
+
},
|
|
2139
|
+
});
|
|
2140
|
+
},
|
|
2141
|
+
/**
|
|
2142
|
+
* Watch OwnershipTransferStarted events
|
|
2143
|
+
* @param callback Function to call when event is emitted
|
|
2144
|
+
* @param filter Optional filter for indexed parameters
|
|
2145
|
+
* @returns Unwatch function to stop listening
|
|
2146
|
+
*/
|
|
2147
|
+
OwnershipTransferStarted: (callback, filter) => {
|
|
2148
|
+
return this.publicClient.watchContractEvent({
|
|
2149
|
+
address: this.contractAddress,
|
|
2150
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2151
|
+
eventName: 'OwnershipTransferStarted',
|
|
2152
|
+
args: filter,
|
|
2153
|
+
onLogs: (logs) => {
|
|
2154
|
+
logs.forEach((log) => {
|
|
2155
|
+
callback(log.args);
|
|
2156
|
+
});
|
|
2157
|
+
},
|
|
2158
|
+
});
|
|
2159
|
+
},
|
|
2160
|
+
/**
|
|
2161
|
+
* Watch OwnershipTransferred events
|
|
2162
|
+
* @param callback Function to call when event is emitted
|
|
2163
|
+
* @param filter Optional filter for indexed parameters
|
|
2164
|
+
* @returns Unwatch function to stop listening
|
|
2165
|
+
*/
|
|
2166
|
+
OwnershipTransferred: (callback, filter) => {
|
|
2167
|
+
return this.publicClient.watchContractEvent({
|
|
2168
|
+
address: this.contractAddress,
|
|
2169
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2170
|
+
eventName: 'OwnershipTransferred',
|
|
2171
|
+
args: filter,
|
|
2172
|
+
onLogs: (logs) => {
|
|
2173
|
+
logs.forEach((log) => {
|
|
2174
|
+
callback(log.args);
|
|
2175
|
+
});
|
|
2176
|
+
},
|
|
2177
|
+
});
|
|
2178
|
+
},
|
|
2179
|
+
/**
|
|
2180
|
+
* Watch SnapshotUpdate events
|
|
2181
|
+
* @param callback Function to call when event is emitted
|
|
2182
|
+
* @param filter Optional filter for indexed parameters
|
|
2183
|
+
* @returns Unwatch function to stop listening
|
|
2184
|
+
*/
|
|
2185
|
+
SnapshotUpdate: (callback, filter) => {
|
|
2186
|
+
return this.publicClient.watchContractEvent({
|
|
2187
|
+
address: this.contractAddress,
|
|
2188
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2189
|
+
eventName: 'SnapshotUpdate',
|
|
2190
|
+
args: filter,
|
|
2191
|
+
onLogs: (logs) => {
|
|
2192
|
+
logs.forEach((log) => {
|
|
2193
|
+
callback(log.args);
|
|
2194
|
+
});
|
|
2195
|
+
},
|
|
2196
|
+
});
|
|
2197
|
+
},
|
|
2198
|
+
/**
|
|
2199
|
+
* Watch UpdateLoanConfig events
|
|
2200
|
+
* @param callback Function to call when event is emitted
|
|
2201
|
+
* @param filter Optional filter for indexed parameters
|
|
2202
|
+
* @returns Unwatch function to stop listening
|
|
2203
|
+
*/
|
|
2204
|
+
UpdateLoanConfig: (callback) => {
|
|
2205
|
+
return this.publicClient.watchContractEvent({
|
|
2206
|
+
address: this.contractAddress,
|
|
2207
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2208
|
+
eventName: 'UpdateLoanConfig',
|
|
2209
|
+
onLogs: (logs) => {
|
|
2210
|
+
logs.forEach((log) => {
|
|
2211
|
+
callback(log.args);
|
|
2212
|
+
});
|
|
2213
|
+
},
|
|
2214
|
+
});
|
|
2215
|
+
},
|
|
2216
|
+
/**
|
|
2217
|
+
* Watch UpdateMerkleDistributor events
|
|
2218
|
+
* @param callback Function to call when event is emitted
|
|
2219
|
+
* @param filter Optional filter for indexed parameters
|
|
2220
|
+
* @returns Unwatch function to stop listening
|
|
2221
|
+
*/
|
|
2222
|
+
UpdateMerkleDistributor: (callback, filter) => {
|
|
2223
|
+
return this.publicClient.watchContractEvent({
|
|
2224
|
+
address: this.contractAddress,
|
|
2225
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2226
|
+
eventName: 'UpdateMerkleDistributor',
|
|
2227
|
+
args: filter,
|
|
2228
|
+
onLogs: (logs) => {
|
|
2229
|
+
logs.forEach((log) => {
|
|
2230
|
+
callback(log.args);
|
|
2231
|
+
});
|
|
2232
|
+
},
|
|
2233
|
+
});
|
|
2234
|
+
},
|
|
2235
|
+
/**
|
|
2236
|
+
* Watch UpdateMorphoBlue events
|
|
2237
|
+
* @param callback Function to call when event is emitted
|
|
2238
|
+
* @param filter Optional filter for indexed parameters
|
|
2239
|
+
* @returns Unwatch function to stop listening
|
|
2240
|
+
*/
|
|
2241
|
+
UpdateMorphoBlue: (callback) => {
|
|
2242
|
+
return this.publicClient.watchContractEvent({
|
|
2243
|
+
address: this.contractAddress,
|
|
2244
|
+
abi: exports.LoanManagerOwnable2StepWithShortcutAbi,
|
|
2245
|
+
eventName: 'UpdateMorphoBlue',
|
|
2246
|
+
onLogs: (logs) => {
|
|
2247
|
+
logs.forEach((log) => {
|
|
2248
|
+
callback(log.args);
|
|
2249
|
+
});
|
|
2250
|
+
},
|
|
2251
|
+
});
|
|
2252
|
+
}
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
exports.LoanManagerOwnable2StepWithShortcut = LoanManagerOwnable2StepWithShortcut;
|