-
Notifications
You must be signed in to change notification settings - Fork 0
/
SuCdpRegistry.json
837 lines (837 loc) · 200 KB
/
SuCdpRegistry.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
{
"address": "0x8D8Ba548bDae0063c481A1ee9C82e5C81C020888",
"abi": [
{
"inputs": [],
"name": "AlreadyDisabled",
"type": "error"
},
{
"inputs": [],
"name": "AlreadyEnabled",
"type": "error"
},
{
"inputs": [],
"name": "AlreadyExist",
"type": "error"
},
{
"inputs": [],
"name": "ArgumentsLengthMismatch",
"type": "error"
},
{
"inputs": [],
"name": "BadAccessControlSingleton",
"type": "error"
},
{
"inputs": [],
"name": "NotExist",
"type": "error"
},
{
"inputs": [],
"name": "OnlyAdminError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyAlerterError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyDAOError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyLiquidationAccessError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyMintAccessError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRewardAccessError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyRoleError",
"type": "error"
},
{
"inputs": [],
"name": "OnlyVaultAccessError",
"type": "error"
},
{
"inputs": [],
"name": "ZeroAddress",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "Added",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "CollateralAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "CollateralDisabled",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "CollateralEnabled",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "Removed",
"type": "event"
},
{
"inputs": [],
"name": "ACCESS_CONTROL_SINGLETON",
"outputs": [
{
"internalType": "contract ISuAccessControl",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ADMIN_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ALERTER_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "DAO_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LIQUIDATION_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MINT_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "REWARD_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VAULT_ACCESS_ROLE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "addCollateral",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "checkpoint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "collateralInfo",
"outputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isDisabled",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "collaterals",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "disableCollateral",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "enableCollateral",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getAllCdps",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"internalType": "struct ISuCdpRegistry.CDP[]",
"name": "r",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "getCdpsByCollateral",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"internalType": "struct ISuCdpRegistry.CDP[]",
"name": "cdps",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "getCdpsByOwner",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"internalType": "struct ISuCdpRegistry.CDP[]",
"name": "r",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getCdpsCount",
"outputs": [
{
"internalType": "uint256",
"name": "totalCdpCount",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "getCdpsCountForCollateral",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_authControl",
"type": "address"
},
{
"internalType": "address",
"name": "_vault",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "isAlive",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
}
],
"name": "isCollateral",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "isListed",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "vault",
"outputs": [
{
"internalType": "contract ISuVault",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"numDeployments": 1,
"solcInputHash": "6bdb767f00e3f0fe0de7c63e7a48801d",
"metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AlreadyDisabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyEnabled\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ArgumentsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"BadAccessControlSingleton\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotExist\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAdminError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyAlerterError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyDAOError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyLiquidationAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyMintAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRewardAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyRoleError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyVaultAccessError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"Added\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"CollateralAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"CollateralDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"CollateralEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"Removed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ACCESS_CONTROL_SINGLETON\",\"outputs\":[{\"internalType\":\"contract ISuAccessControl\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ALERTER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DAO_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIQUIDATION_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MINT_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REWARD_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"VAULT_ACCESS_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"addCollateral\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"checkpoint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"collateralInfo\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"isDisabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"collaterals\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"disableCollateral\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"enableCollateral\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllCdps\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"internalType\":\"struct ISuCdpRegistry.CDP[]\",\"name\":\"r\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getCdpsByCollateral\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"internalType\":\"struct ISuCdpRegistry.CDP[]\",\"name\":\"cdps\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getCdpsByOwner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"internalType\":\"struct ISuCdpRegistry.CDP[]\",\"name\":\"r\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCdpsCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalCdpCount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getCdpsCountForCollateral\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_authControl\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"isAlive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"isCollateral\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"isListed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vault\",\"outputs\":[{\"internalType\":\"contract ISuVault\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"See ISuCdpRegistry interface for full details.\",\"kind\":\"dev\",\"methods\":{\"addCollateral(address)\":{\"details\":\"After deployment collaterals should be added in our protocol*\"},\"supportsInterface(bytes4)\":{\"details\":\"Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.\"}},\"title\":\"SuCdpRegistry\",\"version\":1},\"userdoc\":{\"events\":{\"Added(address,address)\":{\"notice\":\"event emitted when a new CDP is created\"},\"Removed(address,address)\":{\"notice\":\"event emitted when a CDP is closed\"}},\"kind\":\"user\",\"methods\":{\"addCollateral(address)\":{\"notice\":\"Add asset as collateral for our protocol\"},\"checkpoint(address,address)\":{\"notice\":\"method to add or remove owner from cdpList[asset]\"},\"disableCollateral(address)\":{\"notice\":\"Disable collateral in our protocol. Not removed, because it can add problems with users with removed collateral*\"},\"enableCollateral(address)\":{\"notice\":\"Enable recently added collateral in our protocol. Not removed, because it can add problems with users with removed collateral*\"},\"getAllCdps()\":{\"notice\":\"read-only function to get the list of all cdps\"},\"getCdpsByCollateral(address)\":{\"notice\":\"read-only function to get the list of cdps for a given collateral\"},\"getCdpsByOwner(address)\":{\"notice\":\"read-only function to get the list of all cdps by borrower\"},\"getCdpsCount()\":{\"notice\":\"total number of cdps\"},\"getCdpsCountForCollateral(address)\":{\"notice\":\"number of cdps for a given collateral\"},\"isAlive(address,address)\":{\"notice\":\"alive means there are debts in the vault for this collateral of this borrower\"},\"isCollateral(address)\":{\"notice\":\"Check whether asset is collateral*\"},\"isListed(address,address)\":{\"notice\":\"listed means there are created cdps in this contract for this collateral of this borrower\"}},\"notice\":\"Here we store protocol collaterals and use it in GraphQL\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/lending/SuCdpRegistry.sol\":\"SuCdpRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControlUpgradeable {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0xb8f5302f12138c5561362e88a78d061573e6298b7a1a5afe84a1e2c8d4d5aeaa\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```solidity\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n *\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized != type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Returns the highest version that has been initialized. See {reinitializer}.\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x89be10e757d242e9b18d5a32c9fbe2019f6d63052bbe46397a430a1d60d7f794\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x0e1f0f5f62f67a881cd1a9597acbc0a5e4071f3c2c10449a183b922ae7272e3f\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xd60f939a3ca0199014d079b4dd66aa757954334947d81eb5c1d35d7a83061ab3\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../extensions/IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n using AddressUpgradeable for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20Upgradeable token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20PermitUpgradeable token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0x23b997be73d3dd46885262704f0f8cfc7273fdadfe303d37969a9561373972b5\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9c80f545915582e63fe206c6ce27cbe85a86fc10b9cd2a0e8c9488fb7c2ee422\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165Upgradeable {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0xc6cef87559d0aeffdf0a99803de655938a7779ec0a3cd5d4383483ad85565a09\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n *\\n * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing\\n * all math on `uint256` and `int256` and then downcasting.\\n */\\nlibrary SafeCastUpgradeable {\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n require(value <= type(uint248).max, \\\"SafeCast: value doesn't fit in 248 bits\\\");\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n require(value <= type(uint240).max, \\\"SafeCast: value doesn't fit in 240 bits\\\");\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n require(value <= type(uint232).max, \\\"SafeCast: value doesn't fit in 232 bits\\\");\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n *\\n * _Available since v4.2._\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n require(value <= type(uint224).max, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n require(value <= type(uint216).max, \\\"SafeCast: value doesn't fit in 216 bits\\\");\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n require(value <= type(uint208).max, \\\"SafeCast: value doesn't fit in 208 bits\\\");\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n require(value <= type(uint200).max, \\\"SafeCast: value doesn't fit in 200 bits\\\");\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n require(value <= type(uint192).max, \\\"SafeCast: value doesn't fit in 192 bits\\\");\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n require(value <= type(uint184).max, \\\"SafeCast: value doesn't fit in 184 bits\\\");\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n require(value <= type(uint176).max, \\\"SafeCast: value doesn't fit in 176 bits\\\");\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n require(value <= type(uint168).max, \\\"SafeCast: value doesn't fit in 168 bits\\\");\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n require(value <= type(uint160).max, \\\"SafeCast: value doesn't fit in 160 bits\\\");\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n require(value <= type(uint152).max, \\\"SafeCast: value doesn't fit in 152 bits\\\");\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n require(value <= type(uint144).max, \\\"SafeCast: value doesn't fit in 144 bits\\\");\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n require(value <= type(uint136).max, \\\"SafeCast: value doesn't fit in 136 bits\\\");\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n require(value <= type(uint128).max, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n require(value <= type(uint120).max, \\\"SafeCast: value doesn't fit in 120 bits\\\");\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n require(value <= type(uint112).max, \\\"SafeCast: value doesn't fit in 112 bits\\\");\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n require(value <= type(uint104).max, \\\"SafeCast: value doesn't fit in 104 bits\\\");\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n *\\n * _Available since v4.2._\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n require(value <= type(uint96).max, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n require(value <= type(uint88).max, \\\"SafeCast: value doesn't fit in 88 bits\\\");\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n require(value <= type(uint80).max, \\\"SafeCast: value doesn't fit in 80 bits\\\");\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n require(value <= type(uint72).max, \\\"SafeCast: value doesn't fit in 72 bits\\\");\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n require(value <= type(uint64).max, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n require(value <= type(uint56).max, \\\"SafeCast: value doesn't fit in 56 bits\\\");\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n require(value <= type(uint48).max, \\\"SafeCast: value doesn't fit in 48 bits\\\");\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n require(value <= type(uint40).max, \\\"SafeCast: value doesn't fit in 40 bits\\\");\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n require(value <= type(uint32).max, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n *\\n * _Available since v4.7._\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n require(value <= type(uint24).max, \\\"SafeCast: value doesn't fit in 24 bits\\\");\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n require(value <= type(uint16).max, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n *\\n * _Available since v2.5._\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n require(value <= type(uint8).max, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n *\\n * _Available since v3.0._\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n require(value >= 0, \\\"SafeCast: value must be positive\\\");\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 248 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 240 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 232 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 224 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 216 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 208 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 200 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 192 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 184 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 176 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 168 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 160 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 152 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 144 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 136 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 128 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 120 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 112 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 104 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 96 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 88 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 80 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 72 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 64 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 56 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 48 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 40 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 32 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n *\\n * _Available since v4.7._\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 24 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 16 bits\\\");\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n *\\n * _Available since v3.1._\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n require(downcasted == value, \\\"SafeCast: value doesn't fit in 8 bits\\\");\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n *\\n * _Available since v3.0._\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n require(value <= uint256(type(int256).max), \\\"SafeCast: value doesn't fit in an int256\\\");\\n return int256(value);\\n }\\n}\\n\",\"keccak256\":\"0xcef50f95b43b038aa40aed25b62fc45906c681a5c1d504a4fdcf3bc6330a8d4b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```solidity\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSetUpgradeable {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x1c65595a26548a1b2263315b08a56334a2d7087319814437559c3c96025e939f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\n\\n/**\\n * @dev Interface for the optional metadata functions from the ERC20 standard.\\n *\\n * _Available since v4.1._\\n */\\ninterface IERC20Metadata is IERC20 {\\n /**\\n * @dev Returns the name of the token.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the symbol of the token.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the decimals places of the token.\\n */\\n function decimals() external view returns (uint8);\\n}\\n\",\"keccak256\":\"0x8de418a5503946cabe331f35fe242d3201a73f67f77aaeb7110acb1f30423aca\",\"license\":\"MIT\"},\"contracts/interfaces/IRewardChefV2.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport \\\"../periphery/contracts/interfaces/oracle/ISuOracle.sol\\\";\\n\\n/**\\n * @title RewardChefV2\\n * @notice fork of MasterChefV2(13/05/2023) https://etherscan.io/address/0xef0881ec094552b2e128cf945ef17a6752b4ec5d#code\\n * @dev This contract is based on MVC2, but uses \\\"virtual\\\" balances instead of storing real ERC20 tokens\\n * and uses address of this assets instead of pid.\\n * Rewards that are distributed have to be deposited using refillReward(uint256 amount, uint64 endBlock)\\n **/\\ninterface IRewardChefV2 {\\n /**\\n * @notice Info of each reward pool.\\n * @param accSushiPerShare -\\n * @param lastRewardBlock -\\n * @param allocPoint - The amount of allocation points assigned to the pool.\\n * Also known as the amount of REWARD_TOKEN to distribute per block.\\n * @param lpSupply -\\n **/\\n struct PoolInfo {\\n uint128 accSushiPerShare;\\n uint64 lastRewardBlock;\\n uint64 allocPoint;\\n uint256 lpSupply;\\n }\\n\\n /**\\n * @notice Info of each user.\\n * @param amount - token amount the user has provided.\\n * @param rewardDebt - The amount of rewards entitled to the user.\\n * @param multiplicator1e18 - deposit amount multiplicator for current user, that depends on his lockupPeriod\\n * @param lockupPeriodSeconds - users lockupPeriod in seconds\\n * @param lockupStartTimestamp - timestamp when user start lockup\\n **/\\n struct UserInfo {\\n uint256 amount;\\n int256 rewardDebt;\\n\\n uint256 multiplicator1e18;\\n uint256 lockupPeriodSeconds;\\n uint256 lockupStartTimestamp;\\n }\\n\\n /**\\n * @notice Lockup info struct for a view method getPossibleLockupPeriodsSeconds()\\n * @param lockupPeriodSeconds - available lockupPeriod in seconds\\n * @param multiplicator1e18 - deposit amount multiplicator for this lockup period\\n **/\\n struct ILockupPeriod {\\n uint256 lockupPeriodSeconds;\\n uint256 multiplicator1e18;\\n }\\n\\n // =======================================EVENTS=============================================\\n event VirtualDeposit(address indexed user, address indexed asset, uint256 amount);\\n event VirtualWithdraw(address indexed user, address indexed asset, uint256 amount);\\n event ResetAmount(\\n address indexed user, address indexed asset, address indexed to, uint256 amount, uint256 lockupPeriodSeconds\\n );\\n event Harvest(address indexed user, address indexed asset, uint256 amount);\\n event LogPoolAddition(address indexed asset, uint256 allocPoint);\\n event LogSetPool(address indexed asset, uint256 allocPoint);\\n event LogUpdatePool(address indexed asset, uint64 lastRewardBlock, uint256 lpSupply, uint256 accSushiPerShare);\\n\\n // =======================================ERRORS=============================================\\n error BadEndBlockForRefill();\\n error ZeroLockupPeriod();\\n error ZeroMultiplicator();\\n error PoolExist();\\n error PoolNotExist();\\n error DifferentLockup();\\n error HarvestBeforeLockup();\\n\\n // =========================================VARS=============================================\\n /**\\n * @dev Total allocation points. Must be the sum of all allocation points in all pools.\\n * The good practice, to always keep this variable is equal 1000.\\n */\\n function totalAllocPoint() external view returns ( uint256 );\\n\\n // =======================================REWARDER=============================================\\n // solhint-disable-next-line func-name-mixedcase\\n function REWARD_TOKEN() external view returns ( IERC20Upgradeable );\\n // solhint-disable-next-line func-name-mixedcase\\n function ORACLE() external view returns ( ISuOracle );\\n function rewardPerBlock() external view returns ( uint256 );\\n function rewardEndBlock() external view returns ( uint256 );\\n\\n /**\\n * @dev admin transfer REWARD_TOKEN to contract to increase rewards per block\\n */\\n function refillReward(uint256 amount, uint64 endBlock) external;\\n /**\\n * @dev returns total amount of rewards allocated to the all pools on the rage (startBlock, endBlock]\\n * i.e. excluding startBlock but including endBlock\\n */\\n function rewardsBetweenBlocks(uint256 startBlock, uint256 endBlock) external returns ( uint256 );\\n\\n //=======================================LOCKUP LOGIC===========================================\\n /**\\n * @notice view method that return all lockupPeriods in ILockupPeriod struct\\n */\\n function getPossibleLockupPeriodsSeconds() external view returns (ILockupPeriod[] memory);\\n\\n /**\\n * @notice method to add new LockupPeriods with it multiplicator\\n * @dev If multiplicator1e18 == 0 => we remove lockupPeriodSeconds else we add it\\n * @param lockupPeriodSeconds Amount of seconds of lockupPeriod we want to add/remove\\n * @param multiplicator1e18 Multiplicator for that lockupPeriod\\n */\\n function setPossibleLockupPeriodsSeconds(uint256 lockupPeriodSeconds, uint256 multiplicator1e18) external;\\n\\n //================================CORE REWARD CHEF METHODS======================================\\n /**\\n * @notice Add a new reward pool. Can only be called by the admin. Can't add the same LP token more than once.\\n * @param allocPoint AP of the new pool.\\n * @param _asset Address of the ERC-20 token.\\n */\\n function add(uint256 allocPoint, address _asset) external;\\n\\n /**\\n * @notice Update the given pool's REWARD_TOKEN allocation point. Can only be called by the admin.\\n * Can't be called for asset that was not added by add() function.\\n * @param _asset Address of the ERC-20 token.\\n * @param _allocPoint New AP of the pool.\\n */\\n function set(address _asset, uint256 _allocPoint) external;\\n\\n /**\\n * @notice View function to see pending REWARD_TOKEN on frontend.\\n * @param _asset Address of the ERC-20 token.\\n * @param _user Address of user.\\n * @return pending REWARD_TOKEN reward for a given user.\\n */\\n function pendingSushi(address _asset, address _user) external view returns ( uint256 );\\n\\n /**\\n * @notice Update reward variables of the given pool.\\n * @param asset Asset address\\n * @return updated pool info\\n */\\n function updatePool(address asset) external returns ( PoolInfo memory );\\n\\n /**\\n * @notice Update reward variables for all pools. Be careful of gas spending!\\n */\\n function updateAllPools() external;\\n\\n /**\\n * @notice analogues to MCV2 Deposit method, but can be called only by trusted address (onlyRewardAccess)\\n * that is trusted to honestly calc how many \\\"virtual\\\" tokens have to be allocated for each user.\\n * @param asset Asset address\\n * @param to User for whom we will increase the virtual balance\\n * @param amountEDecimal Quantity without taking into account the multiplier that we will add\\n * @param lockupPeriodSeconds Current deposit lockup period. Can't increase amount with 2 different lockupPeriods\\n */\\n function increaseAmount(address asset, address to, uint256 amountEDecimal, uint256 lockupPeriodSeconds) external;\\n\\n /**\\n * @notice Analogues to MVC2 Withdraw method, that can be called only by trusted address (onlyRewardAccess)\\n * that is trusted to honestly calc how many \\\"virtual\\\" tokens have to be allocated for each user.\\n * @param asset Asset address\\n * @param to User for whom we will subtract the virtual balance\\n * @param amountEDecimal Quantity without taking into account the multiplier that we will subtract\\n */\\n function decreaseAmount(address asset, address to, uint256 amountEDecimal) external;\\n\\n /**\\n * @notice View method that return penalty for user that will decrease amount by {amountEDecimal}\\n * @param asset Asset address\\n * @param to User who will decrease his deposit amount\\n * @param amountEDecimal Quantity without taking into account the multiplier that we will subtract\\n */\\n function getDecreaseAmountRewardPenalty(\\n address asset,\\n address to,\\n uint256 amountEDecimal\\n ) external view returns (uint256);\\n\\n /**\\n * @notice Harvest proceeds for transaction sender to {to}.\\n * @dev Here we send msg.sender pendingSushi to {to} and update lockup period.\\n * @param asset Asset address\\n * @param to Receiver of REWARD_TOKEN rewards.\\n */\\n function harvest(address asset, address to, uint256 newLockupPeriodSeconds) external;\\n\\n // TODO: check for exploits\\n /**\\n * @notice Withdraw without caring about rewards. EMERGENCY ONLY.\\n * @param asset Asset address\\n * @param to The address of the user whose information will be cleared\\n */\\n function resetAmount(address asset, address to) external;\\n\\n //================================VIEW METHODS======================================\\n /**\\n * @notice Method for frontend that return pool APR\\n * @param asset Asset address\\n */\\n function getPoolApr(address asset) external view returns (uint256);\\n\\n /**\\n * @notice Reward tokens can be locked for certain period of time.\\n * So user have to wait until at least timestamp to be able to harvest them.\\n * There's no lock or any restriction on withdrawing principle.\\n * This function return end timestamp for that lock.\\n * @param asset Asset address\\n * @param user User address\\n */\\n function getHarvestLockupEndTimestamp(address asset, address user) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xc03f1bb9765cbe888e07c506481afe4c17e46b22a71f6e955ce65e1427ad5c40\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ISuCdpRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title SuCdpRegistry\\n * @notice This contract is needed to index all opened CDPs.\\n * @dev It can be removed if there's more gas-efficient way to do that, such as graphQL, NFT-lps or other methods\\n **/\\ninterface ISuCdpRegistry {\\n /// @notice Collateral Debt Position\\n struct CDP {\\n address asset; // collateral token\\n address owner; // borrower account\\n }\\n\\n /* ===================== EVENTS ===================== */\\n\\n /// @notice event emitted when a new CDP is created\\n event Added(address indexed asset, address indexed owner);\\n\\n /// @notice event emitted when a CDP is closed\\n event Removed(address indexed asset, address indexed owner);\\n\\n /* ===================== ERRORS ===================== */\\n\\n error ArgumentsLengthMismatch();\\n\\n /* ==================== MUTABLE METHODS ==================== */\\n\\n /// @notice method to add or remove owner from cdpList[asset]\\n function checkpoint ( address asset, address owner ) external;\\n\\n /* ==================== VIEW METHODS ==================== */\\n\\n /// @notice read-only function to get the list of all cdps\\n function getAllCdps ( ) external view returns ( CDP[] memory r );\\n\\n /// @notice read-only function to get the list of cdps for a given collateral\\n function getCdpsByCollateral ( address asset ) external view returns ( CDP[] memory cdps );\\n\\n /// @notice read-only function to get the list of all cdps by borrower\\n function getCdpsByOwner ( address owner ) external view returns ( CDP[] memory r );\\n\\n /// @notice total number of cdps\\n function getCdpsCount ( ) external view returns ( uint256 totalCdpCount );\\n\\n /// @notice number of cdps for a given collateral\\n function getCdpsCountForCollateral ( address asset ) external view returns ( uint256 );\\n\\n /// @notice alive means there are debts in the vault for this collateral of this borrower\\n function isAlive ( address asset, address owner ) external view returns ( bool );\\n\\n /// @notice listed means there are created cdps in this contract for this collateral of this borrower\\n function isListed ( address asset, address owner ) external view returns ( bool );\\n}\\n\",\"keccak256\":\"0x3432617f951b39e14646d87b36091c3e15c97f4039586553dd1cf88689cd23c7\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ISuCollateralRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nstruct CollateralRegistryInfo {\\n uint256 index;\\n bool isDisabled;\\n}\\n\\n/**\\n * @title SuCollateralRegistry\\n * @notice Simple collateral container of assets as collaterals for our protocol.\\n * @dev It's used only by CdpRegistry.\\n **/\\ninterface ISuCollateralRegistry {\\n /* ===================== EVENTS ===================== */\\n event CollateralAdded(address indexed asset);\\n event CollateralDisabled(address indexed asset);\\n event CollateralEnabled(address indexed asset);\\n\\n /* ===================== ERRORS ===================== */\\n\\n error ZeroAddress();\\n error AlreadyExist();\\n error NotExist();\\n error AlreadyDisabled();\\n error AlreadyEnabled();\\n\\n /* ==================== METHODS ==================== */\\n\\n /**\\n * @notice Add asset as collateral for our protocol\\n * @dev After deployment collaterals should be added in our protocol\\n **/\\n function addCollateral ( address asset ) external;\\n\\n /**\\n * @notice Disable collateral in our protocol.\\n * Not removed, because it can add problems with users with removed collateral\\n **/\\n function disableCollateral ( address asset ) external;\\n\\n /**\\n * @notice Enable recently added collateral in our protocol.\\n * Not removed, because it can add problems with users with removed collateral\\n **/\\n function enableCollateral ( address asset ) external;\\n\\n /**\\n * @notice Check whether asset is collateral\\n **/\\n function isCollateral ( address asset ) external view returns ( bool );\\n}\\n\",\"keccak256\":\"0x572f3f9242cd3f86a0ec9e8f3f4535b4ee84ac2f54c236fe7f5e38fd5740392b\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ISuVault.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../lending/SuVaultParameters.sol\\\";\\nimport \\\"../interfaces/ISuVaultParameters.sol\\\";\\nimport \\\"../reward/RewardChefV2.sol\\\";\\n\\ninterface ISuVault is ISuVaultParameters {\\n /* ===================== EVENTS ===================== */\\n /**\\n * @notice Event triggered when user destroys cdp\\n **/\\n event PositionLiquidated(\\n address asset, address owner, address repayer, uint256 assetAmountEDecimal, uint256 repaymentE18\\n );\\n\\n /**\\n * @notice Event triggered when user liquidate some part of cdp (debt > 0)\\n **/\\n event PositionLiquidatedPartial(\\n address asset, address owner, address repayer, uint256 assetAmountEDecimal, uint256 repaymentE18\\n );\\n\\n /**\\n * @notice Event triggered when user call repay() function\\n **/\\n event PositionRepaid(address repayer, uint256 repaymentE18, uint256 excessAndFeeE18);\\n\\n /**\\n * @notice Event triggered when user didnt withdraw collateral before price goes down\\n **/\\n event LiquidationTriggered(address indexed asset, address indexed owner);\\n\\n /* ===================== ERRORS ===================== */\\n error LiquidationIsTriggered();\\n error Restricted();\\n error WithdrawExceeded();\\n error WrongDebt();\\n error WrongTotalDebt();\\n error UselessTransaction();\\n error AssetDebtLimit();\\n\\n /* ====================== VARS ====================== */\\n /**\\n * @notice how much collateral the users staked == collaterals[asset][user], i.e deposits\\n * EDecimal means that this value in asset denomination, i.e. x{human readable value} * 10^{erc20.decimals()}\\n **/\\n function collateralsEDecimal (address asset, address user) external view returns ( uint256 );\\n\\n /**\\n * @notice stablecoin amount\\n **/\\n function debtsE18 (address asset, address user) external view returns ( uint256 );\\n\\n /**\\n * @notice stablecoin amount + fee accumulated before lastUpdate == debtWithFeesE18[asset][user]\\n **/\\n function debtWithFeesE18 (address asset, address user) external view returns ( uint256 );\\n\\n /**\\n * @notice the last time, when every fee before lastUpdates are calculated in the debt.\\n * All data such as fees are from lastUpdate only\\n **/\\n function lastUpdate (address asset, address user) external view returns ( uint256 );\\n\\n /**\\n * @notice asset => user => block number\\n **/\\n function liquidationBlock (address asset, address user) external view returns (uint256);\\n\\n /**\\n * @notice current interest that user pay for stabilityFee[asset][user]\\n **/\\n function stabilityFeeE18 (address asset, address user) external view returns ( uint256 );\\n\\n /**\\n * @notice Stats, how much stablecoins were borrowed against particular asset == tokenDebtsE18[asset]\\n **/\\n function tokenDebtsE18 (address asset) external view returns ( uint256 );\\n\\n /**\\n * @notice tokenDebtsE18[asset] + accumulated fee in all CDPs in this asset\\n **/\\n function tokenDebtsWithFeesE18 (address asset) external view returns ( uint256 );\\n\\n /* ==================== MUTABLE METHODS ==================== */\\n /**\\n * @notice borrow usdPRO using selected asset.\\n * user expected previously to deposit collateral and then being able to take stablecoin\\n * user can't create single position with multiple collaterals?\\n **/\\n function borrow ( address asset, address user, uint256 amountE18, uint256 lockupPeriodSeconds ) external;\\n\\n /**\\n * @notice collateral deposit\\n **/\\n function deposit ( address asset, address user, uint256 amountEDecimal ) external;\\n\\n /**\\n * @notice only destroy debt info\\n * @dev onlyVaultAccess, exit -> _repay -> destroy if debt == 0\\n **/\\n function destroy ( address asset, address user ) external;\\n\\n /**\\n * @notice withdraw in case of some protocol errors, users can always get back their tokens\\n **/\\n function emergencyWithdraw ( address asset, address user, uint256 amountEDecimal ) external;\\n\\n /**\\n * @notice liquidate user position, just cut debt and withdraw user collateral without asking StablePro\\n **/\\n function liquidate(\\n address asset,\\n address owner,\\n address recipient,\\n uint256 assetAmountEDecimal,\\n uint256 stablecoinAmountE18\\n ) external;\\n\\n /**\\n * @notice set new RewardChef contract address\\n **/\\n function setRewardChef(address rewardChef) external;\\n\\n /**\\n * @notice Marks a position as to be liquidated\\n * @param asset The address of the main collateral token of a position\\n * @param positionOwner The owner of a position\\n * @dev Sets the current block as liquidationBlock for the position. Can be triggered only once for the position.\\n **/\\n function triggerLiquidation(address asset, address positionOwner) external;\\n\\n /**\\n * @notice Update all main state vars\\n * position is not allowed to be modified during liquidation, because when it's launched -\\n * liquidators want to be sure they can participate\\n * @dev is called, when user borrows more\\n **/\\n function update ( address asset, address user ) external;\\n\\n /**\\n * @notice collateral withdraw\\n **/\\n function withdraw ( address asset, address user, address recipient, uint256 amountEDecimal ) external;\\n\\n /**\\n * @notice Burns a debt repayment and transfers fees to the foundation.\\n * @param repayer The person who repaies by debt and transfers stablecoins to the foundation\\n * @param stablecoinsToRepaymentE18 The amount of stablecoins which will be burned as a debt repayment\\n * @param stablecoinsToFoundationE18 The amount of stablecoins which will be transfered to the foundation(e.g fees)\\n **/\\n function payFeeAndBurn(\\n address repayer,\\n uint256 stablecoinsToRepaymentE18,\\n uint256 stablecoinsToFoundationE18\\n ) external;\\n\\n /* ==================== VIEW METHODS ==================== */\\n\\n /**\\n * @notice fee is increased with time. Any call of vault.update would calc fee in debt and restart fee timer\\n **/\\n function calculateFeeE18 ( address asset, address user, uint256 amountE18 ) external view returns ( uint256 );\\n\\n /**\\n * @notice total dept is calculated as current debt with added calculated fee, don't use it in practice\\n **/\\n function getTotalDebtE18 ( address asset, address user ) external view returns ( uint256 );\\n}\\n\",\"keccak256\":\"0x7d9cc838d27dd71fff62d41f5523a4a0eda02c1ccdfd64a9e51578a044f833a5\",\"license\":\"UNLICENSED\"},\"contracts/interfaces/ISuVaultParameters.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title SuVaultParameters\\n * @notice SuVaultParameters is Singleton for Access Control, like configuration contract.\\n **/\\ninterface ISuVaultParameters {\\n /* ====================== VARS ====================== */\\n /**\\n * @notice Stability fee that is used in calculateFeeE18 to see how much user debt increased.\\n * It can be different for each collateral\\n **/\\n function protocolStabilityFeeE18 (address asset) external view returns ( uint256 );\\n\\n /**\\n * @notice Limit for each collateral-asset to manage risk profile\\n **/\\n function tokenDebtLimitE18 (address asset) external view returns ( uint256 );\\n\\n /* ===================== ERRORS ===================== */\\n error ZeroAddress();\\n\\n /* ==================== METHODS ==================== */\\n // TODO: creating new collaterals and modifying existing ones should be separate functions for security reason\\n /**\\n * @notice manager is allowed to add new collaterals and modify existing ones\\n **/\\n function setCollateral (address asset, uint256 stabilityFeeValueE18, uint256 stablecoinLimitE18) external;\\n\\n /**\\n * @notice manager is allowed to change foundation that receive fees and etc\\n **/\\n function setFoundation ( address newFoundation ) external;\\n\\n /**\\n * @notice set fee percentage (1e18 = 100%)\\n **/\\n function setStabilityFeeE18 ( address asset, uint256 newValue ) external;\\n\\n /**\\n * @notice debt limit can be changed for any collateral along with liquidation and stability fees\\n **/\\n function setTokenDebtLimitE18 ( address asset, uint256 limit ) external;\\n}\\n\",\"keccak256\":\"0x4cc72c9216b72ddfa81b20967d64e202cc2617d16c00b817f94e54b49767221d\",\"license\":\"UNLICENSED\"},\"contracts/lending/SuCdpRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\r\\n\\r\\npragma solidity ^0.8.0;\\r\\npragma experimental ABIEncoderV2;\\r\\n\\r\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\r\\n\\r\\nimport \\\"../interfaces/ISuVault.sol\\\";\\r\\nimport \\\"../interfaces/ISuCdpRegistry.sol\\\";\\r\\nimport \\\"./SuCollateralRegistry.sol\\\";\\r\\n\\r\\n/**\\r\\n * @title SuCdpRegistry\\r\\n * @notice Here we store protocol collaterals and use it in GraphQL\\r\\n * @dev See ISuCdpRegistry interface for full details.\\r\\n */\\r\\ncontract SuCdpRegistry is Initializable, SuCollateralRegistry, ISuCdpRegistry {\\r\\n // mapping from collateral token to list of borrowers\\r\\n mapping (address => address[]) private cdpList;\\r\\n\\r\\n // mapping from collateral token to borrower to the cdpList index\\r\\n mapping (address => mapping (address => uint256)) private cdpIndex;\\r\\n\\r\\n ISuVault public vault;\\r\\n\\r\\n function initialize(address _authControl, address _vault) public initializer {\\r\\n if (_vault == address(0)) revert ZeroAddress();\\r\\n vault = ISuVault(_vault);\\r\\n\\r\\n __suCollateralRegistryInit(_authControl);\\r\\n }\\r\\n\\r\\n // anyone can create checkpoint?\\r\\n function checkpoint(address asset, address owner) public {\\r\\n if (asset == address(0) || owner == address(0)) revert ZeroAddress();\\r\\n\\r\\n bool listed = isListed(asset, owner);\\r\\n bool alive = isAlive(asset, owner);\\r\\n\\r\\n if (alive && !listed) {\\r\\n _addCdp(asset, owner);\\r\\n } else if (listed && !alive) {\\r\\n _removeCdp(asset, owner);\\r\\n }\\r\\n }\\r\\n\\r\\n function _removeCdp(address asset, address owner) internal {\\r\\n // take the index by collateral and borrower\\r\\n uint256 id = cdpIndex[asset][owner];\\r\\n\\r\\n // then delete this index\\r\\n delete cdpIndex[asset][owner];\\r\\n\\r\\n // if the index is not the last one\\r\\n uint256 lastId = cdpList[asset].length - 1;\\r\\n\\r\\n // swap the last element with the element to be deleted\\r\\n if (id != lastId) {\\r\\n address lastOwner = cdpList[asset][lastId];\\r\\n cdpList[asset][id] = lastOwner;\\r\\n cdpIndex[asset][lastOwner] = id;\\r\\n }\\r\\n\\r\\n // delete the last element\\r\\n cdpList[asset].pop();\\r\\n\\r\\n // can we optimize this remove function by changing the structure?\\r\\n\\r\\n emit Removed(asset, owner);\\r\\n }\\r\\n\\r\\n function _addCdp(address asset, address owner) internal {\\r\\n // remember the index of the new element\\r\\n cdpIndex[asset][owner] = cdpList[asset].length;\\r\\n\\r\\n // add the new element to the end of the list\\r\\n cdpList[asset].push(owner);\\r\\n\\r\\n emit Added(asset, owner);\\r\\n }\\r\\n\\r\\n /* ==================== VIEW METHODS ==================== */\\r\\n\\r\\n function isAlive(address asset, address owner) public view returns (bool) {\\r\\n return vault.debtWithFeesE18(asset, owner) != 0;\\r\\n }\\r\\n\\r\\n function isListed(address asset, address owner) public view returns (bool) {\\r\\n if (cdpList[asset].length == 0) { return false; }\\r\\n return cdpIndex[asset][owner] != 0 || cdpList[asset][0] == owner;\\r\\n }\\r\\n\\r\\n function getCdpsByCollateral(address asset) external view returns (CDP[] memory cdps) {\\r\\n address[] memory owners = cdpList[asset];\\r\\n cdps = new CDP[](owners.length);\\r\\n for (uint16 i = 0; i < owners.length; ++i) {\\r\\n cdps[i] = CDP(asset, owners[i]);\\r\\n }\\r\\n }\\r\\n\\r\\n function getCdpsByOwner(address owner) external view returns (CDP[] memory r) {\\r\\n CDP[] memory cdps = new CDP[](collaterals.length);\\r\\n uint16 actualCdpsCount;\\r\\n\\r\\n for (uint16 i = 0; i < collaterals.length; ++i) {\\r\\n if (isListed(collaterals[i], owner)) {\\r\\n cdps[actualCdpsCount++] = CDP(collaterals[i], owner);\\r\\n }\\r\\n }\\r\\n\\r\\n r = new CDP[](actualCdpsCount);\\r\\n\\r\\n for (uint16 i = 0; i < actualCdpsCount; ++i) {\\r\\n r[i] = cdps[i];\\r\\n }\\r\\n }\\r\\n\\r\\n function getAllCdps() external view returns (CDP[] memory r) {\\r\\n uint256 totalCdpCount = getCdpsCount();\\r\\n\\r\\n uint256 cdpCount;\\r\\n\\r\\n r = new CDP[](totalCdpCount);\\r\\n\\r\\n for (uint16 i = 0; i < collaterals.length; i++) {\\r\\n address[] memory owners = cdpList[collaterals[i]];\\r\\n for (uint256 j = 0; j < owners.length; j++) {\\r\\n r[cdpCount++] = CDP(collaterals[i], owners[j]);\\r\\n }\\r\\n }\\r\\n }\\r\\n\\r\\n function getCdpsCount() public view returns (uint256 totalCdpCount) {\\r\\n totalCdpCount = 0;\\r\\n for (uint16 i = 0; i < collaterals.length; ++i) {\\r\\n totalCdpCount += cdpList[collaterals[i]].length;\\r\\n }\\r\\n }\\r\\n\\r\\n function getCdpsCountForCollateral(address asset) public view returns (uint256) {\\r\\n return cdpList[asset].length;\\r\\n }\\r\\n}\\r\\n\",\"keccak256\":\"0xf88a50f9ae6f00d2a36f5c36119d11fa91671c3b191e2486a3546eb6e5d0152f\",\"license\":\"BSL 1.1\"},\"contracts/lending/SuCollateralRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\r\\npragma solidity ^0.8.0;\\r\\n\\r\\nimport \\\"./SuVaultParameters.sol\\\";\\r\\nimport \\\"../interfaces/ISuCollateralRegistry.sol\\\";\\r\\nimport \\\"../periphery/contracts/access-control/SuAuthenticated.sol\\\";\\r\\n\\r\\n/**\\r\\n * @title SuCollateralRegistry\\r\\n * @dev See ISuCollateralRegistry interface for full details.\\r\\n */\\r\\nabstract contract SuCollateralRegistry is SuAuthenticated, ISuCollateralRegistry {\\r\\n mapping(address => CollateralRegistryInfo) public collateralInfo;\\r\\n address[] public collaterals;\\r\\n\\r\\n function __suCollateralRegistryInit(address _authControl) internal {\\r\\n __suAuthenticatedInit(_authControl);\\r\\n }\\r\\n\\r\\n function addCollateral(address asset) public onlyDAO {\\r\\n if (asset == address(0)) revert ZeroAddress();\\r\\n\\r\\n if (isCollateral(asset) || collateralInfo[asset].isDisabled) revert AlreadyExist();\\r\\n\\r\\n collateralInfo[asset] = CollateralRegistryInfo({ index: collaterals.length, isDisabled: false });\\r\\n collaterals.push(asset);\\r\\n\\r\\n emit CollateralAdded(asset);\\r\\n }\\r\\n\\r\\n function disableCollateral(address asset) public onlyDAO {\\r\\n if (collateralInfo[asset].isDisabled) revert AlreadyDisabled();\\r\\n if (!isCollateral(asset)) revert NotExist();\\r\\n\\r\\n collateralInfo[asset].isDisabled = true;\\r\\n\\r\\n emit CollateralDisabled(asset);\\r\\n }\\r\\n\\r\\n function enableCollateral(address asset) public onlyDAO {\\r\\n if (!collateralInfo[asset].isDisabled) {\\r\\n if (isCollateral(asset)) {\\r\\n revert AlreadyEnabled();\\r\\n } else {\\r\\n revert NotExist();\\r\\n }\\r\\n }\\r\\n\\r\\n collateralInfo[asset].isDisabled = false;\\r\\n\\r\\n emit CollateralEnabled(asset);\\r\\n }\\r\\n\\r\\n function isCollateral(address asset) public view returns(bool) {\\r\\n if (collaterals.length == 0) { return false; }\\r\\n\\r\\n return !collateralInfo[asset].isDisabled && (collateralInfo[asset].index != 0 || collaterals[0] == asset);\\r\\n }\\r\\n}\\r\\n\",\"keccak256\":\"0x6c990b48987f51415cd275f50e2ce6805a4a0e6cdbd155bbfdfd4eb5c610068e\",\"license\":\"BSL 1.1\"},\"contracts/lending/SuVaultParameters.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\r\\n\\r\\nimport \\\"../interfaces/ISuVaultParameters.sol\\\";\\r\\nimport \\\"../periphery/contracts/access-control/SuAuthenticated.sol\\\";\\r\\n\\r\\npragma solidity ^0.8.0;\\r\\n\\r\\n// TODO: merge with ManagerParameters\\r\\n/**\\r\\n * @title SuVaultParameters\\r\\n * @dev See ISuVaultParameters interface for full details.\\r\\n */\\r\\nabstract contract SuVaultParameters is SuAuthenticated, ISuVaultParameters {\\r\\n mapping(address => uint256) public protocolStabilityFeeE18;\\r\\n mapping(address => uint256) public tokenDebtLimitE18;\\r\\n address public foundation;\\r\\n address public vault;\\r\\n\\r\\n // how can vault address be known at this moment?\\r\\n // Precult based on CREATE spec\\r\\n // can be created another function to set vault address once deployed?\\r\\n // Yes, possibly with some logic change\\r\\n function __suVaultParametersInit(\\r\\n address _authControl,\\r\\n address payable _vault,\\r\\n address _foundation\\r\\n ) internal onlyInitializing {\\r\\n if (_vault == address(0) || _foundation == address(0)) revert ZeroAddress();\\r\\n\\r\\n __suAuthenticatedInit(_authControl);\\r\\n vault = _vault;\\r\\n foundation = _foundation;\\r\\n }\\r\\n\\r\\n function setFoundation(address newFoundation) external onlyDAO {\\r\\n if (newFoundation == address(0)) revert ZeroAddress();\\r\\n foundation = newFoundation;\\r\\n }\\r\\n\\r\\n // is called by Manager\\r\\n function setCollateral(\\r\\n address asset,\\r\\n uint256 stabilityFeeValueE18,\\r\\n uint256 stablecoinLimitE18\\r\\n ) external onlyVaultAccess {\\r\\n // stability fee should be validated in range, what is stability fee should be described here?\\r\\n setStabilityFeeE18(asset, stabilityFeeValueE18);\\r\\n // why debt limit for collateral is necessary? to manage risks in case of collateral failure?\\r\\n setTokenDebtLimitE18(asset, stablecoinLimitE18);\\r\\n }\\r\\n\\r\\n function setStabilityFeeE18(address asset, uint256 newValue) public onlyVaultAccess {\\r\\n protocolStabilityFeeE18[asset] = newValue;\\r\\n }\\r\\n\\r\\n function setTokenDebtLimitE18(address asset, uint256 limit) public onlyVaultAccess {\\r\\n tokenDebtLimitE18[asset] = limit;\\r\\n }\\r\\n}\\r\\n\",\"keccak256\":\"0x6a91a92cb6c0aaa9a0bf0fb7030b41179c4e39da48e80ac24e2c58f3aa3f5b4c\",\"license\":\"BSL 1.1\"},\"contracts/periphery/contracts/access-control/SuAccessRoles.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title SuAccessRoles Library\\n * @dev SuAuthenticated and SuAccessControlSingleton need to have this constants\\n * Hierarchy:\\n * 1. DAO - can give admins and system roles\\n * 2.1. Admin - can set Alerters\\n * 2.2. System - includes Minter, Vault, Liquidation and Reward roles, don't have access to give some roles.\\n * 3. Alerter - can send alerts and trigger rate limits, don't have access to give some roles.\\n */\\nabstract contract SuAccessRoles {\\n bytes32 public constant ADMIN_ROLE = 0x00;\\n\\n bytes32 public constant DAO_ROLE = keccak256(\\\"DAO_ROLE\\\");\\n\\n bytes32 public constant ALERTER_ROLE = keccak256(\\\"ALERTER_ROLE\\\");\\n\\n // system roles\\n bytes32 public constant MINT_ACCESS_ROLE = keccak256(\\\"MINT_ACCESS_ROLE\\\");\\n bytes32 public constant VAULT_ACCESS_ROLE = keccak256(\\\"VAULT_ACCESS_ROLE\\\");\\n bytes32 public constant LIQUIDATION_ACCESS_ROLE = keccak256(\\\"LIQUIDATION_ACCESS_ROLE\\\");\\n bytes32 public constant REWARD_ACCESS_ROLE = keccak256(\\\"REWARD_ACCESS_ROLE\\\");\\n}\\n\",\"keccak256\":\"0x024209469b6b337eef6cf520501d1e6c2ba66a79f014c25220a35e407d69b02e\",\"license\":\"BSL 1.1\"},\"contracts/periphery/contracts/access-control/SuAuthenticated.sol\":{\"content\":\"// SPDX-License-Identifier: BSL 1.1\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../interfaces/access-control/ISuAccessControl.sol\\\";\\nimport \\\"./SuAccessRoles.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\n\\n/**\\n * @title SuAuthenticated\\n * @dev other contracts should inherit to be authenticated.\\n * The address of SuAccessControlSingleton should be one for all contract that inherits SuAuthenticated\\n */\\nabstract contract SuAuthenticated is Initializable, SuAccessRoles, IERC165Upgradeable {\\n ISuAccessControl public ACCESS_CONTROL_SINGLETON;\\n\\n error OnlyDAOError();\\n error OnlyAdminError();\\n error OnlyAlerterError();\\n error OnlyVaultAccessError();\\n error OnlyLiquidationAccessError();\\n error OnlyMintAccessError();\\n error OnlyRewardAccessError();\\n error OnlyRoleError();\\n error BadAccessControlSingleton();\\n\\n /**\\n * @dev should be passed in constructor\\n */\\n function __suAuthenticatedInit(address _accessControlSingleton) internal onlyInitializing {\\n ACCESS_CONTROL_SINGLETON = ISuAccessControl(_accessControlSingleton);\\n if (\\n !ISuAccessControl(_accessControlSingleton).supportsInterface(type(IAccessControlUpgradeable).interfaceId)\\n ) revert BadAccessControlSingleton();\\n }\\n\\n /** CORE ROLES */\\n\\n modifier onlyDAO() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(DAO_ROLE, msg.sender)) revert OnlyDAOError();\\n _;\\n }\\n\\n modifier onlyAdmin() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(ADMIN_ROLE, msg.sender)) revert OnlyAdminError();\\n _;\\n }\\n\\n modifier onlyAlerter() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(ALERTER_ROLE, msg.sender)) revert OnlyAlerterError();\\n _;\\n }\\n\\n /** SYSTEM ROLES */\\n\\n modifier onlyVaultAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(VAULT_ACCESS_ROLE, msg.sender)) revert OnlyVaultAccessError();\\n _;\\n }\\n\\n modifier onlyLiquidationAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(LIQUIDATION_ACCESS_ROLE, msg.sender)) revert OnlyLiquidationAccessError();\\n _;\\n }\\n\\n modifier onlyMintAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(MINT_ACCESS_ROLE, msg.sender)) revert OnlyMintAccessError();\\n _;\\n }\\n\\n modifier onlyRewardAccess() {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(REWARD_ACCESS_ROLE, msg.sender)) revert OnlyRewardAccessError();\\n _;\\n }\\n\\n // syntax sugar under ACCESS_CONTROL_SINGLETON\\n modifier onlyRole(bytes32 role) {\\n if (!ACCESS_CONTROL_SINGLETON.hasRole(role, msg.sender)) revert OnlyRoleError();\\n _;\\n }\\n\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return ACCESS_CONTROL_SINGLETON.supportsInterface(interfaceId);\\n }\\n}\\n\",\"keccak256\":\"0x3553007ac782c0c5f2ecf3ca47b8b72d74b2cae35c34ffe2d030b968938b2b0d\",\"license\":\"BSL 1.1\"},\"contracts/periphery/contracts/interfaces/access-control/ISuAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol\\\";\\nimport \\\"../../access-control/SuAccessRoles.sol\\\";\\n\\n/**\\n * @notice Access control for contracts\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n **/\\ninterface ISuAccessControl is IAccessControlUpgradeable, IERC165Upgradeable {\\n function setRoleAdmin(bytes32 role, bytes32 adminRole) external;\\n}\\n\",\"keccak256\":\"0x25724ac502fd6418ccd38273b276de4b2fdecd023d723c5d80c9f0a27c407bcd\",\"license\":\"MIT\"},\"contracts/periphery/contracts/interfaces/oracle/ISuOracle.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSED\\n\\n// solhint-disable compiler-version\\npragma solidity >=0.7.6;\\n\\ninterface ISuOracle {\\n /**\\n * @notice WARNING! Read this description very carefully!\\n * function getFiatPrice1e18(address asset) returns (uint256) that:\\n * basicAmountOfAsset * getFiatPrice1e18(asset) / 1e18 === $$ * 1e18\\n * in other words, it doesn't matter what's the erc20.decimals is,\\n * you just multiply token balance in basic units on value from oracle and get dollar amount multiplied on 1e18.\\n *\\n * different assets have different deviation threshold (errors)\\n * for wBTC it's <= 0.5%, read more https://data.chain.link/ethereum/mainnet/crypto-usd/btc-usd\\n * for other asset is can be larger based on particular oracle implementation.\\n *\\n * examples:\\n * market price of btc = $30k,\\n * for 0.1 wBTC the unit256 amount is 0.1 * 1e18\\n * 0.1 * 1e18 * (price1e18 / 1e18) == $3000 == uint256(3000*1e18)\\n * => price1e18 = 30000 * 1e18;\\n *\\n * market price of usdt = $0.97,\\n * for 1 usdt uint256 = 1 * 1e6\\n * so 1*1e6 * price1e18 / 1e18 == $0.97 == uint256(0.97*1e18)\\n * => 1*1e6 * (price1e18 / 1e18) / (0.97*1e18) = 1\\n * => price1e18 = 0.97 * (1e18/1e6) * 1e18\\n *\\n * assume market price of wBTC = $31,503.77, oracle error = $158\\n *\\n * case #1: small amount of wBTC\\n * we have 0.0,000,001 wBTC that is worth v = $0.00315 \\u00b1 $0.00001 = 0.00315*1e18 = 315*1e13 \\u00b1 1*1e13\\n * actual balance on the asset b = wBTC.balanceOf() = 0.0000001*1e18 = 1e11\\n * oracle should return or = oracle.getFiatPrice1e18(wBTC) <=>\\n * <=> b*or = v => v/b = 315*1e13 / 1e11 = 315*1e2 \\u00b1 1e2\\n * error = or.error * b = 1e2 * 1e11 = 1e13 => 1e13/1e18 usd = 1e-5 = 0.00001 usd\\n *\\n * case #2: large amount of wBTC\\n * v = 2,000,000 wBTC = $31,503.77 * 2m \\u00b1 158*2m = $63,007,540,000 \\u00b1 $316,000,000 = 63,007*1e24 \\u00b1 316*1e24\\n * for calc convenience we increase error on 0.05 and have v = 63,000*24 \\u00b1 300*1e24 = (630 \\u00b1 3)*1e26\\n * b = 2*1e6 * 1e18 = 2*1e24\\n * or = v/b = (630 \\u00b1 3)*1e26 / 2*1e24 = 315*1e2 \\u00b1 1.5*1e2\\n * error = or.error * b = 1.5*100 * 2*1e24 = 3*1e26 = 3*1e8*1e18 = $300,000,000 ~ $316,000,000\\n *\\n * assume the market price of USDT = $0.97 \\u00b1 $0.00485,\\n *\\n * case #3: little amount of USDT\\n * v = USDT amount 0.005 = 0.005*(0.97 \\u00b1 0.00485) = 0.00485*1e18 \\u00b1 0.00002425*1e18 = 485*1e13 \\u00b1 3*1e13\\n * we rounded error up on (3000-2425)/2425 ~= +24% for calculation convenience.\\n * b = USDT.balanceOf() = 0.005*1e6 = 5*1e3\\n * b*or = v => or = v/b = (485*1e13 \\u00b1 3*1e13) / 5*1e3 = 970*1e9 \\u00b1 6*1e9\\n * error = 6*1e9 * 5*1e3 / 1e18 = 30*1e12/1e18 = 3*1e-5 = $0,00005\\n *\\n * case #4: lot of USDT\\n * v = we have 100,000,000,000 USDT = $97B = 97*1e9*1e18 \\u00b1 0.5*1e9*1e18\\n * b = USDT.balanceOf() = 1e11*1e6 = 1e17\\n * or = v/b = (97*1e9*1e18 \\u00b1 0.5*1e9*1e18) / 1e17 = 970*1e9 \\u00b1 5*1e9\\n * error = 5*1e9 * 1e17 = 5*1e26 = 0.5 * 1e8*1e18\\n *\\n * @param asset - address of erc20 token contract\\n * @return usdPrice1e18 such that asset.balanceOf() * getFiatPrice1e18(asset) / 1e18 == $$ * 1e18\\n **/\\n function getFiatPrice1e18(address asset) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa56b9cc86ef5935efecc276e6a3188d518f1a99cad960083a8de35849c997687\",\"license\":\"UNLICENSED\"},\"contracts/reward/RewardChefV2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol\\\";\\nimport \\\"@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol\\\";\\nimport \\\"../interfaces/IRewardChefV2.sol\\\";\\nimport \\\"../periphery/contracts/access-control/SuAuthenticated.sol\\\";\\nimport \\\"../periphery/contracts/interfaces/oracle/ISuOracle.sol\\\";\\n\\n/**\\n * @title RewardChefV2\\n * @dev See IRewardChefV2 interface for full details.\\n**/\\ncontract RewardChefV2 is IRewardChefV2, SuAuthenticated {\\n using SafeCastUpgradeable for uint256;\\n using SafeCastUpgradeable for uint128;\\n using SafeCastUpgradeable for uint64;\\n using SafeCastUpgradeable for int256;\\n using SafeERC20Upgradeable for IERC20Upgradeable;\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;\\n using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet;\\n\\n /**\\n * @notice Info of each MCV2 pool. SuDAO: instead of pool Ids (pid) we use address of the asset directly.\\n * Also, there aren't just LPs but regular assets as well\\n **/\\n mapping(address => PoolInfo) public poolInfo;\\n\\n /**\\n * @notice Info of each user that stakes tokens. userInfo[_asset][_user]\\n **/\\n mapping(address => mapping(address => UserInfo)) public userInfo;\\n\\n uint256 public totalAllocPoint;\\n\\n /**\\n * @notice Set of reward-able assets\\n **/\\n EnumerableSetUpgradeable.AddressSet private assetSet;\\n uint256 private constant ACC_REWARD_TOKEN_PRECISION = 1e12; // TODO*: make it 1e18? check values overflow\\n\\n // ==========================REWARDER================================\\n IERC20Upgradeable public REWARD_TOKEN;\\n ISuOracle public ORACLE;\\n uint256 public rewardPerBlock;\\n uint256 public rewardEndBlock;\\n\\n function refillReward(uint256 amount, uint64 endBlock) public onlyAdmin {\\n if (endBlock <= block.number) revert BadEndBlockForRefill();\\n updateAllPools(); // TODO: gas optimization\\n\\n REWARD_TOKEN.safeTransferFrom(msg.sender, address(this), amount);\\n uint256 rewardLeftAmount;\\n // if there are active rewards leftovers\\n if (rewardEndBlock > 0) {\\n // if we call refillReward before old endBlock ends\\n if (block.number < rewardEndBlock) {\\n rewardLeftAmount = rewardPerBlock * (rewardEndBlock - block.number);\\n } else {\\n // if we start the new reward interval that has nothing in common with the old noe\\n rewardLeftAmount = 0;\\n }\\n }\\n rewardPerBlock = (rewardLeftAmount + amount) / (endBlock - block.number);\\n rewardEndBlock = endBlock;\\n }\\n\\n function rewardsBetweenBlocks(uint256 startBlock, uint256 endBlock) public view returns (uint256) {\\n // if all rewards were allocation before our range - then answer is 0\\n if (rewardEndBlock <= startBlock) {\\n return 0;\\n } else {\\n // if rewards allocates on the whole range, than just calc rectangle area\\n if (endBlock < rewardEndBlock) {\\n return (endBlock - startBlock) * rewardPerBlock;\\n } else {\\n // other-vice, rewards end its allocation during our rage, so we have to calc only until rewardEndBlock\\n return (rewardEndBlock - startBlock) * rewardPerBlock;\\n }\\n }\\n }\\n\\n /* ==========================LOCKUP LOGIC========================================= */\\n mapping(uint256 => uint256) public multiplicator1e18ForLockupPeriod;\\n EnumerableSetUpgradeable.UintSet private possibleLockupPeriodsSeconds;\\n\\n function getPossibleLockupPeriodsSeconds() external view returns (ILockupPeriod[] memory) {\\n uint256[] memory periods = possibleLockupPeriodsSeconds.values();\\n uint256 len = periods.length;\\n ILockupPeriod[] memory lockupPeriods = new ILockupPeriod[](len);\\n for (uint256 i = 0; i < len; ++i) {\\n lockupPeriods[i] = ILockupPeriod({\\n lockupPeriodSeconds : periods[i],\\n multiplicator1e18 : multiplicator1e18ForLockupPeriod[periods[i]]\\n });\\n }\\n return lockupPeriods;\\n }\\n\\n function setPossibleLockupPeriodsSeconds(uint256 lockupPeriodSeconds, uint256 multiplicator1e18) external onlyDAO {\\n if (lockupPeriodSeconds == 0) revert ZeroLockupPeriod();\\n multiplicator1e18ForLockupPeriod[lockupPeriodSeconds] = multiplicator1e18;\\n if (multiplicator1e18 == 0) {\\n possibleLockupPeriodsSeconds.remove(lockupPeriodSeconds);\\n } else {\\n possibleLockupPeriodsSeconds.add(lockupPeriodSeconds);\\n }\\n }\\n /* =================================================================== */\\n\\n /**\\n * @notice _rewardToken The REWARD_TOKEN token contract address.\\n **/\\n function initialize(address _authControl, IERC20Upgradeable _rewardToken, ISuOracle _oracle) public initializer {\\n __suAuthenticatedInit(_authControl);\\n\\n REWARD_TOKEN = _rewardToken;\\n ORACLE = _oracle;\\n }\\n\\n function add(uint256 allocPoint, address _asset) public onlyAdmin {\\n if (poolInfo[_asset].lastRewardBlock != 0) revert PoolExist();\\n\\n totalAllocPoint = totalAllocPoint + allocPoint;\\n assetSet.add(_asset);\\n\\n poolInfo[_asset] = PoolInfo({\\n allocPoint : allocPoint.toUint64(),\\n lastRewardBlock : block.number.toUint64(),\\n accSushiPerShare : 0,\\n lpSupply : 0\\n });\\n\\n emit LogPoolAddition(_asset, allocPoint);\\n }\\n\\n function set(address _asset, uint256 _allocPoint) public onlyAdmin {\\n if (poolInfo[_asset].lastRewardBlock == 0) revert PoolNotExist();\\n // TODO: why was it in legal in MVC2 to call this function without mandatory update method?\\n updatePool(_asset);\\n\\n uint64 oldAllocPoint = poolInfo[_asset].allocPoint;\\n totalAllocPoint = totalAllocPoint - oldAllocPoint + _allocPoint;\\n poolInfo[_asset].allocPoint = _allocPoint.toUint64();\\n if (_allocPoint == 0) {\\n // we don't need to call updatePool(_asset) again\\n // because the result of the second time call in the same block doesn't change anything\\n assetSet.remove(_asset);\\n } else if (oldAllocPoint == 0) {\\n // when pool exists, but asset was removed from assetSet\\n assetSet.add(_asset);\\n }\\n emit LogSetPool(_asset, _allocPoint);\\n }\\n\\n function pendingSushi(address _asset, address _user) public view returns (uint256 pending) {\\n PoolInfo memory pool = poolInfo[_asset];\\n UserInfo memory user = userInfo[_asset][_user];\\n uint256 accSushiPerShare = pool.accSushiPerShare;\\n // we don't have real balances anymore, so instead of lpSupply = lpTokens[_pid].balanceOf(address(this));\\n // we use virtual total balance\\n uint256 lpSupply = poolInfo[_asset].lpSupply;\\n if (block.number > pool.lastRewardBlock && lpSupply != 0 && totalAllocPoint != 0) {\\n // then we need to get updated accSushiPerShare, similar as in updatePool\\n // totalSushiReward - how much reward were minted since last update pool.lastRewardBlock\\n uint256 totalSushiReward = rewardsBetweenBlocks(pool.lastRewardBlock, block.number);\\n uint256 poolSushiReward = totalSushiReward * pool.allocPoint / totalAllocPoint;\\n // account it into share value\\n accSushiPerShare = accSushiPerShare + (poolSushiReward * ACC_REWARD_TOKEN_PRECISION / lpSupply);\\n }\\n pending = (\\n (user.amount * accSushiPerShare / ACC_REWARD_TOKEN_PRECISION).toInt256() - user.rewardDebt\\n ).toUint256();\\n }\\n\\n function updatePool(address asset) public returns (PoolInfo memory pool) {\\n pool = poolInfo[asset];\\n if (block.number > pool.lastRewardBlock) {\\n uint256 lpSupply = pool.lpSupply;\\n if (lpSupply > 0 && pool.allocPoint > 0) {\\n // calc how much rewards are minted since pool.lastRewardBlock for the pool\\n uint256 totalSushiReward = rewardsBetweenBlocks(pool.lastRewardBlock, block.number);\\n uint256 poolSushiReward = totalSushiReward * pool.allocPoint / totalAllocPoint;\\n pool.accSushiPerShare = pool.accSushiPerShare +\\n (poolSushiReward * ACC_REWARD_TOKEN_PRECISION / lpSupply).toUint128();\\n }\\n pool.lastRewardBlock = block.number.toUint64();\\n poolInfo[asset] = pool;\\n emit LogUpdatePool(asset, pool.lastRewardBlock, lpSupply, pool.accSushiPerShare);\\n }\\n }\\n\\n function updateAllPools() public {\\n address[] memory assets = assetSet.values();\\n uint256 len = assets.length;\\n for (uint256 i = 0; i < len; ++i) {\\n updatePool(assets[i]);\\n }\\n }\\n\\n function increaseAmount(\\n address asset,\\n address to,\\n uint256 amountEDecimal,\\n uint256 lockupPeriodSeconds\\n ) public onlyRewardAccess {\\n PoolInfo memory pool = updatePool(asset);\\n UserInfo storage user = userInfo[asset][to];\\n\\n if (user.lockupPeriodSeconds == 0) {// it means there's no deposit yet\\n user.multiplicator1e18 = multiplicator1e18ForLockupPeriod[lockupPeriodSeconds];\\n user.lockupPeriodSeconds = lockupPeriodSeconds;\\n user.lockupStartTimestamp = block.timestamp;\\n } else if (user.lockupPeriodSeconds != lockupPeriodSeconds) revert DifferentLockup();\\n\\n if (user.multiplicator1e18 == 0) revert ZeroMultiplicator();\\n\\n // Effects\\n // user.amount = user.amount + amountEDecimal;\\n uint256 additionalAmount = amountEDecimal * user.multiplicator1e18 / 1e18;\\n user.amount = user.amount + additionalAmount;\\n user.rewardDebt = user.rewardDebt +\\n (additionalAmount * pool.accSushiPerShare / ACC_REWARD_TOKEN_PRECISION).toInt256();\\n // we don't need, since the balances are virtual\\n // lpToken[pid].safeTransferFrom(msg.sender, address(this), amount);\\n // but we need to calc total supply of virtual tokens\\n pool.lpSupply = pool.lpSupply + additionalAmount;\\n poolInfo[asset] = pool;\\n\\n emit VirtualDeposit(to, asset, additionalAmount);\\n }\\n\\n function decreaseAmount(address asset, address to, uint256 amountEDecimal) public onlyRewardAccess {\\n PoolInfo memory pool = updatePool(asset);\\n UserInfo storage user = userInfo[asset][to];\\n\\n if (user.multiplicator1e18 == 0) revert ZeroMultiplicator();\\n\\n // if we decreasing before time-lock is over => there is penalty\\n uint256 penalty = block.timestamp < user.lockupStartTimestamp + user.lockupPeriodSeconds\\n ? getDecreaseAmountRewardPenalty(asset, to, amountEDecimal)\\n : 0;\\n\\n // Effects\\n uint256 subtractAmount = amountEDecimal * user.multiplicator1e18 / 1e18;\\n user.rewardDebt = user.rewardDebt -\\n (subtractAmount * pool.accSushiPerShare / ACC_REWARD_TOKEN_PRECISION).toInt256() +\\n penalty.toInt256();\\n user.amount = user.amount - subtractAmount;\\n\\n if (user.amount == 0 && user.rewardDebt == 0) {\\n // Reset lockupPeriod\\n user.lockupStartTimestamp = block.timestamp;\\n user.lockupPeriodSeconds = 0;\\n user.multiplicator1e18 = 0;\\n }\\n\\n pool.lpSupply = pool.lpSupply - subtractAmount;\\n poolInfo[asset] = pool;\\n\\n emit VirtualWithdraw(to, asset, subtractAmount);\\n }\\n\\n function getDecreaseAmountRewardPenalty(\\n address asset, address to, uint256 amountEDecimal\\n ) public view returns (uint256) {\\n UserInfo memory user = userInfo[asset][to];\\n\\n if (user.multiplicator1e18 == 0) {\\n return 0;\\n }\\n\\n uint256 subtractAmount = amountEDecimal * user.multiplicator1e18 / 1e18;\\n\\n uint256 pending = pendingSushi(asset, to);\\n return pending * subtractAmount / user.amount;\\n }\\n\\n function harvest(address asset, address to, uint256 newLockupPeriodSeconds) public {\\n PoolInfo memory pool = updatePool(asset);\\n UserInfo storage user = userInfo[asset][msg.sender];\\n\\n if (user.lockupStartTimestamp + user.lockupPeriodSeconds > block.timestamp) revert HarvestBeforeLockup();\\n if (user.multiplicator1e18 == 0) revert ZeroMultiplicator();\\n\\n int256 accumulatedSushi = (user.amount * pool.accSushiPerShare / ACC_REWARD_TOKEN_PRECISION).toInt256();\\n uint256 _pendingSushi = (accumulatedSushi - user.rewardDebt).toUint256();\\n\\n // Effects\\n user.rewardDebt = accumulatedSushi;\\n // accumulatedSushi = user.rewardDebt + _pendingSushi;\\n\\n // Interactions\\n if (_pendingSushi > 0) {\\n REWARD_TOKEN.safeTransfer(to, _pendingSushi);\\n }\\n\\n // Reset lockupPeriod\\n user.lockupStartTimestamp = block.timestamp;\\n // it's possible to remove code duplicates by using signed amount, but for simplicity I'll leave as it is\\n uint256 newMultiplicator1e18 = multiplicator1e18ForLockupPeriod[newLockupPeriodSeconds];\\n if (newMultiplicator1e18 == 0) revert ZeroMultiplicator();\\n if (user.multiplicator1e18 < newMultiplicator1e18) {\\n // since multiplicator increases, we need to increase amount\\n uint256 additionalAmount = user.amount * newMultiplicator1e18 / user.multiplicator1e18 - user.amount;\\n\\n user.amount = user.amount + additionalAmount;\\n user.rewardDebt = user.rewardDebt +\\n (additionalAmount * pool.accSushiPerShare / ACC_REWARD_TOKEN_PRECISION).toInt256();\\n } else if (user.multiplicator1e18 > newMultiplicator1e18) {\\n uint256 subtractAmount = user.amount - user.amount * newMultiplicator1e18 / user.multiplicator1e18;\\n\\n user.rewardDebt = user.rewardDebt -\\n (subtractAmount * pool.accSushiPerShare / ACC_REWARD_TOKEN_PRECISION).toInt256();\\n user.amount = user.amount - subtractAmount;\\n }\\n user.multiplicator1e18 = newMultiplicator1e18;\\n\\n emit Harvest(msg.sender, asset, _pendingSushi);\\n }\\n\\n function resetAmount(address asset, address to) public {\\n PoolInfo storage pool = poolInfo[asset];\\n UserInfo storage user = userInfo[asset][msg.sender];\\n\\n uint256 userAmount = user.amount;\\n uint256 userLockupPeriodSeconds = user.lockupPeriodSeconds;\\n\\n pool.lpSupply = pool.lpSupply - userAmount;\\n poolInfo[asset] = pool;\\n user.amount = 0;\\n user.rewardDebt = 0;\\n\\n // Reset lockupPeriod\\n user.lockupStartTimestamp = block.timestamp;\\n user.lockupPeriodSeconds = 0;\\n user.multiplicator1e18 = 0;\\n\\n emit ResetAmount(msg.sender, asset, to, userAmount, userLockupPeriodSeconds);\\n }\\n\\n /* ================================VIEW METHODS====================================== */\\n\\n function getPoolApr(address asset) public view returns (uint256) {\\n // We use require to directly show this messages in frontend\\n /* solhint-disable custom-errors */\\n require(poolInfo[asset].lpSupply != 0, \\\"RewardChef: Pool doesn't have liquidity\\\");\\n require(totalAllocPoint != 0, \\\"RewardChef: Total allocation point is 0\\\");\\n require(rewardEndBlock > block.number, \\\"RewardChef: Vesting is already finished\\\");\\n /* solhint-enable custom-errors */\\n\\n uint256 rewardPerBlockForPool = rewardPerBlock * poolInfo[asset].allocPoint / totalAllocPoint;\\n uint256 rewardTokenPrice = ORACLE.getFiatPrice1e18(address(REWARD_TOKEN));\\n uint256 usdRewardYearForPool = rewardPerBlockForPool * 4 * 60 * 24 * 366 * rewardTokenPrice;\\n // TODO: fix decimals and unify oracle answer\\n uint256 decimals = IERC20Metadata(asset).decimals();\\n uint256 usdValuePool = ORACLE.getFiatPrice1e18(asset) * poolInfo[asset].lpSupply / 10 ** decimals;\\n return usdRewardYearForPool / usdValuePool;\\n }\\n\\n function getHarvestLockupEndTimestamp(address _asset, address _user) public view returns (uint256) {\\n UserInfo memory user = userInfo[_asset][_user];\\n\\n return user.lockupStartTimestamp + user.lockupPeriodSeconds;\\n }\\n}\\n\",\"keccak256\":\"0xd3b5cf0d38d169f59c382e16c844fd1ca98a49bcf613cd80bbbd3e1ea5e29ea4\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x6080806040523461001657611560908161001c8239f35b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826301ffc9a71461105f5750816303ee9f22146110335781630ee21e541461100d57816311be0de514610efd57816314c376dc14610ec257816324c1173b14610e785781633e18638f14610da2578163438280dd14610d67578163485cc95514610b0c5781635a5fdfe5146109c957816371d0fb411461098e5781637217c39c1461094757816375b238fc1461092c57816375c038b7146107fd5781638e5313e0146107c2578163b0113e6b1461078a578163bb55b7fc1461053c578163bce092c414610518578163dc97e84e146104dd578163e5011ac6146103bc578163e9c2651814610393578163f0d2d5a8146101c657508063f45a432014610199578063f8aa43f7146101635763fbfa77cf1461013857600080fd5b3461015f578160031936011261015f5760055490516001600160a01b039091168152602090f35b5080fd5b503461015f578060031936011261015f576020906101906101826110f4565b61018a61110f565b90611219565b90519015158152f35b503461015f578060031936011261015f576020906101906101b86110f4565b6101c061110f565b906112a0565b83833461015f5760208060031936011261038f576101e26110f4565b83548351632474521560e21b81526000805160206114eb833981519152878201523360248201529192916001600160a01b039183908290604490829060101c86165afa908115610385578691610358575b50156103485782169283156103395761024b8361147b565b8015610322575b6103135760019060025490805191610269836111c5565b8252828483019488865287895252862090518155019051151560ff80198354169116179055600254600160401b81101561030057906102b18260016102d99401600255611125565b9080546001600160a01b0360039390931b83811b80199092169390941690931b909216179055565b7f7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f8280a280f35b634e487b7160e01b845260418552602484fd5b516333e9449d60e21b81528590fd5b508385526001825260ff6001828720015416610252565b5163d92e233d60e01b81528590fd5b835163599a6c3360e11b81528690fd5b6103789150833d851161037e575b61037081836111f6565b810190611463565b87610233565b503d610366565b85513d88823e3d90fd5b8280fd5b50503461015f578160031936011261015f57602090516000805160206114eb8339815191528152f35b8284346104da576020918260031936011261015f576103d96110f4565b906002546103e681611347565b9084855b61ffff838183161015610481579061042d9161040582611125565b916104208a60018060a01b03809454600396871b1c166112a0565b610432575b5050506113a8565b6103ea565b816104789361044086611125565b9054911b1c1691895192610453846111c5565b83528a168c830152610464866113a8565b95169061047182896113d1565b52866113d1565b50898080610425565b61ffff8084169089878961049485611347565b925b848116868110156104c957906104be826104b36104c494876113d1565b5161047182896113d1565b506113a8565b610496565b8251806104d6878261116e565b0390f35b80fd5b50503461015f578160031936011261015f57602090517f9a9aef7c1247d5fc769b0185c052913e39673da29a880317dfd20ebf86f26a498152f35b50503461015f578160031936011261015f576020906105356113f4565b9051908152f35b90503461038f578160031936011261038f576105566110f4565b9061055f61110f565b6001600160a01b03938385169391929184158015610780575b610772576105908461058a81846112a0565b92611219565b808061076a575b156106235750508386526003602081815282882054848252838920978616808a5297825283892055858852528520805491600160401b8310156106105750816102b19160016105e99594018155611156565b7f938c63ac3d228b23f6bee7618fefc6790522e338ac202c958a2ea9eb9706c5d18380a380f35b634e487b7160e01b875260419052602486fd5b9395919381610761575b5061063b575b505050505080f35b83865260209282845281818820961695868852845280872054908588528385528088208789528552878181205585885260039485815281892054926000199384810190811161074e57908a848a88858c97968603610701575b5050925050525287209283549081156106ee575001926106b48484611156565b81939154921b1b19169055557f40e634d0e26d9ec2e860e4dd9b7b2cfbb569b6058362a1a54d3a94718bc495878380a33880808080610633565b634e487b7160e01b895260319052602488fd5b610731936102b19261071c88938689528b8b52838920611156565b9054908b1b1c16958694815289895220611156565b898c52878352848c20908c528252838b2055388a848a8884610694565b634e487b7160e01b8b526011875260248bfd5b9050153861062d565b508115610597565b505163d92e233d60e01b8152fd5b5085841615610578565b50503461015f57602036600319011261015f5760209181906001600160a01b036107b26110f4565b1681526003845220549051908152f35b50503461015f578160031936011261015f57602090517fe453bacb314e78dcd5192e6b1a2b1f0e7c76e92f6b7e429a6a90f04e39db3b768152f35b9190503461038f576020806003193601126109285761081a6110f4565b84548351632474521560e21b81526000805160206114eb833981519152818701523360248201529194916001600160a01b039184908290604490829060101c86165afa90811561091e578791610901575b50156108f2578416938486526001835260ff60018588200154166108e4576108929061147b565b156108d65750906001809284865252832001600160ff198254161790557f192895f9a14975ce177e9612fd4f4459e31169d79cb650596bcce0622bd70a928280a280f35b825163ad5679e160e01b8152fd5b508251625ecddb60e01b8152fd5b50825163599a6c3360e11b8152fd5b6109189150843d861161037e5761037081836111f6565b3861086b565b85513d89823e3d90fd5b8380fd5b50503461015f578160031936011261015f5751908152602090f35b50503461015f57602036600319011261015f579081906001600160a01b0361096d6110f4565b16815260016020522060ff6001825492015416825191825215156020820152f35b50503461015f578160031936011261015f57602090517f880a91047114272656e533301261260c75e4d11543ac7303d6fe4204579ec7278152f35b50503461015f578160031936011261015f57906109e46113f4565b916109ef8293611347565b9180936002545b8061ffff871610610a0e578351806104d6878261116e565b94939192610a1b85611125565b949060018060a01b03809154600397881b1c1682526020918683528381209484519586858254918281520191845285842084915b808310610af35750505086610a659103876111f6565b81905b8651821015610ad757899a91610ac8610ace92868c610a8a610aa79e9f611125565b9054911b1c1687610a9b858d6113d1565b5116908a519d8e6111c5565b8d52888d0152610ab6816113e5565b9b610ac1828d6113d1565b528a6113d1565b506113e5565b90999897610a68565b9698935050935050610aea9194506113a8565b949190916109f6565b8154871684529287019260019283019290910190610a4f565b90503461038f578160031936011261038f57610b266110f4565b91610b2f61110f565b9184549060ff8260081c161591828093610d5a575b8015610d43575b15610ce95760ff198116600117875582610cd8575b506001600160a01b039384168015610cc95760018060a01b0319600554161760055585549360ff8560081c1615610c725762010000600160b01b03601087901b1662010000600160b01b031986168117885584516301ffc9a760e01b8152637965db0b60e01b848201529096909160209183916024918391165afa908115610c68578791610c4a575b5015610c3c5750610bf8578380f35b610100600160b01b0319909116909117825551600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a13880808380f35b82516384d942fd60e01b8152fd5b610c62915060203d811161037e5761037081836111f6565b38610be9565b84513d89823e3d90fd5b835162461bcd60e51b8152602081840152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b50825163d92e233d60e01b8152fd5b61ffff191661010117865538610b60565b835162461bcd60e51b8152602081840152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b158015610b4b5750600160ff821614610b4b565b50600160ff821610610b44565b50503461015f578160031936011261015f57602090517f39f61ca2a1a28fee144218173ec637b649a353e4026b2738c673800e5bf1437b8152f35b8284346104da5760208060031936011261015f576001600160a01b039182610dc86110f4565b1680825260038352848220928551808583829754938481520190865283862092865b85828210610e6057505050610e01925003856111f6565b610e0b8451611347565b925b845161ffff821690811015610e5357906104be8288610e2f610e4e958a6113d1565b51168a5190610e3d826111c5565b8782528682015261047182896113d1565b610e0d565b8751806104d6878261116e565b85548b1684526001958601958a955093019201610dea565b90503461038f57602036600319011261038f573560025481101561038f57600290925260008051602061150b8339815191529091015490516001600160a01b039091168152602090f35b50503461015f578160031936011261015f57602090517fe965846df3dd5b1dfa65f58e31477079e90140e0908b6dd31b5aead5a57cf3658152f35b9190503461038f5760208060031936011261092857610f1a6110f4565b84548351632474521560e21b81526000805160206114eb833981519152818701523360248201529194916001600160a01b039184908290604490829060101c86165afa90811561091e578791610ff0575b50156108f2578416938486526001835260ff600185882001541615610fc757505090600180928486525283200160ff1981541690557f689fa3f4fd14b3753d33c934f2648d75824d79933d875ed4ae8feb3e8622aea08280a280f35b610fd1849161147b565b15610fe35751637952fbad60e11b8152fd5b5163ad5679e160e01b8152fd5b6110079150843d861161037e5761037081836111f6565b38610f6b565b50503461015f57602036600319011261015f5760209061019061102e6110f4565b61147b565b50503461015f578160031936011261015f579054905160109190911c6001600160a01b03168152602090f35b9291503461092857602036600319011261092857803563ffffffff60e01b81168091036110f05784546301ffc9a760e01b8552918401526020908390602490829060101c6001600160a01b03165afa9182156110e657602093926110c7575b50519015158152f35b6110df919250833d811161037e5761037081836111f6565b90386110be565b81513d85823e3d90fd5b8480fd5b600435906001600160a01b038216820361110a57565b600080fd5b602435906001600160a01b038216820361110a57565b60025481101561114057600260005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b80548210156111405760005260206000200190600090565b60208082019080835283518092528060408094019401926000905b83821061119857505050505090565b845180516001600160a01b0390811688529084015116868401529485019493820193600190910190611189565b604081019081106001600160401b038211176111e057604052565b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b038211908210176111e057604052565b60055460405163f084843d60e01b81526001600160a01b039283166004820152928216602484015260209183916044918391165afa90811561129457600091611263575b50151590565b906020823d821161128c575b8161127c602093836111f6565b810103126104da5750513861125d565b3d915061126f565b6040513d6000823e3d90fd5b6001600160a01b0390811660008181526003602052604081205491939291156113295760046020528160408220931692838252602052604081205415938415946112ec575b5050505090565b9080929394505260036020526040812080541561131557815260209020541614388080806112e5565b634e487b7160e01b82526032600452602482fd5b9250505090565b6001600160401b0381116111e05760051b60200190565b9061135182611330565b604090611360825191826111f6565b8381528093611371601f1991611330565b0191600090815b848110611386575050505050565b6020908251611394816111c5565b848152828581830152828701015201611378565b61ffff8091169081146113bb5760010190565b634e487b7160e01b600052601160045260246000fd5b80518210156111405760209160051b010190565b60001981146113bb5760010190565b6000906000806002545b8061ffff84161061140e57505050565b90919361141a85611125565b9054600391821b1c6001600160a01b031684526020526040832054810190811061144f5761144890946113a8565b91906113fe565b634e487b7160e01b83526011600452602483fd5b9081602091031261110a5751801515810361110a5790565b600254156114e4576001600160a01b039081166000818152600160208190526040909120015460ff16159190826114b157505090565b90915060406000205415918215926114c857505090565b600260005260008051602061150b833981519152541614905090565b5060009056fe3b5d4cc60d3ec3516ee8ae083bd60934f6eb2a6c54b1229985c41bfb092b2603405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acea264697066735822122092ddf06dde0710c2083acf9d505484214142fdb4f66142853d1055371636f33f64736f6c63430008110033",
"deployedBytecode": "0x608060408181526004918236101561001657600080fd5b600092833560e01c91826301ffc9a71461105f5750816303ee9f22146110335781630ee21e541461100d57816311be0de514610efd57816314c376dc14610ec257816324c1173b14610e785781633e18638f14610da2578163438280dd14610d67578163485cc95514610b0c5781635a5fdfe5146109c957816371d0fb411461098e5781637217c39c1461094757816375b238fc1461092c57816375c038b7146107fd5781638e5313e0146107c2578163b0113e6b1461078a578163bb55b7fc1461053c578163bce092c414610518578163dc97e84e146104dd578163e5011ac6146103bc578163e9c2651814610393578163f0d2d5a8146101c657508063f45a432014610199578063f8aa43f7146101635763fbfa77cf1461013857600080fd5b3461015f578160031936011261015f5760055490516001600160a01b039091168152602090f35b5080fd5b503461015f578060031936011261015f576020906101906101826110f4565b61018a61110f565b90611219565b90519015158152f35b503461015f578060031936011261015f576020906101906101b86110f4565b6101c061110f565b906112a0565b83833461015f5760208060031936011261038f576101e26110f4565b83548351632474521560e21b81526000805160206114eb833981519152878201523360248201529192916001600160a01b039183908290604490829060101c86165afa908115610385578691610358575b50156103485782169283156103395761024b8361147b565b8015610322575b6103135760019060025490805191610269836111c5565b8252828483019488865287895252862090518155019051151560ff80198354169116179055600254600160401b81101561030057906102b18260016102d99401600255611125565b9080546001600160a01b0360039390931b83811b80199092169390941690931b909216179055565b7f7db05e63d635a68c62fd7fd8f3107ae8ab584a383e102d1bd8a40f4c977e465f8280a280f35b634e487b7160e01b845260418552602484fd5b516333e9449d60e21b81528590fd5b508385526001825260ff6001828720015416610252565b5163d92e233d60e01b81528590fd5b835163599a6c3360e11b81528690fd5b6103789150833d851161037e575b61037081836111f6565b810190611463565b87610233565b503d610366565b85513d88823e3d90fd5b8280fd5b50503461015f578160031936011261015f57602090516000805160206114eb8339815191528152f35b8284346104da576020918260031936011261015f576103d96110f4565b906002546103e681611347565b9084855b61ffff838183161015610481579061042d9161040582611125565b916104208a60018060a01b03809454600396871b1c166112a0565b610432575b5050506113a8565b6103ea565b816104789361044086611125565b9054911b1c1691895192610453846111c5565b83528a168c830152610464866113a8565b95169061047182896113d1565b52866113d1565b50898080610425565b61ffff8084169089878961049485611347565b925b848116868110156104c957906104be826104b36104c494876113d1565b5161047182896113d1565b506113a8565b610496565b8251806104d6878261116e565b0390f35b80fd5b50503461015f578160031936011261015f57602090517f9a9aef7c1247d5fc769b0185c052913e39673da29a880317dfd20ebf86f26a498152f35b50503461015f578160031936011261015f576020906105356113f4565b9051908152f35b90503461038f578160031936011261038f576105566110f4565b9061055f61110f565b6001600160a01b03938385169391929184158015610780575b610772576105908461058a81846112a0565b92611219565b808061076a575b156106235750508386526003602081815282882054848252838920978616808a5297825283892055858852528520805491600160401b8310156106105750816102b19160016105e99594018155611156565b7f938c63ac3d228b23f6bee7618fefc6790522e338ac202c958a2ea9eb9706c5d18380a380f35b634e487b7160e01b875260419052602486fd5b9395919381610761575b5061063b575b505050505080f35b83865260209282845281818820961695868852845280872054908588528385528088208789528552878181205585885260039485815281892054926000199384810190811161074e57908a848a88858c97968603610701575b5050925050525287209283549081156106ee575001926106b48484611156565b81939154921b1b19169055557f40e634d0e26d9ec2e860e4dd9b7b2cfbb569b6058362a1a54d3a94718bc495878380a33880808080610633565b634e487b7160e01b895260319052602488fd5b610731936102b19261071c88938689528b8b52838920611156565b9054908b1b1c16958694815289895220611156565b898c52878352848c20908c528252838b2055388a848a8884610694565b634e487b7160e01b8b526011875260248bfd5b9050153861062d565b508115610597565b505163d92e233d60e01b8152fd5b5085841615610578565b50503461015f57602036600319011261015f5760209181906001600160a01b036107b26110f4565b1681526003845220549051908152f35b50503461015f578160031936011261015f57602090517fe453bacb314e78dcd5192e6b1a2b1f0e7c76e92f6b7e429a6a90f04e39db3b768152f35b9190503461038f576020806003193601126109285761081a6110f4565b84548351632474521560e21b81526000805160206114eb833981519152818701523360248201529194916001600160a01b039184908290604490829060101c86165afa90811561091e578791610901575b50156108f2578416938486526001835260ff60018588200154166108e4576108929061147b565b156108d65750906001809284865252832001600160ff198254161790557f192895f9a14975ce177e9612fd4f4459e31169d79cb650596bcce0622bd70a928280a280f35b825163ad5679e160e01b8152fd5b508251625ecddb60e01b8152fd5b50825163599a6c3360e11b8152fd5b6109189150843d861161037e5761037081836111f6565b3861086b565b85513d89823e3d90fd5b8380fd5b50503461015f578160031936011261015f5751908152602090f35b50503461015f57602036600319011261015f579081906001600160a01b0361096d6110f4565b16815260016020522060ff6001825492015416825191825215156020820152f35b50503461015f578160031936011261015f57602090517f880a91047114272656e533301261260c75e4d11543ac7303d6fe4204579ec7278152f35b50503461015f578160031936011261015f57906109e46113f4565b916109ef8293611347565b9180936002545b8061ffff871610610a0e578351806104d6878261116e565b94939192610a1b85611125565b949060018060a01b03809154600397881b1c1682526020918683528381209484519586858254918281520191845285842084915b808310610af35750505086610a659103876111f6565b81905b8651821015610ad757899a91610ac8610ace92868c610a8a610aa79e9f611125565b9054911b1c1687610a9b858d6113d1565b5116908a519d8e6111c5565b8d52888d0152610ab6816113e5565b9b610ac1828d6113d1565b528a6113d1565b506113e5565b90999897610a68565b9698935050935050610aea9194506113a8565b949190916109f6565b8154871684529287019260019283019290910190610a4f565b90503461038f578160031936011261038f57610b266110f4565b91610b2f61110f565b9184549060ff8260081c161591828093610d5a575b8015610d43575b15610ce95760ff198116600117875582610cd8575b506001600160a01b039384168015610cc95760018060a01b0319600554161760055585549360ff8560081c1615610c725762010000600160b01b03601087901b1662010000600160b01b031986168117885584516301ffc9a760e01b8152637965db0b60e01b848201529096909160209183916024918391165afa908115610c68578791610c4a575b5015610c3c5750610bf8578380f35b610100600160b01b0319909116909117825551600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249890602090a13880808380f35b82516384d942fd60e01b8152fd5b610c62915060203d811161037e5761037081836111f6565b38610be9565b84513d89823e3d90fd5b835162461bcd60e51b8152602081840152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608490fd5b50825163d92e233d60e01b8152fd5b61ffff191661010117865538610b60565b835162461bcd60e51b8152602081840152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608490fd5b50303b158015610b4b5750600160ff821614610b4b565b50600160ff821610610b44565b50503461015f578160031936011261015f57602090517f39f61ca2a1a28fee144218173ec637b649a353e4026b2738c673800e5bf1437b8152f35b8284346104da5760208060031936011261015f576001600160a01b039182610dc86110f4565b1680825260038352848220928551808583829754938481520190865283862092865b85828210610e6057505050610e01925003856111f6565b610e0b8451611347565b925b845161ffff821690811015610e5357906104be8288610e2f610e4e958a6113d1565b51168a5190610e3d826111c5565b8782528682015261047182896113d1565b610e0d565b8751806104d6878261116e565b85548b1684526001958601958a955093019201610dea565b90503461038f57602036600319011261038f573560025481101561038f57600290925260008051602061150b8339815191529091015490516001600160a01b039091168152602090f35b50503461015f578160031936011261015f57602090517fe965846df3dd5b1dfa65f58e31477079e90140e0908b6dd31b5aead5a57cf3658152f35b9190503461038f5760208060031936011261092857610f1a6110f4565b84548351632474521560e21b81526000805160206114eb833981519152818701523360248201529194916001600160a01b039184908290604490829060101c86165afa90811561091e578791610ff0575b50156108f2578416938486526001835260ff600185882001541615610fc757505090600180928486525283200160ff1981541690557f689fa3f4fd14b3753d33c934f2648d75824d79933d875ed4ae8feb3e8622aea08280a280f35b610fd1849161147b565b15610fe35751637952fbad60e11b8152fd5b5163ad5679e160e01b8152fd5b6110079150843d861161037e5761037081836111f6565b38610f6b565b50503461015f57602036600319011261015f5760209061019061102e6110f4565b61147b565b50503461015f578160031936011261015f579054905160109190911c6001600160a01b03168152602090f35b9291503461092857602036600319011261092857803563ffffffff60e01b81168091036110f05784546301ffc9a760e01b8552918401526020908390602490829060101c6001600160a01b03165afa9182156110e657602093926110c7575b50519015158152f35b6110df919250833d811161037e5761037081836111f6565b90386110be565b81513d85823e3d90fd5b8480fd5b600435906001600160a01b038216820361110a57565b600080fd5b602435906001600160a01b038216820361110a57565b60025481101561114057600260005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b80548210156111405760005260206000200190600090565b60208082019080835283518092528060408094019401926000905b83821061119857505050505090565b845180516001600160a01b0390811688529084015116868401529485019493820193600190910190611189565b604081019081106001600160401b038211176111e057604052565b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b038211908210176111e057604052565b60055460405163f084843d60e01b81526001600160a01b039283166004820152928216602484015260209183916044918391165afa90811561129457600091611263575b50151590565b906020823d821161128c575b8161127c602093836111f6565b810103126104da5750513861125d565b3d915061126f565b6040513d6000823e3d90fd5b6001600160a01b0390811660008181526003602052604081205491939291156113295760046020528160408220931692838252602052604081205415938415946112ec575b5050505090565b9080929394505260036020526040812080541561131557815260209020541614388080806112e5565b634e487b7160e01b82526032600452602482fd5b9250505090565b6001600160401b0381116111e05760051b60200190565b9061135182611330565b604090611360825191826111f6565b8381528093611371601f1991611330565b0191600090815b848110611386575050505050565b6020908251611394816111c5565b848152828581830152828701015201611378565b61ffff8091169081146113bb5760010190565b634e487b7160e01b600052601160045260246000fd5b80518210156111405760209160051b010190565b60001981146113bb5760010190565b6000906000806002545b8061ffff84161061140e57505050565b90919361141a85611125565b9054600391821b1c6001600160a01b031684526020526040832054810190811061144f5761144890946113a8565b91906113fe565b634e487b7160e01b83526011600452602483fd5b9081602091031261110a5751801515810361110a5790565b600254156114e4576001600160a01b039081166000818152600160208190526040909120015460ff16159190826114b157505090565b90915060406000205415918215926114c857505090565b600260005260008051602061150b833981519152541614905090565b5060009056fe3b5d4cc60d3ec3516ee8ae083bd60934f6eb2a6c54b1229985c41bfb092b2603405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acea264697066735822122092ddf06dde0710c2083acf9d505484214142fdb4f66142853d1055371636f33f64736f6c63430008110033",
"devdoc": {
"details": "See ISuCdpRegistry interface for full details.",
"kind": "dev",
"methods": {
"addCollateral(address)": {
"details": "After deployment collaterals should be added in our protocol*"
},
"supportsInterface(bytes4)": {
"details": "Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas."
}
},
"title": "SuCdpRegistry",
"version": 1
},
"userdoc": {
"events": {
"Added(address,address)": {
"notice": "event emitted when a new CDP is created"
},
"Removed(address,address)": {
"notice": "event emitted when a CDP is closed"
}
},
"kind": "user",
"methods": {
"addCollateral(address)": {
"notice": "Add asset as collateral for our protocol"
},
"checkpoint(address,address)": {
"notice": "method to add or remove owner from cdpList[asset]"
},
"disableCollateral(address)": {
"notice": "Disable collateral in our protocol. Not removed, because it can add problems with users with removed collateral*"
},
"enableCollateral(address)": {
"notice": "Enable recently added collateral in our protocol. Not removed, because it can add problems with users with removed collateral*"
},
"getAllCdps()": {
"notice": "read-only function to get the list of all cdps"
},
"getCdpsByCollateral(address)": {
"notice": "read-only function to get the list of cdps for a given collateral"
},
"getCdpsByOwner(address)": {
"notice": "read-only function to get the list of all cdps by borrower"
},
"getCdpsCount()": {
"notice": "total number of cdps"
},
"getCdpsCountForCollateral(address)": {
"notice": "number of cdps for a given collateral"
},
"isAlive(address,address)": {
"notice": "alive means there are debts in the vault for this collateral of this borrower"
},
"isCollateral(address)": {
"notice": "Check whether asset is collateral*"
},
"isListed(address,address)": {
"notice": "listed means there are created cdps in this contract for this collateral of this borrower"
}
},
"notice": "Here we store protocol collaterals and use it in GraphQL",
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 671,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8"
},
{
"astId": 674,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool"
},
{
"astId": 28586,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "ACCESS_CONTROL_SINGLETON",
"offset": 2,
"slot": "0",
"type": "t_contract(ISuAccessControl)32175"
},
{
"astId": 24584,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "collateralInfo",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_struct(CollateralRegistryInfo)23248_storage)"
},
{
"astId": 24587,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "collaterals",
"offset": 0,
"slot": "2",
"type": "t_array(t_address)dyn_storage"
},
{
"astId": 24049,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "cdpList",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_address,t_array(t_address)dyn_storage)"
},
{
"astId": 24055,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "cdpIndex",
"offset": 0,
"slot": "4",
"type": "t_mapping(t_address,t_mapping(t_address,t_uint256))"
},
{
"astId": 24058,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "vault",
"offset": 0,
"slot": "5",
"type": "t_contract(ISuVault)23976"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_address)dyn_storage": {
"base": "t_address",
"encoding": "dynamic_array",
"label": "address[]",
"numberOfBytes": "32"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(ISuAccessControl)32175": {
"encoding": "inplace",
"label": "contract ISuAccessControl",
"numberOfBytes": "20"
},
"t_contract(ISuVault)23976": {
"encoding": "inplace",
"label": "contract ISuVault",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_array(t_address)dyn_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => address[])",
"numberOfBytes": "32",
"value": "t_array(t_address)dyn_storage"
},
"t_mapping(t_address,t_mapping(t_address,t_uint256))": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => mapping(address => uint256))",
"numberOfBytes": "32",
"value": "t_mapping(t_address,t_uint256)"
},
"t_mapping(t_address,t_struct(CollateralRegistryInfo)23248_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => struct CollateralRegistryInfo)",
"numberOfBytes": "32",
"value": "t_struct(CollateralRegistryInfo)23248_storage"
},
"t_mapping(t_address,t_uint256)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => uint256)",
"numberOfBytes": "32",
"value": "t_uint256"
},
"t_struct(CollateralRegistryInfo)23248_storage": {
"encoding": "inplace",
"label": "struct CollateralRegistryInfo",
"members": [
{
"astId": 23245,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "index",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 23247,
"contract": "contracts/lending/SuCdpRegistry.sol:SuCdpRegistry",
"label": "isDisabled",
"offset": 0,
"slot": "1",
"type": "t_bool"
}
],
"numberOfBytes": "64"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"encoding": "inplace",
"label": "uint8",
"numberOfBytes": "1"
}
}
}
}