/
OracleFactoryImpl.json
877 lines (877 loc) · 329 KB
/
OracleFactoryImpl.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
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
{
"address": "0x19A4010E859ca3d10F0d928C6665F9a9E3BE4B22",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "FactoryNotInstanceError",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "version",
"type": "uint256"
}
],
"name": "InitializableAlreadyInitializedError",
"type": "error"
},
{
"inputs": [],
"name": "InitializableNotInitializingError",
"type": "error"
},
{
"inputs": [],
"name": "InitializableZeroVersionError",
"type": "error"
},
{
"inputs": [],
"name": "OracleFactoryAlreadyCreatedError",
"type": "error"
},
{
"inputs": [],
"name": "OracleFactoryClaimTooLargeError",
"type": "error"
},
{
"inputs": [],
"name": "OracleFactoryInvalidIdError",
"type": "error"
},
{
"inputs": [],
"name": "OracleFactoryNotCreatedError",
"type": "error"
},
{
"inputs": [],
"name": "OracleFactoryNotRegisteredError",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "OwnableNotOwnerError",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "OwnableNotPendingOwnerError",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "sender",
"type": "address"
}
],
"name": "PausableNotPauserError",
"type": "error"
},
{
"inputs": [],
"name": "PausablePausedError",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "contract IFactory",
"name": "caller",
"type": "address"
}
],
"name": "CallerAuthorized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "contract IOracleProviderFactory",
"name": "factory",
"type": "address"
}
],
"name": "FactoryRegistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "version",
"type": "uint256"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IInstance",
"name": "instance",
"type": "address"
}
],
"name": "InstanceRegistered",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "UFixed6",
"name": "newMaxClaim",
"type": "uint256"
}
],
"name": "MaxClaimUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "contract IOracleProvider",
"name": "oracle",
"type": "address"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
}
],
"name": "OracleCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnerUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Paused",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "newPauser",
"type": "address"
}
],
"name": "PauserUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "newPendingOwner",
"type": "address"
}
],
"name": "PendingOwnerUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Unpaused",
"type": "event"
},
{
"inputs": [],
"name": "acceptOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IFactory",
"name": "caller",
"type": "address"
}
],
"name": "authorize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "caller",
"type": "address"
}
],
"name": "authorized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IFactory",
"name": "",
"type": "address"
}
],
"name": "callers",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed6",
"name": "amount",
"type": "uint256"
}
],
"name": "claim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
},
{
"internalType": "contract IOracleProviderFactory",
"name": "factory",
"type": "address"
}
],
"name": "create",
"outputs": [
{
"internalType": "contract IOracle",
"name": "newOracle",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IOracleProviderFactory",
"name": "",
"type": "address"
}
],
"name": "factories",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IMarket",
"name": "market",
"type": "address"
}
],
"name": "fund",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "incentive",
"outputs": [
{
"internalType": "Token18",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "Token18",
"name": "incentive_",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IInstance",
"name": "instance",
"type": "address"
}
],
"name": "instances",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxClaim",
"outputs": [
{
"internalType": "UFixed6",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"name": "oracles",
"outputs": [
{
"internalType": "contract IOracleProvider",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pauser",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pendingOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IOracleProviderFactory",
"name": "factory",
"type": "address"
}
],
"name": "register",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unpause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "id",
"type": "bytes32"
},
{
"internalType": "contract IOracleProviderFactory",
"name": "factory",
"type": "address"
}
],
"name": "update",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed6",
"name": "newMaxClaim",
"type": "uint256"
}
],
"name": "updateMaxClaim",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newPauser",
"type": "address"
}
],
"name": "updatePauser",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newPendingOwner",
"type": "address"
}
],
"name": "updatePendingOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x9052c1c05a8f1e4f1a6cefe93e30c39d909ac7a3c9f26653549c1ba38db4320c",
"receipt": {
"to": null,
"from": "0x66a7fDB96C583c59597de16d8b2B989231415339",
"contractAddress": "0x19A4010E859ca3d10F0d928C6665F9a9E3BE4B22",
"transactionIndex": 5,
"gasUsed": "6349621",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x18131ad6c9de0bd42c8e5aae7297f5a3cb16b5066be44e7148324e95cdb59280",
"transactionHash": "0x9052c1c05a8f1e4f1a6cefe93e30c39d909ac7a3c9f26653549c1ba38db4320c",
"logs": [],
"blockNumber": 135921366,
"cumulativeGasUsed": "8158717",
"status": 1,
"byzantium": true
},
"args": ["0x0a47bb5E5260619204a578Bd477204FcE6246BB7"],
"numDeployments": 1,
"solcInputHash": "2c6e25839257e7c837f044fa2f8c67c2",
"metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"FactoryNotInstanceError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"InitializableAlreadyInitializedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InitializableNotInitializingError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InitializableZeroVersionError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleFactoryAlreadyCreatedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleFactoryClaimTooLargeError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleFactoryInvalidIdError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleFactoryNotCreatedError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OracleFactoryNotRegisteredError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"OwnableNotOwnerError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"OwnableNotPendingOwnerError\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"PausableNotPauserError\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PausablePausedError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IFactory\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"CallerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IOracleProviderFactory\",\"name\":\"factory\",\"type\":\"address\"}],\"name\":\"FactoryRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"version\",\"type\":\"uint256\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IInstance\",\"name\":\"instance\",\"type\":\"address\"}],\"name\":\"InstanceRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"UFixed6\",\"name\":\"newMaxClaim\",\"type\":\"uint256\"}],\"name\":\"MaxClaimUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"contract IOracleProvider\",\"name\":\"oracle\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"}],\"name\":\"OracleCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPauser\",\"type\":\"address\"}],\"name\":\"PauserUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"PendingOwnerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFactory\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"authorize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"authorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IFactory\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"callers\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"UFixed6\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"internalType\":\"contract IOracleProviderFactory\",\"name\":\"factory\",\"type\":\"address\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contract IOracle\",\"name\":\"newOracle\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IOracleProviderFactory\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"factories\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IMarket\",\"name\":\"market\",\"type\":\"address\"}],\"name\":\"fund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"incentive\",\"outputs\":[{\"internalType\":\"Token18\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"Token18\",\"name\":\"incentive_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IInstance\",\"name\":\"instance\",\"type\":\"address\"}],\"name\":\"instances\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxClaim\",\"outputs\":[{\"internalType\":\"UFixed6\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"oracles\",\"outputs\":[{\"internalType\":\"contract IOracleProvider\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IOracleProviderFactory\",\"name\":\"factory\",\"type\":\"address\"}],\"name\":\"register\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"id\",\"type\":\"bytes32\"},{\"internalType\":\"contract IOracleProviderFactory\",\"name\":\"factory\",\"type\":\"address\"}],\"name\":\"update\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"UFixed6\",\"name\":\"newMaxClaim\",\"type\":\"uint256\"}],\"name\":\"updateMaxClaim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPauser\",\"type\":\"address\"}],\"name\":\"updatePauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newPendingOwner\",\"type\":\"address\"}],\"name\":\"updatePendingOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"acceptOwner()\":{\"details\":\"Can only be called by the pending owner to ensure correctness. Calls to the `_beforeAcceptOwner` hook to perform logic before updating ownership.\"},\"authorize(address)\":{\"params\":{\"caller\":\"The factory to authorize\"}},\"authorized(address)\":{\"params\":{\"caller\":\"The caller to check\"},\"returns\":{\"_0\":\"Whether the caller is authorized\"}},\"claim(uint256)\":{\"details\":\"Can only be called by a registered underlying oracle provider factory\",\"params\":{\"amount\":\"The amount of tokens to claim\"}},\"constructor\":{\"params\":{\"implementation_\":\"The implementation contract for the oracle\"}},\"create(bytes32,address)\":{\"params\":{\"factory\":\"The initial underlying oracle factory for this oracle to use\",\"id\":\"The id of the oracle to create\"},\"returns\":{\"newOracle\":\"The newly created oracle instance\"}},\"fund(address)\":{\"params\":{\"market\":\"The market to claim from\"}},\"initialize(address)\":{\"params\":{\"incentive_\":\"The token that is paid out as a reward to oracle keepers\"}},\"instances(address)\":{\"params\":{\"instance\":\"The instance to check\"},\"returns\":{\"_0\":\"Whether the instance is valid\"}},\"pause()\":{\"details\":\"Can only be called by the pauser\"},\"register(address)\":{\"params\":{\"factory\":\"The factory to register\"}},\"unpause()\":{\"details\":\"Can only be called by the pauser\"},\"update(bytes32,address)\":{\"params\":{\"factory\":\"The new underlying oracle factory for this oracle to use\",\"id\":\"The id of the oracle to update\"}},\"updatePauser(address)\":{\"details\":\"Can only be called by the current owner\",\"params\":{\"newPauser\":\"New pauser address\"}},\"updatePendingOwner(address)\":{\"details\":\"Can only be called by the current owner New owner does not take affect until that address calls `acceptOwner()`\",\"params\":{\"newPendingOwner\":\"New pending owner address\"}}},\"title\":\"OracleFactory\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"acceptOwner()\":{\"notice\":\"Accepts and transfers the ownership of the contract to the pending owner\"},\"authorize(address)\":{\"notice\":\"Authorizes a factory's instances to request from this contract\"},\"authorized(address)\":{\"notice\":\"Checks whether a caller is authorized to request from this contract\"},\"callers(address)\":{\"notice\":\"Mapping of which factory's instances are authorized to request from this contract\"},\"claim(uint256)\":{\"notice\":\"Claims an amount of incentive tokens, to be paid out as a reward to the keeper\"},\"constructor\":{\"notice\":\"Constructs the contract\"},\"create(bytes32,address)\":{\"notice\":\"Creates a new oracle instance\"},\"factories(address)\":{\"notice\":\"Mapping of factory to whether it is registered\"},\"implementation()\":{\"notice\":\"The instance implementation address\"},\"incentive()\":{\"notice\":\"The token that is paid out as a reward to oracle keepers\"},\"initialize(address)\":{\"notice\":\"Initializes the contract state\"},\"instances(address)\":{\"notice\":\"Returns whether the instance is valid\"},\"maxClaim()\":{\"notice\":\"The maximum amount of tokens that can be rewarded in a single price update\"},\"oracles(bytes32)\":{\"notice\":\"Mapping of oracle id to oracle instance\"},\"pause()\":{\"notice\":\"Pauses the contract\"},\"register(address)\":{\"notice\":\"Registers a new oracle provider factory to be used in the underlying oracle instances\"},\"unpause()\":{\"notice\":\"Unpauses the contract\"},\"update(bytes32,address)\":{\"notice\":\"Updates the underlying oracle factory for an oracle instance\"},\"updateMaxClaim(uint256)\":{\"notice\":\"Updates the maximum amount of tokens that can be rewarded in a single price update\"},\"updatePauser(address)\":{\"notice\":\"Updates the new pauser\"},\"updatePendingOwner(address)\":{\"notice\":\"Updates the new pending owner\"}},\"notice\":\"Factory for creating and managing oracles\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol\":\"OracleFactory\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity 0.8.19;\\n\\nimport \\\"@equilibria/root/token/types/Token18.sol\\\";\\nimport \\\"@equilibria/root/attribute/Factory.sol\\\";\\nimport \\\"@equilibria/perennial-v2/contracts/interfaces/IOracleProviderFactory.sol\\\";\\nimport \\\"./interfaces/IOracleFactory.sol\\\";\\n\\n/// @title OracleFactory\\n/// @notice Factory for creating and managing oracles\\ncontract OracleFactory is IOracleFactory, Factory {\\n /// @notice The token that is paid out as a reward to oracle keepers\\n Token18 public incentive;\\n\\n /// @notice The maximum amount of tokens that can be rewarded in a single price update\\n UFixed6 public maxClaim;\\n\\n /// @notice Mapping of which factory's instances are authorized to request from this contract\\n mapping(IFactory => bool) public callers;\\n\\n /// @notice Mapping of oracle id to oracle instance\\n mapping(bytes32 => IOracleProvider) public oracles;\\n\\n /// @notice Mapping of factory to whether it is registered\\n mapping(IOracleProviderFactory => bool) public factories;\\n\\n /// @notice Constructs the contract\\n /// @param implementation_ The implementation contract for the oracle\\n constructor(address implementation_) Factory(implementation_) { }\\n\\n /// @notice Initializes the contract state\\n /// @param incentive_ The token that is paid out as a reward to oracle keepers\\n function initialize(Token18 incentive_) external initializer(1) {\\n __Factory__initialize();\\n\\n incentive = incentive_;\\n }\\n\\n /// @notice Registers a new oracle provider factory to be used in the underlying oracle instances\\n /// @param factory The factory to register\\n function register(IOracleProviderFactory factory) external onlyOwner {\\n factories[factory] = true;\\n emit FactoryRegistered(factory);\\n }\\n\\n /// @notice Authorizes a factory's instances to request from this contract\\n /// @param caller The factory to authorize\\n function authorize(IFactory caller) external onlyOwner {\\n callers[caller] = true;\\n emit CallerAuthorized(caller);\\n }\\n\\n /// @notice Creates a new oracle instance\\n /// @param id The id of the oracle to create\\n /// @param factory The initial underlying oracle factory for this oracle to use\\n /// @return newOracle The newly created oracle instance\\n function create(bytes32 id, IOracleProviderFactory factory) external onlyOwner returns (IOracle newOracle) {\\n if (!factories[factory]) revert OracleFactoryNotRegisteredError();\\n if (oracles[id] != IOracleProvider(address(0))) revert OracleFactoryAlreadyCreatedError();\\n\\n IOracleProvider oracleProvider = factory.oracles(id);\\n if (oracleProvider == IOracleProvider(address(0))) revert OracleFactoryInvalidIdError();\\n\\n newOracle = IOracle(address(_create(abi.encodeCall(IOracle.initialize, (oracleProvider)))));\\n oracles[id] = newOracle;\\n\\n emit OracleCreated(newOracle, id);\\n }\\n\\n /// @notice Updates the underlying oracle factory for an oracle instance\\n /// @param id The id of the oracle to update\\n /// @param factory The new underlying oracle factory for this oracle to use\\n function update(bytes32 id, IOracleProviderFactory factory) external onlyOwner {\\n if (!factories[factory]) revert OracleFactoryNotRegisteredError();\\n if (oracles[id] == IOracleProvider(address(0))) revert OracleFactoryNotCreatedError();\\n\\n IOracleProvider oracleProvider = factory.oracles(id);\\n if (oracleProvider == IOracleProvider(address(0))) revert OracleFactoryInvalidIdError();\\n\\n IOracle oracle = IOracle(address(oracles[id]));\\n oracle.update(oracleProvider);\\n }\\n\\n /// @notice Updates the maximum amount of tokens that can be rewarded in a single price update\\n function updateMaxClaim(UFixed6 newMaxClaim) external onlyOwner {\\n maxClaim = newMaxClaim;\\n emit MaxClaimUpdated(newMaxClaim);\\n }\\n\\n /// @notice Claims an amount of incentive tokens, to be paid out as a reward to the keeper\\n /// @dev Can only be called by a registered underlying oracle provider factory\\n /// @param amount The amount of tokens to claim\\n function claim(UFixed6 amount) external {\\n if (amount.gt(maxClaim)) revert OracleFactoryClaimTooLargeError();\\n if (!factories[IOracleProviderFactory(msg.sender)]) revert OracleFactoryNotRegisteredError();\\n incentive.push(msg.sender, UFixed18Lib.from(amount));\\n }\\n\\n /// @notice Checks whether a caller is authorized to request from this contract\\n /// @param caller The caller to check\\n /// @return Whether the caller is authorized\\n function authorized(address caller) external view returns (bool) {\\n IInstance callerInstance = IInstance(caller);\\n IFactory callerFactory = callerInstance.factory();\\n if (!callerFactory.instances(callerInstance)) return false;\\n return callers[callerFactory];\\n }\\n\\n // @notice Claims the oracle's fee from the given market\\n /// @param market The market to claim from\\n function fund(IMarket market) external {\\n if (!instances(IInstance(address(market.oracle())))) revert FactoryNotInstanceError();\\n market.claimFee();\\n }\\n}\\n\",\"keccak256\":\"0x452b6a9bae323f1e8e85f5582f8390b20eb9f8e16c2fd6081aafb63a9d8d9214\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2-oracle/contracts/interfaces/IOracle.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/attribute/interfaces/IInstance.sol\\\";\\nimport \\\"@equilibria/perennial-v2/contracts/interfaces/IOracleProvider.sol\\\";\\n\\ninterface IOracle is IOracleProvider, IInstance {\\n // sig: 0xb9d5b7c9\\n error OracleNotFactoryError();\\n // sig: 0x8852e53b\\n error OracleOutOfSyncError();\\n // sig: 0x0f7338e5\\n error OracleOutOfOrderCommitError();\\n\\n event OracleUpdated(IOracleProvider newProvider);\\n\\n /// @dev The state for a single epoch\\n struct Epoch {\\n /// @dev The oracle provider for this epoch\\n IOracleProvider provider;\\n\\n /// @dev The last timestamp that this oracle provider is valid\\n uint96 timestamp;\\n }\\n\\n /// @dev The global state for oracle\\n struct Global {\\n /// @dev The current epoch\\n uint128 current;\\n\\n /// @dev The latest epoch\\n uint128 latest;\\n }\\n\\n function initialize(IOracleProvider initialProvider) external;\\n function update(IOracleProvider newProvider) external;\\n}\",\"keccak256\":\"0x50a7a464655c5f8123193efe3539fb382dfdf06c41de90f108691ad368eb462c\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2-oracle/contracts/interfaces/IOracleFactory.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/token/types/Token18.sol\\\";\\nimport \\\"@equilibria/root/attribute/interfaces/IFactory.sol\\\";\\nimport \\\"@equilibria/perennial-v2/contracts/interfaces/IOracleProviderFactory.sol\\\";\\nimport \\\"@equilibria/perennial-v2/contracts/interfaces/IMarket.sol\\\";\\nimport \\\"./IOracle.sol\\\";\\n\\ninterface IOracleFactory is IOracleProviderFactory, IFactory {\\n event MaxClaimUpdated(UFixed6 newMaxClaim);\\n event FactoryRegistered(IOracleProviderFactory factory);\\n event CallerAuthorized(IFactory caller);\\n\\n // sig: 0xe7911099\\n error OracleFactoryInvalidIdError();\\n // sig: 0xe232e366\\n error OracleFactoryAlreadyCreatedError();\\n // sig: 0xbbfaa925\\n error OracleFactoryNotRegisteredError();\\n // sig: 0xfeb0e18c\\n error OracleFactoryNotCreatedError();\\n // sig: 0x4ddc5544\\n error OracleFactoryClaimTooLargeError();\\n\\n function factories(IOracleProviderFactory factory) external view returns (bool);\\n function initialize(Token18 incentive) external;\\n function register(IOracleProviderFactory factory) external;\\n function create(bytes32 id, IOracleProviderFactory factory) external returns (IOracle newOracle);\\n function update(bytes32 id, IOracleProviderFactory factory) external;\\n function updateMaxClaim(UFixed6 newClaimAmount) external;\\n function maxClaim() external view returns (UFixed6);\\n function claim(UFixed6 amount) external;\\n function callers(IFactory caller) external view returns (bool);\\n function fund(IMarket market) external;\\n}\",\"keccak256\":\"0x926ce9ef3e53f350c131972d7895896df9076d1f9a91a7622627a87286984c7d\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/interfaces/IMarket.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/attribute/interfaces/IInstance.sol\\\";\\nimport \\\"@equilibria/root/number/types/UFixed6.sol\\\";\\nimport \\\"@equilibria/root/token/types/Token18.sol\\\";\\nimport \\\"./IOracleProvider.sol\\\";\\nimport \\\"./IPayoffProvider.sol\\\";\\nimport \\\"../types/OracleVersion.sol\\\";\\nimport \\\"../types/MarketParameter.sol\\\";\\nimport \\\"../types/RiskParameter.sol\\\";\\nimport \\\"../types/Version.sol\\\";\\nimport \\\"../types/Local.sol\\\";\\nimport \\\"../types/Global.sol\\\";\\nimport \\\"../types/Position.sol\\\";\\n\\ninterface IMarket is IInstance {\\n struct MarketDefinition {\\n Token18 token;\\n IOracleProvider oracle;\\n IPayoffProvider payoff;\\n }\\n\\n struct Context {\\n ProtocolParameter protocolParameter;\\n MarketParameter marketParameter;\\n RiskParameter riskParameter;\\n uint256 currentTimestamp;\\n OracleVersion latestVersion;\\n OracleVersion positionVersion;\\n Global global;\\n Local local;\\n PositionContext currentPosition;\\n PositionContext latestPosition;\\n }\\n\\n struct PositionContext {\\n Position global;\\n Position local;\\n }\\n\\n event Updated(address indexed sender, address indexed account, uint256 version, UFixed6 newMaker, UFixed6 newLong, UFixed6 newShort, Fixed6 collateral, bool protect);\\n event PositionProcessed(uint256 indexed fromOracleVersion, uint256 indexed toOracleVersion, uint256 fromPosition, uint256 toPosition, VersionAccumulationResult accumulationResult);\\n event AccountPositionProcessed(address indexed account, uint256 indexed fromOracleVersion, uint256 indexed toOracleVersion, uint256 fromPosition, uint256 toPosition, LocalAccumulationResult accumulationResult);\\n event BeneficiaryUpdated(address newBeneficiary);\\n event CoordinatorUpdated(address newCoordinator);\\n event FeeClaimed(address indexed account, UFixed6 amount);\\n event RewardClaimed(address indexed account, UFixed6 amount);\\n event ParameterUpdated(MarketParameter newParameter);\\n event RiskParameterUpdated(RiskParameter newRiskParameter);\\n event RewardUpdated(Token18 newReward);\\n\\n // sig: 0x0fe90964\\n error MarketInsufficientLiquidityError();\\n // sig: 0x00e2b6a8\\n error MarketInsufficientMarginError();\\n // sig: 0xa8e7d409\\n error MarketInsufficientMaintenanceError();\\n // sig: 0x442145e5\\n error MarketInsufficientCollateralError();\\n // sig: 0xba555da7\\n error MarketProtectedError();\\n // sig: 0x6ed43d8e\\n error MarketMakerOverLimitError();\\n // sig: 0x29ab4c44\\n error MarketClosedError();\\n // sig: 0x07732aee\\n error MarketCollateralBelowLimitError();\\n // sig: 0x5bdace60\\n error MarketOperatorNotAllowedError();\\n // sig: 0x8a68c1dc\\n error MarketNotSingleSidedError();\\n // sig: 0x736f9fda\\n error MarketOverCloseError();\\n // sig: 0x935bdc21\\n error MarketExceedsPendingIdLimitError();\\n // sig: 0x473b50fd\\n error MarketRewardAlreadySetError();\\n // sig: 0x06fbf046\\n error MarketInvalidRewardError();\\n // sig: 0x9bca0625\\n error MarketNotCoordinatorError();\\n // sig: 0xb602d086\\n error MarketNotBeneficiaryError();\\n // sig: 0x534f7fe6\\n error MarketInvalidProtectionError();\\n // sig: 0xab1e3a00\\n error MarketStalePriceError();\\n // sig: 0x15f9ae70\\n error MarketEfficiencyUnderLimitError();\\n // sig: 0x7302d51a\\n error MarketInvalidMarketParameterError(uint256 code);\\n // sig: 0xc5f0e98a\\n error MarketInvalidRiskParameterError(uint256 code);\\n\\n // sig: 0x2142bc27\\n error GlobalStorageInvalidError();\\n // sig: 0xc83d08ec\\n error LocalStorageInvalidError();\\n // sig: 0x7c53e926\\n error MarketParameterStorageInvalidError();\\n // sig: 0x98eb4898\\n error PositionStorageLocalInvalidError();\\n // sig: 0x7ecd083f\\n error RiskParameterStorageInvalidError();\\n // sig: 0xd2777e72\\n error VersionStorageInvalidError();\\n\\n function initialize(MarketDefinition calldata definition_) external;\\n function token() external view returns (Token18);\\n function reward() external view returns (Token18);\\n function oracle() external view returns (IOracleProvider);\\n function payoff() external view returns (IPayoffProvider);\\n function beneficiary() external view returns (address);\\n function coordinator() external view returns (address);\\n function positions(address account) external view returns (Position memory);\\n function pendingPositions(address account, uint256 id) external view returns (Position memory);\\n function locals(address account) external view returns (Local memory);\\n function versions(uint256 timestamp) external view returns (Version memory);\\n function pendingPosition(uint256 id) external view returns (Position memory);\\n function position() external view returns (Position memory);\\n function global() external view returns (Global memory);\\n function update(address account, UFixed6 newMaker, UFixed6 newLong, UFixed6 newShort, Fixed6 collateral, bool protect) external;\\n function updateBeneficiary(address newBeneficiary) external;\\n function updateCoordinator(address newCoordinator) external;\\n function updateReward(Token18 newReward) external;\\n function parameter() external view returns (MarketParameter memory);\\n function riskParameter() external view returns (RiskParameter memory);\\n function updateParameter(MarketParameter memory newParameter) external;\\n function updateRiskParameter(RiskParameter memory newRiskParameter) external;\\n function claimFee() external;\\n function claimReward() external;\\n}\\n\",\"keccak256\":\"0x3fbd8a66b73342d00242368f52e60b5b1264d514696bc59f181a113a9b23902f\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/interfaces/IOracleProvider.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../types/OracleVersion.sol\\\";\\n\\n/// @dev OracleVersion Invariants\\n/// - Each newly requested version must be increasing, but does not need to incrementing\\n/// - We recommend using something like timestamps or blocks for versions so that intermediary non-requested\\n/// versions may be posted for the purpose of expedient liquidations\\n/// - Versions are allowed to \\\"fail\\\" and will be marked as .valid = false\\n/// - Versions must be committed in order, i.e. all requested versions prior to latestVersion must be available\\n/// - Non-requested versions may be committed, but will not receive a keeper reward\\n/// - This is useful for immediately liquidating an account with a valid off-chain price in between orders\\n/// - Satisfying the above constraints, only versions more recent than the latest version may be committed\\n/// - Current must always be greater than Latest, never equal\\n/// - Request must register the same current version that was returned by Current within the same transaction\\ninterface IOracleProvider {\\n // sig: 0x652fafab\\n error OracleProviderUnauthorizedError();\\n\\n event OracleProviderVersionRequested(uint256 indexed version);\\n event OracleProviderVersionFulfilled(uint256 indexed version);\\n\\n function request(address account) external;\\n function status() external view returns (OracleVersion memory, uint256);\\n function latest() external view returns (OracleVersion memory);\\n function current() external view returns (uint256);\\n function at(uint256 timestamp) external view returns (OracleVersion memory);\\n}\",\"keccak256\":\"0x484da9dcaca8754ee21878e679c303712e0c219e231666c6b7bb3d927d471f17\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/interfaces/IOracleProviderFactory.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../types/OracleVersion.sol\\\";\\nimport \\\"./IOracleProvider.sol\\\";\\n\\ninterface IOracleProviderFactory {\\n event OracleCreated(IOracleProvider indexed oracle, bytes32 indexed id);\\n\\n function oracles(bytes32 id) external view returns (IOracleProvider);\\n function authorized(address caller) external view returns (bool);\\n}\",\"keccak256\":\"0x98da1ba35dc599bd3f98a02fc411976176538fd53e9c675c6b833b43c0047434\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/interfaces/IPayoffProvider.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/number/types/Fixed6.sol\\\";\\n\\ninterface IPayoffProvider {\\n function payoff(Fixed6 price) external pure returns (Fixed6 payoff);\\n}\\n\",\"keccak256\":\"0xda57bdec535b0768c7c25889f5c1d7fbce94acc41ca836b821e5ea9f686f8898\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/Global.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/pid/types/PAccumulator6.sol\\\";\\nimport \\\"./ProtocolParameter.sol\\\";\\nimport \\\"./MarketParameter.sol\\\";\\n\\n/// @dev Global type\\nstruct Global {\\n /// @dev The current position ID\\n uint256 currentId;\\n\\n /// @dev The latest position id\\n uint256 latestId;\\n\\n /// @dev The accrued protocol fee\\n UFixed6 protocolFee;\\n\\n /// @dev The accrued oracle fee\\n UFixed6 oracleFee;\\n\\n /// @dev The accrued risk fee\\n UFixed6 riskFee;\\n\\n /// @dev The accrued donation\\n UFixed6 donation;\\n\\n /// @dev The current PAccumulator state\\n PAccumulator6 pAccumulator;\\n\\n /// @dev The latest valid price\\n Fixed6 latestPrice;\\n}\\nusing GlobalLib for Global global;\\nstruct GlobalStorage { uint256 slot0; uint256 slot1; }\\nusing GlobalStorageLib for GlobalStorage global;\\n\\n/// @title Global\\n/// @notice Holds the global market state\\nlibrary GlobalLib {\\n /// @notice Increments the fees by `amount` using current parameters\\n /// @param self The Global object to update\\n /// @param amount The amount to increment fees by\\n /// @param keeper The amount to increment the keeper fee by\\n /// @param marketParameter The current market parameters\\n /// @param protocolParameter The current protocol parameters\\n function incrementFees(\\n Global memory self,\\n UFixed6 amount,\\n UFixed6 keeper,\\n MarketParameter memory marketParameter,\\n ProtocolParameter memory protocolParameter\\n ) internal pure {\\n UFixed6 protocolFeeAmount = amount.mul(protocolParameter.protocolFee);\\n UFixed6 marketFeeAmount = amount.sub(protocolFeeAmount);\\n\\n UFixed6 oracleFeeAmount = marketFeeAmount.mul(marketParameter.oracleFee);\\n UFixed6 riskFeeAmount = marketFeeAmount.mul(marketParameter.riskFee);\\n UFixed6 donationAmount = marketFeeAmount.sub(oracleFeeAmount).sub(riskFeeAmount);\\n\\n self.protocolFee = self.protocolFee.add(protocolFeeAmount);\\n self.oracleFee = self.oracleFee.add(keeper).add(oracleFeeAmount);\\n self.riskFee = self.riskFee.add(riskFeeAmount);\\n self.donation = self.donation.add(donationAmount);\\n }\\n\\n /// @notice Updates the latest valid price\\n /// @param self The Global object to update\\n /// @param latestPrice The new latest valid price\\n function update(Global memory self, uint256 latestId, Fixed6 latestPrice) internal pure {\\n self.latestId = latestId;\\n self.latestPrice = latestPrice;\\n }\\n}\\n\\n/// @dev Manually encodes and decodes the Global struct into storage.\\n///\\n/// struct StoredGlobal {\\n/// /* slot 0 */\\n/// uint32 currentId; // <= 4.29b\\n/// uint32 latestId; // <= 4.29b\\n/// uint48 protocolFee; // <= 281m\\n/// uint48 oracleFee; // <= 281m\\n/// uint48 riskFee; // <= 281m\\n/// uint48 donation; // <= 281m\\n///\\n/// /* slot 1 */\\n/// int32 pAccumulator.value; // <= 214000%\\n/// int24 pAccumulator.skew; // <= 838%\\n/// int64 latestPrice; // <= 9.22t\\n/// }\\n///\\nlibrary GlobalStorageLib {\\n // sig: 0x2142bc27\\n error GlobalStorageInvalidError();\\n\\n function read(GlobalStorage storage self) internal view returns (Global memory) {\\n (uint256 slot0, uint256 slot1) = (self.slot0, self.slot1);\\n return Global(\\n uint256(slot0 << (256 - 32)) >> (256 - 32),\\n uint256(slot0 << (256 - 32 - 32)) >> (256 - 32),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 32 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 32 - 48 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 32 - 48 - 48 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 32 - 48 - 48 - 48 - 48)) >> (256 - 48)),\\n PAccumulator6(\\n Fixed6.wrap(int256(slot1 << (256 - 32)) >> (256 - 32)),\\n Fixed6.wrap(int256(slot1 << (256 - 32 - 24)) >> (256 - 24))\\n ),\\n Fixed6.wrap(int256(slot1 << (256 - 32 - 24 - 64)) >> (256 - 64))\\n );\\n }\\n\\n function store(GlobalStorage storage self, Global memory newValue) internal {\\n if (newValue.currentId > uint256(type(uint32).max)) revert GlobalStorageInvalidError();\\n if (newValue.latestId > uint256(type(uint32).max)) revert GlobalStorageInvalidError();\\n if (newValue.protocolFee.gt(UFixed6.wrap(type(uint48).max))) revert GlobalStorageInvalidError();\\n if (newValue.oracleFee.gt(UFixed6.wrap(type(uint48).max))) revert GlobalStorageInvalidError();\\n if (newValue.riskFee.gt(UFixed6.wrap(type(uint48).max))) revert GlobalStorageInvalidError();\\n if (newValue.donation.gt(UFixed6.wrap(type(uint48).max))) revert GlobalStorageInvalidError();\\n if (newValue.pAccumulator._value.gt(Fixed6.wrap(type(int32).max))) revert GlobalStorageInvalidError();\\n if (newValue.pAccumulator._value.lt(Fixed6.wrap(type(int32).min))) revert GlobalStorageInvalidError();\\n if (newValue.pAccumulator._skew.gt(Fixed6.wrap(type(int24).max))) revert GlobalStorageInvalidError();\\n if (newValue.pAccumulator._skew.lt(Fixed6.wrap(type(int24).min))) revert GlobalStorageInvalidError();\\n if (newValue.latestPrice.gt(Fixed6.wrap(type(int64).max))) revert GlobalStorageInvalidError();\\n if (newValue.latestPrice.lt(Fixed6.wrap(type(int64).min))) revert GlobalStorageInvalidError();\\n\\n uint256 encoded0 =\\n uint256(newValue.currentId << (256 - 32)) >> (256 - 32) |\\n uint256(newValue.latestId << (256 - 32)) >> (256 - 32 - 32) |\\n uint256(UFixed6.unwrap(newValue.protocolFee) << (256 - 48)) >> (256 - 32 - 32 - 48) |\\n uint256(UFixed6.unwrap(newValue.oracleFee) << (256 - 48)) >> (256 - 32 - 32 - 48 - 48) |\\n uint256(UFixed6.unwrap(newValue.riskFee) << (256 - 48)) >> (256 - 32 - 32 - 48 - 48 - 48) |\\n uint256(UFixed6.unwrap(newValue.donation) << (256 - 48)) >> (256 - 32 - 32 - 48 - 48 - 48 - 48);\\n\\n uint256 encoded1 =\\n uint256(Fixed6.unwrap(newValue.pAccumulator._value) << (256 - 32)) >> (256 - 32) |\\n uint256(Fixed6.unwrap(newValue.pAccumulator._skew) << (256 - 24)) >> (256 - 32 - 24) |\\n uint256(Fixed6.unwrap(newValue.latestPrice) << (256 - 64)) >> (256 - 32 - 24 - 64);\\n\\n assembly {\\n sstore(self.slot, encoded0)\\n sstore(add(self.slot, 1), encoded1)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x735116c4792736c01e01dab1e0f27498affc6327fc3da2723b5c7c2bff29bf56\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/Invalidation.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/number/types/Fixed6.sol\\\";\\nimport \\\"./Position.sol\\\";\\n\\n/// @dev Invalidation type\\nstruct Invalidation {\\n /// @dev The change in the maker position\\n Fixed6 maker;\\n\\n /// @dev The change in the long position\\n Fixed6 long;\\n\\n /// @dev The change in the short position\\n Fixed6 short;\\n}\\nusing InvalidationLib for Invalidation global;\\n\\n/// @title Invalidation\\n/// @notice Holds the state for an account's update invalidation\\nlibrary InvalidationLib {\\n /// @notice Increments the invalidation accumulator by an invalidation delta\\n /// @param self The invalidation object to update\\n /// @param latestPosition The latest position\\n /// @param newPosition The pending position\\n function increment(Invalidation memory self, Position memory latestPosition, Position memory newPosition) internal pure {\\n self.maker = self.maker.add(Fixed6Lib.from(latestPosition.maker).sub(Fixed6Lib.from(newPosition.maker)));\\n self.long = self.long.add(Fixed6Lib.from(latestPosition.long).sub(Fixed6Lib.from(newPosition.long)));\\n self.short = self.short.add(Fixed6Lib.from(latestPosition.short).sub(Fixed6Lib.from(newPosition.short)));\\n }\\n\\n /// @notice Returns the invalidation delta between two invalidation accumulators\\n /// @param self The starting invalidation object\\n /// @param invalidation The ending invalidation object\\n /// @return delta The invalidation delta\\n function sub(\\n Invalidation memory self,\\n Invalidation memory invalidation\\n ) internal pure returns (Invalidation memory delta) {\\n delta.maker = self.maker.sub(invalidation.maker);\\n delta.long = self.long.sub(invalidation.long);\\n delta.short = self.short.sub(invalidation.short);\\n }\\n\\n /// @notice Replaces the invalidation with a new invalidation\\n /// @param self The invalidation object to update\\n /// @param newInvalidation The new invalidation object\\n function update(Invalidation memory self, Invalidation memory newInvalidation) internal pure {\\n (self.maker, self.long, self.short) = (newInvalidation.maker, newInvalidation.long, newInvalidation.short);\\n }\\n}\\n\",\"keccak256\":\"0xc8e6bba84e66e0ff1e5566e2d86570591ea1829ae2ac88d857cabc536a89a67e\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/Local.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/number/types/Fixed6.sol\\\";\\nimport \\\"@equilibria/root/number/types/Fixed6.sol\\\";\\nimport \\\"./Version.sol\\\";\\nimport \\\"./Position.sol\\\";\\n\\n/// @dev Local type\\nstruct Local {\\n /// @dev The current position id\\n uint256 currentId;\\n\\n /// @dev The latest position id\\n uint256 latestId;\\n\\n /// @dev The collateral balance\\n Fixed6 collateral;\\n\\n /// @dev The reward balance\\n UFixed6 reward;\\n\\n /// @dev The protection status\\n uint256 protection;\\n}\\nusing LocalLib for Local global;\\nstruct LocalStorage { uint256 slot0; }\\nusing LocalStorageLib for LocalStorage global;\\n\\nstruct LocalAccumulationResult {\\n Fixed6 collateralAmount;\\n UFixed6 rewardAmount;\\n UFixed6 positionFee;\\n UFixed6 keeper;\\n}\\n\\n/// @title Local\\n/// @notice Holds the local account state\\nlibrary LocalLib {\\n /// @notice Updates the collateral with the new collateral change\\n /// @param self The Local object to update\\n /// @param collateral The amount to update the collateral by\\n function update(Local memory self, Fixed6 collateral) internal pure {\\n self.collateral = self.collateral.add(collateral);\\n }\\n\\n /// @notice Settled the local from its latest position to next position\\n /// @param self The Local object to update\\n /// @param fromPosition The previous latest position\\n /// @param toPosition The next latest position\\n /// @param fromVersion The previous latest version\\n /// @param toVersion The next latest version\\n /// @return values The accumulation result\\n function accumulate(\\n Local memory self,\\n uint256 latestId,\\n Position memory fromPosition,\\n Position memory toPosition,\\n Version memory fromVersion,\\n Version memory toVersion\\n ) internal pure returns (LocalAccumulationResult memory values) {\\n values.collateralAmount = toVersion.makerValue.accumulated(fromVersion.makerValue, fromPosition.maker)\\n .add(toVersion.longValue.accumulated(fromVersion.longValue, fromPosition.long))\\n .add(toVersion.shortValue.accumulated(fromVersion.shortValue, fromPosition.short));\\n values.rewardAmount = toVersion.makerReward.accumulated(fromVersion.makerReward, fromPosition.maker)\\n .add(toVersion.longReward.accumulated(fromVersion.longReward, fromPosition.long))\\n .add(toVersion.shortReward.accumulated(fromVersion.shortReward, fromPosition.short));\\n values.positionFee = toPosition.fee;\\n values.keeper = toPosition.keeper;\\n\\n Fixed6 feeAmount = Fixed6Lib.from(values.positionFee.add(values.keeper));\\n self.collateral = self.collateral.add(values.collateralAmount).sub(feeAmount);\\n self.reward = self.reward.add(values.rewardAmount);\\n self.latestId = latestId;\\n }\\n\\n /// @notice Updates the local to put it into a protected state for liquidation\\n /// @param self The Local object to update\\n /// @param latestPosition The latest position\\n /// @param currentTimestamp The current timestamp\\n /// @param tryProtect Whether to try to protect the local\\n /// @return Whether the local was protected\\n function protect(\\n Local memory self,\\n Position memory latestPosition,\\n uint256 currentTimestamp,\\n bool tryProtect\\n ) internal pure returns (bool) {\\n if (!tryProtect || self.protection > latestPosition.timestamp) return false;\\n self.protection = currentTimestamp;\\n return true;\\n }\\n\\n /// @notice Clears the local's reward value\\n /// @param self The Local object to update\\n function clearReward(Local memory self) internal pure {\\n self.reward = UFixed6Lib.ZERO;\\n }\\n}\\n\\n/// @dev Manually encodes and decodes the Local struct into storage.\\n///\\n/// struct StoredLocal {\\n/// /* slot 0 */\\n/// uint32 currentId; // <= 4.29b\\n/// uint32 latestId; // <= 4.29b\\n/// int64 collateral; // <= 9.22t\\n/// uint64 reward; // <= 18.44t\\n/// uint32 protection; // <= 4.29b\\n/// }\\n///\\nlibrary LocalStorageLib {\\n // sig: 0xc83d08ec\\n error LocalStorageInvalidError();\\n\\n function read(LocalStorage storage self) internal view returns (Local memory) {\\n uint256 slot0 = self.slot0;\\n return Local(\\n uint256(slot0 << (256 - 32)) >> (256 - 32),\\n uint256(slot0 << (256 - 32 - 32)) >> (256 - 32),\\n Fixed6.wrap(int256(slot0 << (256 - 32 - 32 - 64)) >> (256 - 64)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 32 - 64 - 64)) >> (256 - 64)),\\n (uint256(slot0) << (256 - 32 - 32 - 64 - 64 - 32)) >> (256 - 32)\\n );\\n }\\n\\n function store(LocalStorage storage self, Local memory newValue) internal {\\n if (newValue.currentId > uint256(type(uint32).max)) revert LocalStorageInvalidError();\\n if (newValue.latestId > uint256(type(uint32).max)) revert LocalStorageInvalidError();\\n if (newValue.collateral.gt(Fixed6.wrap(type(int64).max))) revert LocalStorageInvalidError();\\n if (newValue.collateral.lt(Fixed6.wrap(type(int64).min))) revert LocalStorageInvalidError();\\n if (newValue.reward.gt(UFixed6.wrap(type(uint64).max))) revert LocalStorageInvalidError();\\n if (newValue.protection > uint256(type(uint32).max)) revert LocalStorageInvalidError();\\n\\n uint256 encoded =\\n uint256(newValue.currentId << (256 - 32)) >> (256 - 32) |\\n uint256(newValue.latestId << (256 - 32)) >> (256 - 32 - 32) |\\n uint256(Fixed6.unwrap(newValue.collateral) << (256 - 64)) >> (256 - 32 - 32 - 64) |\\n uint256(UFixed6.unwrap(newValue.reward) << (256 - 64)) >> (256 - 32 - 32 - 64 - 64) |\\n uint256(newValue.protection << (256 - 32)) >> (256 - 32 - 32 - 64 - 64 - 32);\\n assembly {\\n sstore(self.slot, encoded)\\n }\\n }\\n}\",\"keccak256\":\"0x9166dcf925d4da8109e09f737442598b653abf1ba1a08659f7883aaee9d5cb1e\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/MarketParameter.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/token/types/Token18.sol\\\";\\nimport \\\"@equilibria/root/number/types/UFixed6.sol\\\";\\nimport \\\"@equilibria/root/utilization/types/UJumpRateUtilizationCurve6.sol\\\";\\nimport \\\"@equilibria/root/pid/types/PController6.sol\\\";\\nimport \\\"../interfaces/IOracleProvider.sol\\\";\\nimport \\\"../interfaces/IPayoffProvider.sol\\\";\\nimport \\\"./ProtocolParameter.sol\\\";\\n\\n/// @dev MarketParameter type\\nstruct MarketParameter {\\n /// @dev The fee that is taken out of funding\\n UFixed6 fundingFee;\\n\\n /// @dev The fee that is taken out of interest\\n UFixed6 interestFee;\\n\\n /// @dev The fee that is taken out of maker and taker fees\\n UFixed6 positionFee;\\n\\n /// @dev The share of the collected fees that is paid to the oracle\\n UFixed6 oracleFee;\\n\\n /// @dev The share of the collected fees that is paid to the risk coordinator\\n UFixed6 riskFee;\\n\\n /// @dev The maximum amount of orders that can be pending at one time globally\\n uint256 maxPendingGlobal;\\n\\n /// @dev The maximum amount of orders that can be pending at one time per account\\n uint256 maxPendingLocal;\\n\\n /// @dev The rate at which the makers receives rewards (share / sec)\\n UFixed6 makerRewardRate;\\n\\n /// @dev The rate at which the longs receives rewards (share / sec)\\n UFixed6 longRewardRate;\\n\\n /// @dev The rate at which the shorts receives rewards (share / sec)\\n UFixed6 shortRewardRate;\\n\\n /// @dev The fixed fee that is charge whenever an oracle request occurs\\n UFixed6 settlementFee;\\n\\n /// @dev Whether longs and shorts can always close even when they'd put the market into socialization\\n bool takerCloseAlways;\\n\\n /// @dev Whether makers can always close even when they'd put the market into socialization\\n bool makerCloseAlways;\\n\\n /// @dev Whether the market is in close-only mode\\n bool closed;\\n}\\nstruct MarketParameterStorage { uint256 slot0; uint256 slot1; }\\nusing MarketParameterStorageLib for MarketParameterStorage global;\\n\\n/// @dev Manually encodes and decodes the MarketParameter struct into storage.\\n///\\n/// struct StoredMarketParameter {\\n/// /* slot 0 */\\n/// uint24 fundingFee; // <= 1677%\\n/// uint24 interestFee; // <= 1677%\\n/// uint24 positionFee; // <= 1677%\\n/// uint24 oracleFee; // <= 1677%\\n/// uint24 riskFee; // <= 1677%\\n/// uint16 maxPendingGlobal; // <= 65k\\n/// uint16 maxPendingLocal; // <= 65k\\n/// uint48 settlementFee; // <= 281m\\n/// uint8 flags;\\n///\\n/// /* slot 1 */\\n/// uint40 makerRewardRate; // <= 281m / s\\n/// uint40 longRewardRate; // <= 281m / s\\n/// uint40 shortRewardRate; // <= 281m / s\\n/// }\\n///\\nlibrary MarketParameterStorageLib {\\n // sig: 0x7c53e926\\n error MarketParameterStorageInvalidError();\\n\\n function read(MarketParameterStorage storage self) external view returns (MarketParameter memory) {\\n (uint256 slot0, uint256 slot1) = (self.slot0, self.slot1);\\n\\n uint256 flags = uint256(slot0) >> (256 - 8);\\n (bool takerCloseAlways, bool makerCloseAlways, bool closed) =\\n (flags & 0x01 == 0x01, flags & 0x02 == 0x02, flags & 0x04 == 0x04);\\n\\n return MarketParameter(\\n UFixed6.wrap(uint256(slot0 << (256 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256(slot0 << (256 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256(slot0 << (256 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256(slot0 << (256 - 24 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256(slot0 << (256 - 24 - 24 - 24 - 24 - 24)) >> (256 - 24)),\\n uint256(slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 16)) >> (256 - 16),\\n uint256(slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 16 - 16)) >> (256 - 16),\\n UFixed6.wrap(uint256(slot1 << (256 - 40)) >> (256 - 40)),\\n UFixed6.wrap(uint256(slot1 << (256 - 40 - 40)) >> (256 - 40)),\\n UFixed6.wrap(uint256(slot1 << (256 - 40 - 40 - 40)) >> (256 - 40)),\\n UFixed6.wrap(uint256(slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 16 - 16 - 48)) >> (256 - 48)),\\n takerCloseAlways,\\n makerCloseAlways,\\n closed\\n );\\n }\\n\\n function validate(\\n MarketParameter memory self,\\n ProtocolParameter memory protocolParameter,\\n Token18 reward\\n ) public pure {\\n if (self.settlementFee.gt(protocolParameter.maxFeeAbsolute)) revert MarketParameterStorageInvalidError();\\n\\n if (self.fundingFee.max(self.interestFee).max(self.positionFee).gt(protocolParameter.maxCut))\\n revert MarketParameterStorageInvalidError();\\n\\n if (self.oracleFee.add(self.riskFee).gt(UFixed6Lib.ONE)) revert MarketParameterStorageInvalidError();\\n\\n if (\\n reward.isZero() &&\\n (!self.makerRewardRate.isZero() || !self.longRewardRate.isZero() || !self.shortRewardRate.isZero())\\n ) revert MarketParameterStorageInvalidError();\\n }\\n\\n function validateAndStore(\\n MarketParameterStorage storage self,\\n MarketParameter memory newValue,\\n ProtocolParameter memory protocolParameter,\\n Token18 reward\\n ) external {\\n validate(newValue, protocolParameter, reward);\\n\\n if (newValue.maxPendingGlobal > uint256(type(uint16).max)) revert MarketParameterStorageInvalidError();\\n if (newValue.maxPendingLocal > uint256(type(uint16).max)) revert MarketParameterStorageInvalidError();\\n if (newValue.makerRewardRate.gt(UFixed6.wrap(type(uint40).max))) revert MarketParameterStorageInvalidError();\\n if (newValue.longRewardRate.gt(UFixed6.wrap(type(uint40).max))) revert MarketParameterStorageInvalidError();\\n if (newValue.shortRewardRate.gt(UFixed6.wrap(type(uint40).max))) revert MarketParameterStorageInvalidError();\\n\\n _store(self, newValue);\\n }\\n\\n function _store(MarketParameterStorage storage self, MarketParameter memory newValue) internal {\\n uint256 flags = (newValue.takerCloseAlways ? 0x01 : 0x00) |\\n (newValue.makerCloseAlways ? 0x02 : 0x00) |\\n (newValue.closed ? 0x04 : 0x00);\\n\\n uint256 encoded0 =\\n uint256(UFixed6.unwrap(newValue.fundingFee) << (256 - 24)) >> (256 - 24) |\\n uint256(UFixed6.unwrap(newValue.interestFee) << (256 - 24)) >> (256 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.positionFee) << (256 - 24)) >> (256 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.oracleFee) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.riskFee) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24 - 24) |\\n uint256(newValue.maxPendingGlobal << (256 - 16)) >> (256 - 24 - 24 - 24 - 24 - 24 - 16) |\\n uint256(newValue.maxPendingLocal << (256 - 16)) >> (256 - 24 - 24 - 24 - 24 - 24 - 16 - 16) |\\n uint256(UFixed6.unwrap(newValue.settlementFee) << (256 - 48)) >> (256 - 24 - 24 - 24 - 24 - 24 - 16 - 16 - 48) |\\n uint256(flags << (256 - 8)) >> (256 - 24 - 24 - 24 - 24 - 24 - 32 - 32 - 32 - 32 - 8);\\n uint256 encoded1 =\\n uint256(UFixed6.unwrap(newValue.makerRewardRate) << (256 - 40)) >> (256 - 40) |\\n uint256(UFixed6.unwrap(newValue.longRewardRate) << (256 - 40)) >> (256 - 40 - 40) |\\n uint256(UFixed6.unwrap(newValue.shortRewardRate) << (256 - 40)) >> (256 - 40 - 40 - 40);\\n\\n assembly {\\n sstore(self.slot, encoded0)\\n sstore(add(self.slot, 1), encoded1)\\n }\\n }\\n}\",\"keccak256\":\"0xce5c3dc4f7cc40c315fb5173b64fd6752763fe798379e887050eb5d70a2ef230\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/OracleVersion.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/number/types/Fixed6.sol\\\";\\n\\n/// @dev A singular oracle version with its corresponding data\\nstruct OracleVersion {\\n /// @dev the timestamp of the oracle update\\n uint256 timestamp;\\n\\n /// @dev The oracle price of the corresponding version\\n Fixed6 price;\\n\\n /// @dev Whether the version is valid\\n bool valid;\\n}\\n\",\"keccak256\":\"0x543d36affe7b862bf72fac9cfb40a639d2b3fe1b32d9181552d523bc64d9a0f7\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/Order.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./OracleVersion.sol\\\";\\nimport \\\"./RiskParameter.sol\\\";\\nimport \\\"./MarketParameter.sol\\\";\\nimport \\\"./Position.sol\\\";\\n\\n/// @dev Order type\\nstruct Order {\\n /// @dev The change in the maker position\\n Fixed6 maker;\\n\\n /// @dev The change in the long position\\n Fixed6 long;\\n\\n /// @dev The change in the short position\\n Fixed6 short;\\n\\n /// @dev The change in the net position\\n Fixed6 net;\\n\\n /// @dev The magnitude of the change in the skew\\n UFixed6 skew;\\n\\n /// @dev The change of the magnitude in the skew\\n Fixed6 impact;\\n\\n /// @dev The change in the utilization=\\n Fixed6 utilization;\\n\\n /// @dev The change in the efficiency\\n Fixed6 efficiency;\\n\\n /// @dev The fee for the order\\n UFixed6 fee;\\n\\n /// @dev The fixed settlement fee for the order\\n UFixed6 keeper;\\n}\\nusing OrderLib for Order global;\\n\\n/// @title Order\\n/// @notice Holds the state for an account's update order\\nlibrary OrderLib {\\n /// @notice Computes and sets the fee and keeper once an order is already created\\n /// @param self The Order object to update\\n /// @param latestVersion The latest oracle version\\n /// @param marketParameter The market parameter\\n /// @param riskParameter The risk parameter\\n function registerFee(\\n Order memory self,\\n OracleVersion memory latestVersion,\\n MarketParameter memory marketParameter,\\n RiskParameter memory riskParameter\\n ) internal pure {\\n Fixed6 makerFee = Fixed6Lib.from(riskParameter.makerFee)\\n .add(Fixed6Lib.from(riskParameter.makerImpactFee).mul(self.utilization))\\n .max(Fixed6Lib.ZERO);\\n Fixed6 takerFee = Fixed6Lib.from(riskParameter.takerFee)\\n .add(Fixed6Lib.from(riskParameter.takerSkewFee.mul(self.skew)))\\n .add(Fixed6Lib.from(riskParameter.takerImpactFee).mul(self.impact))\\n .max(Fixed6Lib.ZERO);\\n UFixed6 fee = self.maker.abs().mul(latestVersion.price.abs()).mul(UFixed6Lib.from(makerFee))\\n .add(self.long.abs().add(self.short.abs()).mul(latestVersion.price.abs()).mul(UFixed6Lib.from(takerFee)));\\n\\n self.fee = marketParameter.closed ? UFixed6Lib.ZERO : fee;\\n self.keeper = isEmpty(self) ? UFixed6Lib.ZERO : marketParameter.settlementFee;\\n }\\n\\n /// @notice Returns whether the order increases any of the account's positions\\n /// @return Whether the order increases any of the account's positions\\n function increasesPosition(Order memory self) internal pure returns (bool) {\\n return increasesMaker(self) || increasesTaker(self);\\n }\\n\\n /// @notice Returns whether the order increases the account's long or short positions\\n /// @return Whether the order increases the account's long or short positions\\n function increasesTaker(Order memory self) internal pure returns (bool) {\\n return self.long.gt(Fixed6Lib.ZERO) || self.short.gt(Fixed6Lib.ZERO);\\n }\\n\\n /// @notice Returns whether the order increases the account's maker position\\n /// @return Whether the order increases the account's maker positions\\n function increasesMaker(Order memory self) internal pure returns (bool) {\\n return self.maker.gt(Fixed6Lib.ZERO);\\n }\\n\\n /// @notice Returns whether the order decreases the liquidity of the market\\n /// @return Whether the order decreases the liquidity of the market\\n function decreasesLiquidity(Order memory self) internal pure returns (bool) {\\n return self.maker.lt(self.net);\\n }\\n\\n /// @notice Returns the whether the position is single-sided\\n /// @param self The position object to check\\n /// @param currentPosition The current position to check\\n /// @return Whether the position is single-sided\\n function singleSided(Order memory self, Position memory currentPosition) internal pure returns (bool) {\\n return (self.maker.isZero() && self.long.isZero() && currentPosition.maker.isZero() && currentPosition.long.isZero()) ||\\n (self.long.isZero() && self.short.isZero() && currentPosition.long.isZero() && currentPosition.short.isZero()) ||\\n (self.short.isZero() && self.maker.isZero() && currentPosition.short.isZero() && currentPosition.maker.isZero());\\n }\\n\\n /// @notice Returns whether the order is applicable for liquidity checks\\n /// @param self The Order object to check\\n /// @param marketParameter The market parameter\\n /// @return Whether the order is applicable for liquidity checks\\n function liquidityCheckApplicable(\\n Order memory self,\\n MarketParameter memory marketParameter\\n ) internal pure returns (bool) {\\n return !marketParameter.closed &&\\n ((self.maker.isZero()) || !marketParameter.makerCloseAlways || increasesMaker(self)) &&\\n ((self.long.isZero() && self.short.isZero()) || !marketParameter.takerCloseAlways || increasesTaker(self));\\n }\\n\\n /// @notice Returns the liquidation fee of the position\\n /// @param self The position object to check\\n /// @param latestVersion The latest oracle version\\n /// @param riskParameter The current risk parameter\\n /// @return The liquidation fee of the position\\n function liquidationFee(\\n Order memory self,\\n OracleVersion memory latestVersion,\\n RiskParameter memory riskParameter\\n ) internal pure returns (UFixed6) {\\n UFixed6 magnitude = self.maker.abs().add(self.long.abs()).add(self.short.abs());\\n if (magnitude.isZero()) return UFixed6Lib.ZERO;\\n\\n UFixed6 partialMaintenance = magnitude.mul(latestVersion.price.abs())\\n .mul(riskParameter.maintenance)\\n .max(riskParameter.minMaintenance);\\n\\n return partialMaintenance.mul(riskParameter.liquidationFee)\\n .min(riskParameter.maxLiquidationFee)\\n .max(riskParameter.minLiquidationFee);\\n }\\n\\n /// @notice Returns whether the order has no position change\\n /// @param self The Order object to check\\n /// @return Whether the order has no position change\\n function isEmpty(Order memory self) internal pure returns (bool) {\\n return self.maker.abs().add(self.long.abs()).add(self.short.abs()).isZero();\\n }\\n}\\n\",\"keccak256\":\"0x4e07807b2ee543360b1721b1c359922313f5b8dcf59d359745f3fac1defbed89\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/Position.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./OracleVersion.sol\\\";\\nimport \\\"./RiskParameter.sol\\\";\\nimport \\\"./Order.sol\\\";\\nimport \\\"./Global.sol\\\";\\nimport \\\"./Local.sol\\\";\\nimport \\\"./Invalidation.sol\\\";\\n\\n/// @dev Order type\\nstruct Position {\\n /// @dev The timestamp of the position\\n uint256 timestamp;\\n\\n /// @dev The maker position size\\n UFixed6 maker;\\n\\n /// @dev The long position size\\n UFixed6 long;\\n\\n /// @dev The short position size\\n UFixed6 short;\\n\\n /// @dev The fee for the position (only used for pending positions)\\n UFixed6 fee;\\n\\n /// @dev The fixed settlement fee for the position (only used for pending positions)\\n UFixed6 keeper;\\n\\n /// @dev The collateral at the time of the position settlement (only used for pending positions)\\n Fixed6 collateral;\\n\\n /// @dev The change in collateral during this position (only used for pending positions)\\n Fixed6 delta;\\n\\n /// @dev The value of the invalidation accumulator at the time of creation\\n Invalidation invalidation;\\n}\\nusing PositionLib for Position global;\\nstruct PositionStorageGlobal { uint256 slot0; uint256 slot1; }\\nusing PositionStorageGlobalLib for PositionStorageGlobal global;\\nstruct PositionStorageLocal { uint256 slot0; uint256 slot1; }\\nusing PositionStorageLocalLib for PositionStorageLocal global;\\n\\n/// @title Position\\n/// @notice Holds the state for a position\\nlibrary PositionLib {\\n /// @notice Returns whether the position is ready to be settled\\n /// @param self The position object to check\\n /// @param latestVersion The latest oracle version\\n /// @return Whether the position is ready to be settled\\n function ready(Position memory self, OracleVersion memory latestVersion) internal pure returns (bool) {\\n return latestVersion.timestamp >= self.timestamp;\\n }\\n\\n /// @notice Replaces the position with the new latest position\\n /// @param self The position object to update\\n /// @param newPosition The new latest position\\n function update(Position memory self, Position memory newPosition) internal pure {\\n (self.timestamp, self.maker, self.long, self.short) = (\\n newPosition.timestamp,\\n newPosition.maker,\\n newPosition.long,\\n newPosition.short\\n );\\n }\\n\\n /// @notice Updates the current local position with a new order\\n /// @param self The position object to update\\n /// @param currentTimestamp The current timestamp\\n /// @param newMaker The new maker position\\n /// @param newLong The new long position\\n /// @param newShort The new short position\\n /// @return newOrder The new order\\n function update(\\n Position memory self,\\n uint256 currentTimestamp,\\n UFixed6 newMaker,\\n UFixed6 newLong,\\n UFixed6 newShort\\n ) internal pure returns (Order memory newOrder) {\\n (newOrder.maker, newOrder.long, newOrder.short) = (\\n Fixed6Lib.from(newMaker).sub(Fixed6Lib.from(self.maker)),\\n Fixed6Lib.from(newLong).sub(Fixed6Lib.from(self.long)),\\n Fixed6Lib.from(newShort).sub(Fixed6Lib.from(self.short))\\n );\\n\\n (self.timestamp, self.maker, self.long, self.short) =\\n (currentTimestamp, newMaker, newLong, newShort);\\n }\\n\\n /// @notice Updates the current global position with a new order\\n /// @param self The position object to update\\n /// @param currentTimestamp The current timestamp\\n /// @param order The new order\\n /// @param riskParameter The current risk parameter\\n function update(\\n Position memory self,\\n uint256 currentTimestamp,\\n Order memory order,\\n RiskParameter memory riskParameter\\n ) internal pure {\\n // load the computed attributes of the latest position\\n Fixed6 latestSkew = virtualSkew(self, riskParameter);\\n (order.net, order.efficiency, order.utilization) =\\n (Fixed6Lib.from(net(self)), Fixed6Lib.from(efficiency(self)), Fixed6Lib.from(utilization(self)));\\n\\n // update the position's attributes\\n (self.timestamp, self.maker, self.long, self.short) = (\\n currentTimestamp,\\n UFixed6Lib.from(Fixed6Lib.from(self.maker).add(order.maker)),\\n UFixed6Lib.from(Fixed6Lib.from(self.long).add(order.long)),\\n UFixed6Lib.from(Fixed6Lib.from(self.short).add(order.short))\\n );\\n\\n // update the order's delta attributes with the positions updated attributes\\n (order.net, order.skew, order.impact, order.efficiency, order.utilization) = (\\n Fixed6Lib.from(net(self)).sub(order.net),\\n virtualSkew(self, riskParameter).sub(latestSkew).abs(),\\n Fixed6Lib.from(virtualSkew(self, riskParameter).abs()).sub(Fixed6Lib.from(latestSkew.abs())),\\n Fixed6Lib.from(efficiency(self)).sub(order.efficiency),\\n Fixed6Lib.from(utilization(self)).sub(order.utilization)\\n );\\n }\\n\\n /// @notice prepares the position for the next id\\n /// @param self The position object to update\\n function prepare(Position memory self) internal pure {\\n self.fee = UFixed6Lib.ZERO;\\n self.keeper = UFixed6Lib.ZERO;\\n self.collateral = Fixed6Lib.ZERO;\\n }\\n\\n /// @notice Updates the collateral delta of the position\\n /// @param self The position object to update\\n /// @param collateralAmount The amount of collateral change that occurred\\n function update(Position memory self, Fixed6 collateralAmount) internal pure {\\n self.delta = self.delta.add(collateralAmount);\\n }\\n\\n /// @notice Processes an invalidation of a position\\n /// @dev Increments the invalidation accumulator by the new position's delta, and resets the fee\\n /// @param self The position object to update\\n /// @param newPosition The latest valid position\\n function invalidate(Position memory self, Position memory newPosition) internal pure {\\n self.invalidation.increment(self, newPosition);\\n (newPosition.maker, newPosition.long, newPosition.short, newPosition.fee) =\\n (self.maker, self.long, self.short, UFixed6Lib.ZERO);\\n }\\n\\n // @notice Adjusts the position if any invalidations have occurred\\n function adjust(Position memory self, Position memory latestPosition) internal pure {\\n Invalidation memory invalidation = latestPosition.invalidation.sub(self.invalidation);\\n (self.maker, self.long, self.short) = (\\n UFixed6Lib.from(Fixed6Lib.from(self.maker).add(invalidation.maker)),\\n UFixed6Lib.from(Fixed6Lib.from(self.long).add(invalidation.long)),\\n UFixed6Lib.from(Fixed6Lib.from(self.short).add(invalidation.short))\\n );\\n }\\n\\n /// @notice Processes a sync of the position\\n /// @dev Moves the timestamp forward to the latest version's timestamp, while resetting the fee and keeper\\n /// @param self The position object to update\\n /// @param latestVersion The latest oracle version\\n function sync(Position memory self, OracleVersion memory latestVersion) internal pure {\\n (self.timestamp, self.fee, self.keeper) = (latestVersion.timestamp, UFixed6Lib.ZERO, UFixed6Lib.ZERO);\\n }\\n\\n /// @notice Registers the fees from a new order\\n /// @param self The position object to update\\n /// @param order The new order\\n function registerFee(Position memory self, Order memory order) internal pure {\\n self.fee = self.fee.add(order.fee);\\n self.keeper = self.keeper.add(order.keeper);\\n }\\n\\n /// @notice Returns the maximum position size\\n /// @param self The position object to check\\n /// @return The maximum position size\\n function magnitude(Position memory self) internal pure returns (UFixed6) {\\n return self.long.max(self.short).max(self.maker);\\n }\\n\\n /// @notice Returns the maximum taker position size\\n /// @param self The position object to check\\n /// @return The maximum taker position size\\n function major(Position memory self) internal pure returns (UFixed6) {\\n return self.long.max(self.short);\\n }\\n\\n /// @notice Returns the minimum maker position size\\n /// @param self The position object to check\\n /// @return The minimum maker position size\\n function minor(Position memory self) internal pure returns (UFixed6) {\\n return self.long.min(self.short);\\n }\\n\\n /// @notice Returns the difference between the long and short positions\\n /// @param self The position object to check\\n /// @return The difference between the long and short positions\\n function net(Position memory self) internal pure returns (UFixed6) {\\n return Fixed6Lib.from(self.long).sub(Fixed6Lib.from(self.short)).abs();\\n }\\n\\n /// @notice Returns the skew of the position\\n /// @dev skew = (long - short) / max(long, short)\\n /// @param self The position object to check\\n /// @return The skew of the position\\n function skew(Position memory self) internal pure returns (Fixed6) {\\n return _skew(self, UFixed6Lib.ZERO);\\n }\\n\\n /// @notice Returns the skew of the position taking into account the virtual taker\\n /// @dev virtual skew = (long - short) / (max(long, short) + virtualTaker)\\n /// @param self The position object to check\\n /// @param riskParameter The current risk parameter\\n /// @return The virtual skew of the position\\n function virtualSkew(Position memory self, RiskParameter memory riskParameter) internal pure returns (Fixed6) {\\n return _skew(self, riskParameter.virtualTaker);\\n }\\n\\n /// @notice Returns the skew of the position taking into account position socialization\\n /// @dev Used to calculate the portion of the position that is covered by the maker\\n /// @param self The position object to check\\n /// @return The socialized skew of the position\\n function socializedSkew(Position memory self) internal pure returns (UFixed6) {\\n return takerSocialized(self).isZero() ?\\n UFixed6Lib.ZERO :\\n takerSocialized(self).sub(minor(self)).div(takerSocialized(self));\\n }\\n\\n /// @notice Helper function to return the skew of the position with an optional virtual taker\\n /// @param self The position object to check\\n /// @param virtualTaker The virtual taker to use in the calculation\\n /// @return The virtual skew of the position\\n function _skew(Position memory self, UFixed6 virtualTaker) internal pure returns (Fixed6) {\\n return major(self).isZero() ?\\n Fixed6Lib.ZERO :\\n Fixed6Lib.from(self.long)\\n .sub(Fixed6Lib.from(self.short))\\n .div(Fixed6Lib.from(major(self).add(virtualTaker)));\\n }\\n\\n /// @notice Returns the utilization of the position\\n /// @dev utilization = major / (maker + minor)\\n /// @param self The position object to check\\n /// @return The utilization of the position\\n function utilization(Position memory self) internal pure returns (UFixed6) {\\n return major(self).unsafeDiv(self.maker.add(minor(self))).min(UFixed6Lib.ONE);\\n }\\n\\n /// @notice Returns the long position with socialization taken into account\\n /// @param self The position object to check\\n /// @return The long position with socialization taken into account\\n function longSocialized(Position memory self) internal pure returns (UFixed6) {\\n return self.maker.add(self.short).min(self.long);\\n }\\n\\n /// @notice Returns the short position with socialization taken into account\\n /// @param self The position object to check\\n /// @return The short position with socialization taken into account\\n function shortSocialized(Position memory self) internal pure returns (UFixed6) {\\n return self.maker.add(self.long).min(self.short);\\n }\\n\\n /// @notice Returns the major position with socialization taken into account\\n /// @param self The position object to check\\n /// @return The major position with socialization taken into account\\n function takerSocialized(Position memory self) internal pure returns (UFixed6) {\\n return major(self).min(minor(self).add(self.maker));\\n }\\n\\n /// @notice Returns the efficiency of the position\\n /// @dev efficiency = maker / major\\n /// @param self The position object to check\\n /// @return The efficiency of the position\\n function efficiency(Position memory self) internal pure returns (UFixed6) {\\n return self.maker.unsafeDiv(major(self)).min(UFixed6Lib.ONE);\\n }\\n\\n /// @notice Returns the whether the position is socialized\\n /// @param self The position object to check\\n /// @return Whether the position is socialized\\n function socialized(Position memory self) internal pure returns (bool) {\\n return self.maker.add(self.short).lt(self.long) || self.maker.add(self.long).lt(self.short);\\n }\\n\\n /// @notice Returns the maintenance requirement of the position\\n /// @param self The position object to check\\n /// @param latestVersion The latest oracle version\\n /// @param riskParameter The current risk parameter\\n /// @return The maintenance requirement of the position\\n function maintenance(\\n Position memory self,\\n OracleVersion memory latestVersion,\\n RiskParameter memory riskParameter\\n ) internal pure returns (UFixed6) {\\n return _collateralRequirement(self, latestVersion, riskParameter.maintenance, riskParameter.minMaintenance);\\n }\\n\\n /// @notice Returns the margin requirement of the position\\n /// @param self The position object to check\\n /// @param latestVersion The latest oracle version\\n /// @param riskParameter The current risk parameter\\n /// @return The margin requirement of the position\\n function margin(\\n Position memory self,\\n OracleVersion memory latestVersion,\\n RiskParameter memory riskParameter\\n ) internal pure returns (UFixed6) {\\n return _collateralRequirement(self, latestVersion, riskParameter.margin, riskParameter.minMargin);\\n }\\n\\n function _collateralRequirement(\\n Position memory self,\\n OracleVersion memory latestVersion,\\n UFixed6 requirementRatio,\\n UFixed6 requirementFixed\\n ) private pure returns (UFixed6) {\\n if (magnitude(self).isZero()) return UFixed6Lib.ZERO;\\n return magnitude(self).mul(latestVersion.price.abs()).mul(requirementRatio).max(requirementFixed);\\n }\\n\\n /// @notice Returns the whether the position is maintained\\n /// @dev shortfall is considered solvent for 0-position\\n /// @param self The position object to check\\n /// @param latestVersion The latest oracle version\\n /// @param riskParameter The current risk parameter\\n /// @param collateral The current account's collateral\\n /// @return Whether the position is maintained\\n function maintained(\\n Position memory self,\\n OracleVersion memory latestVersion,\\n RiskParameter memory riskParameter,\\n Fixed6 collateral\\n ) internal pure returns (bool) {\\n return collateral.max(Fixed6Lib.ZERO).gte(Fixed6Lib.from(maintenance(self, latestVersion, riskParameter)));\\n }\\n\\n /// @notice Returns the whether the position is margined\\n /// @dev shortfall is considered solvent for 0-position\\n /// @param self The position object to check\\n /// @param latestVersion The latest oracle version\\n /// @param riskParameter The current risk parameter\\n /// @param collateral The current account's collateral\\n /// @return Whether the position is margined\\n function margined(\\n Position memory self,\\n OracleVersion memory latestVersion,\\n RiskParameter memory riskParameter,\\n Fixed6 collateral\\n ) internal pure returns (bool) {\\n return collateral.max(Fixed6Lib.ZERO).gte(Fixed6Lib.from(margin(self, latestVersion, riskParameter)));\\n }\\n}\\n\\n/// @dev Manually encodes and decodes the global Position struct into storage.\\n///\\n/// struct StoredPositionGlobal {\\n/// /* slot 0 */\\n/// uint32 timestamp;\\n/// uint48 fee;\\n/// uint48 keeper;\\n/// uint64 long;\\n/// uint64 short;\\n///\\n/// /* slot 1 */\\n/// uint64 maker;\\n/// int64 invalidation.maker;\\n/// int64 invalidation.long;\\n/// int64 invalidation.short;\\n/// }\\n///\\nlibrary PositionStorageGlobalLib {\\n function read(PositionStorageGlobal storage self) internal view returns (Position memory) {\\n (uint256 slot0, uint256 slot1) = (self.slot0, self.slot1);\\n return Position(\\n uint256(slot0 << (256 - 32)) >> (256 - 32),\\n UFixed6.wrap(uint256(slot1 << (256 - 64)) >> (256 - 64)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 48 - 48 - 64)) >> (256 - 64)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 48 - 48 - 64 - 64)) >> (256 - 64)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 48 - 48)) >> (256 - 48)),\\n Fixed6Lib.ZERO,\\n Fixed6Lib.ZERO,\\n Invalidation(\\n Fixed6.wrap(int256(slot1 << (256 - 64 - 64)) >> (256 - 64)),\\n Fixed6.wrap(int256(slot1 << (256 - 64 - 64 - 64)) >> (256 - 64)),\\n Fixed6.wrap(int256(slot1 << (256 - 64 - 64 - 64 - 64)) >> (256 - 64))\\n )\\n );\\n }\\n\\n function store(PositionStorageGlobal storage self, Position memory newValue) internal {\\n PositionStorageLib.validate(newValue);\\n\\n if (newValue.maker.gt(UFixed6.wrap(type(uint64).max))) revert PositionStorageLib.PositionStorageInvalidError();\\n if (newValue.long.gt(UFixed6.wrap(type(uint64).max))) revert PositionStorageLib.PositionStorageInvalidError();\\n if (newValue.short.gt(UFixed6.wrap(type(uint64).max))) revert PositionStorageLib.PositionStorageInvalidError();\\n\\n uint256 encoded0 =\\n uint256(newValue.timestamp << (256 - 32)) >> (256 - 32) |\\n uint256(UFixed6.unwrap(newValue.fee) << (256 - 48)) >> (256 - 32 - 48) |\\n uint256(UFixed6.unwrap(newValue.keeper) << (256 - 48)) >> (256 - 32 - 48 - 48) |\\n uint256(UFixed6.unwrap(newValue.long) << (256 - 64)) >> (256 - 32 - 48 - 48 - 64) |\\n uint256(UFixed6.unwrap(newValue.short) << (256 - 64)) >> (256 - 32 - 48 - 48 - 64 - 64);\\n uint256 encoded1 =\\n uint256(UFixed6.unwrap(newValue.maker) << (256 - 64)) >> (256 - 64) |\\n uint256(Fixed6.unwrap(newValue.invalidation.maker) << (256 - 64)) >> (256 - 64 - 64) |\\n uint256(Fixed6.unwrap(newValue.invalidation.long) << (256 - 64)) >> (256 - 64 - 64 - 64) |\\n uint256(Fixed6.unwrap(newValue.invalidation.short) << (256 - 64)) >> (256 - 64 - 64 - 64 - 64);\\n\\n\\n assembly {\\n sstore(self.slot, encoded0)\\n sstore(add(self.slot, 1), encoded1)\\n }\\n }\\n}\\n\\n/// @dev Manually encodes and decodes the local Position struct into storage.\\n///\\n/// struct StoredPositionLocal {\\n/// /* slot 0 */\\n/// uint32 timestamp;\\n/// uint48 fee;\\n/// uint48 keeper;\\n/// int64 collateral;\\n/// int64 delta;\\n///\\n/// /* slot 1 */\\n/// uint2 direction;\\n/// uint62 magnitude;\\n/// int64 invalidation.maker;\\n/// int64 invalidation.long;\\n/// int64 invalidation.short;\\n/// }\\n///\\nlibrary PositionStorageLocalLib {\\n function read(PositionStorageLocal storage self) internal view returns (Position memory) {\\n (uint256 slot0, uint256 slot1) = (self.slot0, self.slot1);\\n\\n uint256 direction = uint256(slot1 << (256 - 2)) >> (256 - 2);\\n UFixed6 magnitude = UFixed6.wrap(uint256(slot1 << (256 - 2 - 62)) >> (256 - 62));\\n\\n return Position(\\n uint256(slot0 << (256 - 32)) >> (256 - 32),\\n direction == 0 ? magnitude : UFixed6Lib.ZERO,\\n direction == 1 ? magnitude : UFixed6Lib.ZERO,\\n direction == 2 ? magnitude : UFixed6Lib.ZERO,\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256(slot0 << (256 - 32 - 48 - 48)) >> (256 - 48)),\\n Fixed6.wrap(int256(slot0 << (256 - 32 - 48 - 48 - 64)) >> (256 - 64)),\\n Fixed6.wrap(int256(slot0 << (256 - 32 - 48 - 48 - 64 - 64)) >> (256 - 64)),\\n Invalidation(\\n Fixed6.wrap(int256(slot1 << (256 - 2 - 62 - 64)) >> (256 - 64)),\\n Fixed6.wrap(int256(slot1 << (256 - 2 - 62 - 64 - 64)) >> (256 - 64)),\\n Fixed6.wrap(int256(slot1 << (256 - 2 - 62 - 64 - 64 - 64)) >> (256 - 64))\\n )\\n );\\n }\\n\\n function store(PositionStorageLocal storage self, Position memory newValue) internal {\\n PositionStorageLib.validate(newValue);\\n\\n if (newValue.maker.gt(UFixed6.wrap(2 ** 62 - 1))) revert PositionStorageLib.PositionStorageInvalidError();\\n if (newValue.long.gt(UFixed6.wrap(2 ** 62 - 1))) revert PositionStorageLib.PositionStorageInvalidError();\\n if (newValue.short.gt(UFixed6.wrap(2 ** 62 - 1))) revert PositionStorageLib.PositionStorageInvalidError();\\n\\n uint256 direction = newValue.long.isZero() ? (newValue.short.isZero() ? 0 : 2) : 1;\\n\\n uint256 encoded0 =\\n uint256(newValue.timestamp << (256 - 32)) >> (256 - 32) |\\n uint256(UFixed6.unwrap(newValue.fee) << (256 - 48)) >> (256 - 32 - 48) |\\n uint256(UFixed6.unwrap(newValue.keeper) << (256 - 48)) >> (256 - 32 - 48 - 48) |\\n uint256(Fixed6.unwrap(newValue.collateral) << (256 - 64)) >> (256 - 32 - 48 - 48 - 64) |\\n uint256(Fixed6.unwrap(newValue.delta) << (256 - 64)) >> (256 - 32 - 48 - 48 - 64 - 64);\\n uint256 encoded1 =\\n uint256(direction << (256 - 2)) >> (256 - 2) |\\n uint256(UFixed6.unwrap(newValue.magnitude()) << (256 - 62)) >> (256 - 2 - 62) |\\n uint256(Fixed6.unwrap(newValue.invalidation.maker) << (256 - 64)) >> (256 - 2 - 62 - 64) |\\n uint256(Fixed6.unwrap(newValue.invalidation.long) << (256 - 64)) >> (256 - 2 - 62 - 64 - 64) |\\n uint256(Fixed6.unwrap(newValue.invalidation.short) << (256 - 64)) >> (256 - 2 - 62 - 64 - 64 - 64);\\n\\n assembly {\\n sstore(self.slot, encoded0)\\n sstore(add(self.slot, 1), encoded1)\\n }\\n }\\n}\\n\\nlibrary PositionStorageLib {\\n // sig: 0x52a8a97f\\n error PositionStorageInvalidError();\\n\\n function validate(Position memory newValue) internal pure {\\n if (newValue.timestamp > type(uint32).max) revert PositionStorageInvalidError();\\n if (newValue.fee.gt(UFixed6.wrap(type(uint48).max))) revert PositionStorageInvalidError();\\n if (newValue.keeper.gt(UFixed6.wrap(type(uint48).max))) revert PositionStorageInvalidError();\\n if (newValue.collateral.gt(Fixed6.wrap(type(int64).max))) revert PositionStorageInvalidError();\\n if (newValue.collateral.lt(Fixed6.wrap(type(int64).min))) revert PositionStorageInvalidError();\\n if (newValue.delta.gt(Fixed6.wrap(type(int64).max))) revert PositionStorageInvalidError();\\n if (newValue.delta.lt(Fixed6.wrap(type(int64).min))) revert PositionStorageInvalidError();\\n if (newValue.invalidation.maker.gt(Fixed6.wrap(type(int64).max))) revert PositionStorageInvalidError();\\n if (newValue.invalidation.maker.lt(Fixed6.wrap(type(int64).min))) revert PositionStorageInvalidError();\\n if (newValue.invalidation.long.gt(Fixed6.wrap(type(int64).max))) revert PositionStorageInvalidError();\\n if (newValue.invalidation.long.lt(Fixed6.wrap(type(int64).min))) revert PositionStorageInvalidError();\\n if (newValue.invalidation.short.gt(Fixed6.wrap(type(int64).max))) revert PositionStorageInvalidError();\\n if (newValue.invalidation.short.lt(Fixed6.wrap(type(int64).min))) revert PositionStorageInvalidError();\\n }\\n}\",\"keccak256\":\"0x3b9a7acd0b895d44223394be8f21a235da9a47ff6fd2a05ed37624d82df2bbd1\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/ProtocolParameter.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/number/types/UFixed6.sol\\\";\\n\\n/// @dev ProtocolParameter type\\nstruct ProtocolParameter {\\n /// @dev The share of the market fees that are retained by the protocol before being distributed\\n UFixed6 protocolFee;\\n\\n /// @dev The maximum for market fee parameters\\n UFixed6 maxFee;\\n\\n /// @dev The maximum for market absolute fee parameters\\n UFixed6 maxFeeAbsolute;\\n\\n /// @dev The maximum for market cut parameters\\n UFixed6 maxCut;\\n\\n /// @dev The maximum for market rate parameters\\n UFixed6 maxRate;\\n\\n /// @dev The minimum for market maintenance parameters\\n UFixed6 minMaintenance;\\n\\n /// @dev The minimum for market efficiency parameters\\n UFixed6 minEfficiency;\\n}\\nstruct StoredProtocolParameter {\\n /* slot 0 */\\n uint24 protocolFee; // <= 1677%\\n uint24 maxFee; // <= 1677%\\n uint48 maxFeeAbsolute; // <= 281m\\n uint24 maxCut; // <= 1677%\\n uint32 maxRate; // <= 429496%\\n uint24 minMaintenance; // <= 1677%\\n uint24 minEfficiency; // <= 1677%\\n}\\nstruct ProtocolParameterStorage { StoredProtocolParameter value; }\\nusing ProtocolParameterStorageLib for ProtocolParameterStorage global;\\n\\nlibrary ProtocolParameterStorageLib {\\n // sig: 0x4dc1bc59\\n error ProtocolParameterStorageInvalidError();\\n\\n function read(ProtocolParameterStorage storage self) internal view returns (ProtocolParameter memory) {\\n StoredProtocolParameter memory value = self.value;\\n return ProtocolParameter(\\n UFixed6.wrap(uint256(value.protocolFee)),\\n UFixed6.wrap(uint256(value.maxFee)),\\n UFixed6.wrap(uint256(value.maxFeeAbsolute)),\\n UFixed6.wrap(uint256(value.maxCut)),\\n UFixed6.wrap(uint256(value.maxRate)),\\n UFixed6.wrap(uint256(value.minMaintenance)),\\n UFixed6.wrap(uint256(value.minEfficiency))\\n );\\n }\\n\\n function validate(ProtocolParameter memory self) internal pure {\\n if (self.protocolFee.gt(self.maxCut)) revert ProtocolParameterStorageInvalidError();\\n if (self.maxCut.gt(UFixed6Lib.ONE)) revert ProtocolParameterStorageInvalidError();\\n }\\n\\n function validateAndStore(ProtocolParameterStorage storage self, ProtocolParameter memory newValue) internal {\\n validate(newValue);\\n\\n if (newValue.maxFee.gt(UFixed6.wrap(type(uint24).max))) revert ProtocolParameterStorageInvalidError();\\n if (newValue.maxFeeAbsolute.gt(UFixed6.wrap(type(uint48).max))) revert ProtocolParameterStorageInvalidError();\\n if (newValue.maxRate.gt(UFixed6.wrap(type(uint32).max))) revert ProtocolParameterStorageInvalidError();\\n if (newValue.minMaintenance.gt(UFixed6.wrap(type(uint24).max))) revert ProtocolParameterStorageInvalidError();\\n if (newValue.minEfficiency.gt(UFixed6.wrap(type(uint24).max))) revert ProtocolParameterStorageInvalidError();\\n\\n self.value = StoredProtocolParameter(\\n uint24(UFixed6.unwrap(newValue.protocolFee)),\\n uint24(UFixed6.unwrap(newValue.maxFee)),\\n uint48(UFixed6.unwrap(newValue.maxFeeAbsolute)),\\n uint24(UFixed6.unwrap(newValue.maxCut)),\\n uint32(UFixed6.unwrap(newValue.maxRate)),\\n uint24(UFixed6.unwrap(newValue.minMaintenance)),\\n uint24(UFixed6.unwrap(newValue.minEfficiency))\\n );\\n }\\n}\",\"keccak256\":\"0x1421f24c2a0098bf570ce1c6cfc2dff6e7a28376154cab4552dd32a651c27e0b\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/RiskParameter.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/number/types/UFixed6.sol\\\";\\nimport \\\"@equilibria/root/utilization/types/UJumpRateUtilizationCurve6.sol\\\";\\nimport \\\"@equilibria/root/pid/types/PController6.sol\\\";\\nimport \\\"../interfaces/IOracleProvider.sol\\\";\\nimport \\\"../interfaces/IPayoffProvider.sol\\\";\\nimport \\\"./ProtocolParameter.sol\\\";\\n\\n/// @dev RiskParameter type\\nstruct RiskParameter {\\n /// @dev The minimum amount of collateral required to open a new position as a percentage of notional\\n UFixed6 margin;\\n\\n /// @dev The minimum amount of collateral that must be maintained as a percentage of notional\\n UFixed6 maintenance;\\n\\n /// @dev The percentage fee on the notional that is charged when a long or short position is open or closed\\n UFixed6 takerFee;\\n\\n /// @dev The additional percentage that is added scaled by the change in skew\\n UFixed6 takerSkewFee;\\n\\n /// @dev The additional percentage that is added scaled by the change in impact\\n UFixed6 takerImpactFee;\\n\\n /// @dev The percentage fee on the notional that is charged when a maker position is open or closed\\n UFixed6 makerFee;\\n\\n /// @dev The additional percentage that is added scaled by the change in utilization\\n UFixed6 makerImpactFee;\\n\\n /// @dev The maximum amount of maker positions that opened\\n UFixed6 makerLimit;\\n\\n /// @dev The minimum limit of the efficiency metric\\n UFixed6 efficiencyLimit;\\n\\n /// @dev The percentage fee on the notional that is charged when a position is liquidated\\n UFixed6 liquidationFee;\\n\\n /// @dev The minimum fixed amount that is charged when a position is liquidated\\n UFixed6 minLiquidationFee;\\n\\n /// @dev The maximum fixed amount that is charged when a position is liquidated\\n UFixed6 maxLiquidationFee;\\n\\n /// @dev The utilization curve that is used to compute maker interest\\n UJumpRateUtilizationCurve6 utilizationCurve;\\n\\n /// @dev The p controller that is used to compute long-short funding\\n PController6 pController;\\n\\n /// @dev The minimum fixed amount that is required to open a position\\n UFixed6 minMargin;\\n\\n /// @dev The minimum fixed amount that is required for maintenance\\n UFixed6 minMaintenance;\\n\\n /// @dev A virtual amount that is added to long and short for the purposes of skew calculation\\n UFixed6 virtualTaker;\\n\\n /// @dev The maximum amount of time since the latest oracle version that update may still be called\\n uint256 staleAfter;\\n\\n /// @dev Whether or not the maker should always receive positive funding\\n bool makerReceiveOnly;\\n}\\nstruct RiskParameterStorage { uint256 slot0; uint256 slot1; uint256 slot2; }\\nusing RiskParameterStorageLib for RiskParameterStorage global;\\n\\n// struct StoredRiskParameter {\\n// /* slot 0 */\\n// uint24 margin; // <= 1677%\\n// uint24 maintenance; // <= 1677%\\n// uint24 takerFee; // <= 1677%\\n// uint24 takerSkewFee; // <= 1677%\\n// uint24 takerImpactFee; // <= 1677%\\n// uint24 makerFee; // <= 1677%\\n// uint24 makerImpactFee; // <= 1677%\\n// uint64 makerLimit; // <= 18.44t\\n// uint24 efficiencyLimit; // <= 1677%\\n//\\n// /* slot 1 */\\n// uint24 liquidationFee; // <= 1677%\\n// uint48 minLiquidationFee; // <= 281mn\\n// uint64 virtualTaker; // <= 18.44t\\n// uint32 utilizationCurveMinRate; // <= 214748%\\n// uint32 utilizationCurveMaxRate; // <= 214748%\\n// uint32 utilizationCurveTargetRate; // <= 214748%\\n// uint24 utilizationCurveTargetUtilization; // <= 1677%\\n//\\n// /* slot 2 */\\n// uint48 pControllerK; // <= 281m\\n// uint32 pControllerMax; // <= 214748%\\n// uint48 minMargin; // <= 281m\\n// uint48 minMaintenance; // <= 281m\\n// uint48 maxLiquidationFee; // <= 281mn\\n// uint24 staleAfter; // <= 16m s\\n// bool makerReceiveOnly;\\n// }\\nlibrary RiskParameterStorageLib {\\n // sig: 0x7ecd083f\\n error RiskParameterStorageInvalidError();\\n\\n function read(RiskParameterStorage storage self) external view returns (RiskParameter memory) {\\n (uint256 slot0, uint256 slot1, uint256 slot2) = (self.slot0, self.slot1, self.slot2);\\n return RiskParameter(\\n UFixed6.wrap(uint256( slot0 << (256 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 24 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 24 - 24 - 64)) >> (256 - 64)),\\n UFixed6.wrap(uint256( slot0 << (256 - 24 - 24 - 24 - 24 - 24 - 24 - 24 - 64 - 24)) >> (256 - 24)),\\n\\n UFixed6.wrap(uint256( slot1 << (256 - 24)) >> (256 - 24)),\\n UFixed6.wrap(uint256( slot1 << (256 - 24 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256( slot2 << (256 - 48 - 32 - 48 - 48 - 48)) >> (256 - 48)),\\n UJumpRateUtilizationCurve6(\\n UFixed6.wrap(uint256( slot1 << (256 - 24 - 48 - 64 - 32)) >> (256 - 32)),\\n UFixed6.wrap(uint256( slot1 << (256 - 24 - 48 - 64 - 32 - 32)) >> (256 - 32)),\\n UFixed6.wrap(uint256( slot1 << (256 - 24 - 48 - 64 - 32 - 32 - 32)) >> (256 - 32)),\\n UFixed6.wrap(uint256( slot1 << (256 - 24 - 48 - 64 - 32 - 32 - 32 - 24)) >> (256 - 24))\\n ),\\n\\n PController6(\\n UFixed6.wrap(uint256( slot2 << (256 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256( slot2 << (256 - 48 - 32)) >> (256 - 32))\\n ),\\n UFixed6.wrap(uint256( slot2 << (256 - 48 - 32 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256( slot2 << (256 - 48 - 32 - 48 - 48)) >> (256 - 48)),\\n UFixed6.wrap(uint256( slot1 << (256 - 24 - 48 - 64)) >> (256 - 64)),\\n uint256( slot2 << (256 - 48 - 32 - 48 - 48 - 48 - 24)) >> (256 - 24),\\n 0 != (uint256( slot2 << (256 - 48 - 32 - 48 - 48 - 48 - 24 - 8)) >> (256 - 8))\\n );\\n }\\n\\n function validate(RiskParameter memory self, ProtocolParameter memory protocolParameter) public pure {\\n if (\\n self.takerFee.max(self.takerSkewFee).max(self.takerImpactFee).max(self.makerFee).max(self.makerImpactFee)\\n .gt(protocolParameter.maxFee)\\n ) revert RiskParameterStorageInvalidError();\\n\\n if (\\n self.minLiquidationFee.max(self.maxLiquidationFee).max(self.minMargin).max(self.minMaintenance)\\n .gt(protocolParameter.maxFeeAbsolute)\\n ) revert RiskParameterStorageInvalidError();\\n\\n if (self.liquidationFee.gt(protocolParameter.maxCut)) revert RiskParameterStorageInvalidError();\\n\\n if (\\n self.utilizationCurve.minRate.max(self.utilizationCurve.maxRate).max(self.utilizationCurve.targetRate).max(self.pController.max)\\n .gt(protocolParameter.maxRate)\\n ) revert RiskParameterStorageInvalidError();\\n\\n if (self.maintenance.lt(protocolParameter.minMaintenance)) revert RiskParameterStorageInvalidError();\\n\\n if (self.margin.lt(self.maintenance)) revert RiskParameterStorageInvalidError();\\n\\n if (self.efficiencyLimit.lt(protocolParameter.minEfficiency)) revert RiskParameterStorageInvalidError();\\n\\n if (self.utilizationCurve.targetUtilization.gt(UFixed6Lib.ONE)) revert RiskParameterStorageInvalidError();\\n\\n if (self.minMaintenance.lt(self.minLiquidationFee)) revert RiskParameterStorageInvalidError();\\n\\n if (self.minMargin.lt(self.minMaintenance)) revert RiskParameterStorageInvalidError();\\n }\\n\\n function validateAndStore(\\n RiskParameterStorage storage self,\\n RiskParameter memory newValue,\\n ProtocolParameter memory protocolParameter\\n ) external {\\n validate(newValue, protocolParameter);\\n\\n if (newValue.margin.gt(UFixed6.wrap(type(uint24).max))) revert RiskParameterStorageInvalidError();\\n if (newValue.efficiencyLimit.gt(UFixed6.wrap(type(uint24).max))) revert RiskParameterStorageInvalidError();\\n if (newValue.makerLimit.gt(UFixed6.wrap(type(uint64).max))) revert RiskParameterStorageInvalidError();\\n if (newValue.pController.k.gt(UFixed6.wrap(type(uint48).max))) revert RiskParameterStorageInvalidError();\\n if (newValue.virtualTaker.gt(UFixed6.wrap(type(uint64).max))) revert RiskParameterStorageInvalidError();\\n if (newValue.staleAfter > uint256(type(uint24).max)) revert RiskParameterStorageInvalidError();\\n\\n uint256 encoded0 =\\n uint256(UFixed6.unwrap(newValue.margin) << (256 - 24)) >> (256 - 24) |\\n uint256(UFixed6.unwrap(newValue.maintenance) << (256 - 24)) >> (256 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.takerFee) << (256 - 24)) >> (256 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.takerSkewFee) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.takerImpactFee) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.makerFee) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.makerImpactFee) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24 - 24 - 24 - 24) |\\n uint256(UFixed6.unwrap(newValue.makerLimit) << (256 - 64)) >> (256 - 24 - 24 - 24 - 24 - 24 - 24 - 24 - 64) |\\n uint256(UFixed6.unwrap(newValue.efficiencyLimit) << (256 - 24)) >> (256 - 24 - 24 - 24 - 24 - 24 - 24 - 24 - 64 - 24);\\n\\n uint256 encoded1 =\\n uint256(UFixed6.unwrap(newValue.liquidationFee) << (256 - 24)) >> (256 - 24) |\\n uint256(UFixed6.unwrap(newValue.minLiquidationFee) << (256 - 48)) >> (256 - 24 - 48) |\\n uint256(UFixed6.unwrap(newValue.virtualTaker) << (256 - 64)) >> (256 - 24 - 48 - 64) |\\n uint256(UFixed6.unwrap(newValue.utilizationCurve.minRate) << (256 - 32)) >> (256 - 24 - 48 - 64 - 32) |\\n uint256(UFixed6.unwrap(newValue.utilizationCurve.maxRate) << (256 - 32)) >> (256 - 24 - 48 - 64 - 32 - 32) |\\n uint256(UFixed6.unwrap(newValue.utilizationCurve.targetRate) << (256 - 32)) >> (256 - 24 - 48 - 64 - 32 - 32 - 32) |\\n uint256(UFixed6.unwrap(newValue.utilizationCurve.targetUtilization) << (256 - 24)) >> (256 - 24 - 48 - 64 - 32 - 32 - 32 - 24);\\n\\n uint256 encoded2 =\\n uint256(UFixed6.unwrap(newValue.pController.k) << (256 - 48)) >> (256 - 48) |\\n uint256(UFixed6.unwrap(newValue.pController.max) << (256 - 32)) >> (256 - 48 - 32) |\\n uint256(UFixed6.unwrap(newValue.minMargin) << (256 - 48)) >> (256 - 48 - 32 - 48) |\\n uint256(UFixed6.unwrap(newValue.minMaintenance) << (256 - 48)) >> (256 - 48 - 32 - 48 - 48) |\\n uint256(UFixed6.unwrap(newValue.maxLiquidationFee) << (256 - 48)) >> (256 - 48 - 32 - 48 - 48 - 48) |\\n uint256(newValue.staleAfter << (256 - 24)) >> (256 - 48 - 32 - 48 - 48 - 48 - 24) |\\n uint256((newValue.makerReceiveOnly ? uint256(1) : uint256(0)) << (256 - 8)) >> (256 - 48 - 32 - 48 - 48 - 48 - 24 - 8);\\n\\n assembly {\\n sstore(self.slot, encoded0)\\n sstore(add(self.slot, 1), encoded1)\\n sstore(add(self.slot, 2), encoded2)\\n }\\n }\\n}\",\"keccak256\":\"0xcd781aae5e2eb9c76a4162198b208df7b274aa18cf7115c4e8b2bb152e5e456b\",\"license\":\"Apache-2.0\"},\"@equilibria/perennial-v2/contracts/types/Version.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@equilibria/root/accumulator/types/Accumulator6.sol\\\";\\nimport \\\"@equilibria/root/accumulator/types/UAccumulator6.sol\\\";\\nimport \\\"./ProtocolParameter.sol\\\";\\nimport \\\"./MarketParameter.sol\\\";\\nimport \\\"./RiskParameter.sol\\\";\\nimport \\\"./Global.sol\\\";\\nimport \\\"./Position.sol\\\";\\n\\n/// @dev Version type\\nstruct Version {\\n /// @dev whether this version had a valid oracle price\\n bool valid;\\n\\n /// @dev The maker accumulator value\\n Accumulator6 makerValue;\\n\\n /// @dev The long accumulator value\\n Accumulator6 longValue;\\n\\n /// @dev The short accumulator value\\n Accumulator6 shortValue;\\n\\n /// @dev The maker reward accumulator value\\n UAccumulator6 makerReward;\\n\\n /// @dev The long reward accumulator value\\n UAccumulator6 longReward;\\n\\n /// @dev The short reward accumulator value\\n UAccumulator6 shortReward;\\n}\\nusing VersionLib for Version global;\\nstruct VersionStorage { uint256 slot0; uint256 slot1; }\\nusing VersionStorageLib for VersionStorage global;\\n\\n/// @dev Individual accumulation values\\nstruct VersionAccumulationResult {\\n UFixed6 positionFeeMaker;\\n UFixed6 positionFeeFee;\\n\\n Fixed6 fundingMaker;\\n Fixed6 fundingLong;\\n Fixed6 fundingShort;\\n UFixed6 fundingFee;\\n\\n Fixed6 interestMaker;\\n Fixed6 interestLong;\\n Fixed6 interestShort;\\n UFixed6 interestFee;\\n\\n Fixed6 pnlMaker;\\n Fixed6 pnlLong;\\n Fixed6 pnlShort;\\n\\n UFixed6 rewardMaker;\\n UFixed6 rewardLong;\\n UFixed6 rewardShort;\\n}\\n\\n///@title Version\\n/// @notice Library that manages global versioned accumulator state.\\n/// @dev Manages two accumulators: value and reward. The value accumulator measures the change in position value\\n/// over time, while the reward accumulator measures the change in position ownership over time.\\nlibrary VersionLib {\\n /// @notice Accumulates the global state for the period from `fromVersion` to `toOracleVersion`\\n /// @param self The Version object to update\\n /// @param global The global state\\n /// @param fromPosition The previous latest position\\n /// @param toPosition The next latest position\\n /// @param fromOracleVersion The previous latest oracle version\\n /// @param toOracleVersion The next latest oracle version\\n /// @param marketParameter The market parameter\\n /// @param riskParameter The risk parameter\\n /// @return values The accumulation result\\n /// @return totalFee The total fee accumulated\\n function accumulate(\\n Version memory self,\\n Global memory global,\\n Position memory fromPosition,\\n Position memory toPosition,\\n OracleVersion memory fromOracleVersion,\\n OracleVersion memory toOracleVersion,\\n MarketParameter memory marketParameter,\\n RiskParameter memory riskParameter\\n ) internal pure returns (VersionAccumulationResult memory values, UFixed6 totalFee) {\\n // record validity\\n self.valid = toOracleVersion.valid;\\n\\n // accumulate position fee\\n (values.positionFeeMaker, values.positionFeeFee) =\\n _accumulatePositionFee(self, fromPosition, toPosition, marketParameter);\\n\\n // if closed, don't accrue anything else\\n if (marketParameter.closed) return (values, values.positionFeeFee);\\n\\n // accumulate funding\\n _FundingValues memory fundingValues = _accumulateFunding(\\n self,\\n global,\\n fromPosition,\\n toPosition,\\n fromOracleVersion,\\n toOracleVersion,\\n marketParameter,\\n riskParameter\\n );\\n (values.fundingMaker, values.fundingLong, values.fundingShort, values.fundingFee) = (\\n fundingValues.fundingMaker,\\n fundingValues.fundingLong,\\n fundingValues.fundingShort,\\n fundingValues.fundingFee\\n );\\n\\n // accumulate interest\\n (values.interestMaker, values.interestLong, values.interestShort, values.interestFee) =\\n _accumulateInterest(self, fromPosition, fromOracleVersion, toOracleVersion, marketParameter, riskParameter);\\n\\n // accumulate P&L\\n (values.pnlMaker, values.pnlLong, values.pnlShort) =\\n _accumulatePNL(self, fromPosition, fromOracleVersion, toOracleVersion);\\n\\n // accumulate reward\\n (values.rewardMaker, values.rewardLong, values.rewardShort) =\\n _accumulateReward(self, fromPosition, fromOracleVersion, toOracleVersion, marketParameter);\\n\\n return (values, values.positionFeeFee.add(values.fundingFee).add(values.interestFee));\\n }\\n\\n /// @notice Globally accumulates position fees since last oracle update\\n /// @param self The Version object to update\\n /// @param fromPosition The previous latest position\\n /// @param toPosition The next latest position\\n /// @param marketParameter The market parameter\\n /// @return positionFeeMaker The maker's position fee\\n /// @return positionFeeFee The protocol's position fee\\n function _accumulatePositionFee(\\n Version memory self,\\n Position memory fromPosition,\\n Position memory toPosition,\\n MarketParameter memory marketParameter\\n ) private pure returns (UFixed6 positionFeeMaker, UFixed6 positionFeeFee) {\\n // If there are no makers to distribute the taker's position fee to, give it to the protocol\\n if (fromPosition.maker.isZero()) return (UFixed6Lib.ZERO, toPosition.fee);\\n\\n positionFeeFee = marketParameter.positionFee.mul(toPosition.fee);\\n positionFeeMaker = toPosition.fee.sub(positionFeeFee);\\n\\n self.makerValue.increment(Fixed6Lib.from(positionFeeMaker), fromPosition.maker);\\n }\\n\\n /// @dev Internal struct to bypass stack depth limit\\n struct _FundingValues {\\n Fixed6 fundingMaker;\\n Fixed6 fundingLong;\\n Fixed6 fundingShort;\\n UFixed6 fundingFee;\\n }\\n\\n /// @notice Globally accumulates all long-short funding since last oracle update\\n /// @param self The Version object to update\\n /// @param global The global state\\n /// @param fromPosition The previous latest position\\n /// @param toPosition The next latest position\\n /// @param fromOracleVersion The previous latest oracle version\\n /// @param toOracleVersion The next latest oracle version\\n /// @param marketParameter The market parameter\\n /// @param riskParameter The risk parameter\\n /// @return fundingValues The funding values accumulated\\n function _accumulateFunding(\\n Version memory self,\\n Global memory global,\\n Position memory fromPosition,\\n Position memory toPosition,\\n OracleVersion memory fromOracleVersion,\\n OracleVersion memory toOracleVersion,\\n MarketParameter memory marketParameter,\\n RiskParameter memory riskParameter\\n ) private pure returns (_FundingValues memory fundingValues) {\\n // Compute long-short funding rate\\n Fixed6 funding = global.pAccumulator.accumulate(\\n riskParameter.pController,\\n toPosition.virtualSkew(riskParameter),\\n fromOracleVersion.timestamp,\\n toOracleVersion.timestamp,\\n fromPosition.takerSocialized().mul(fromOracleVersion.price.abs())\\n );\\n\\n // Handle maker receive-only status\\n if (riskParameter.makerReceiveOnly && funding.sign() != fromPosition.skew().sign())\\n funding = funding.mul(Fixed6Lib.NEG_ONE);\\n\\n // Initialize long and short funding\\n (fundingValues.fundingLong, fundingValues.fundingShort) = (Fixed6Lib.NEG_ONE.mul(funding), funding);\\n\\n // Compute fee spread\\n fundingValues.fundingFee = funding.abs().mul(marketParameter.fundingFee);\\n Fixed6 fundingSpread = Fixed6Lib.from(fundingValues.fundingFee).div(Fixed6Lib.from(2));\\n\\n // Adjust funding with spread\\n (fundingValues.fundingLong, fundingValues.fundingShort) = (\\n fundingValues.fundingLong.sub(Fixed6Lib.from(fundingValues.fundingFee)).add(fundingSpread),\\n fundingValues.fundingShort.sub(fundingSpread)\\n );\\n\\n // Redirect net portion of minor's side to maker\\n if (fromPosition.long.gt(fromPosition.short)) {\\n fundingValues.fundingMaker = fundingValues.fundingShort.mul(Fixed6Lib.from(fromPosition.socializedSkew()));\\n fundingValues.fundingShort = fundingValues.fundingShort.sub(fundingValues.fundingMaker);\\n }\\n if (fromPosition.short.gt(fromPosition.long)) {\\n fundingValues.fundingMaker = fundingValues.fundingLong.mul(Fixed6Lib.from(fromPosition.socializedSkew()));\\n fundingValues.fundingLong = fundingValues.fundingLong.sub(fundingValues.fundingMaker);\\n }\\n\\n self.makerValue.increment(fundingValues.fundingMaker, fromPosition.maker);\\n self.longValue.increment(fundingValues.fundingLong, fromPosition.long);\\n self.shortValue.increment(fundingValues.fundingShort, fromPosition.short);\\n }\\n\\n /// @notice Globally accumulates all maker interest since last oracle update\\n /// @param self The Version object to update\\n /// @param position The previous latest position\\n /// @param fromOracleVersion The previous latest oracle version\\n /// @param toOracleVersion The next latest oracle version\\n /// @param marketParameter The market parameter\\n /// @param riskParameter The risk parameter\\n /// @return interestMaker The total interest accrued by makers\\n /// @return interestLong The total interest accrued by longs\\n /// @return interestShort The total interest accrued by shorts\\n /// @return interestFee The total fee accrued from interest accumulation\\n function _accumulateInterest(\\n Version memory self,\\n Position memory position,\\n OracleVersion memory fromOracleVersion,\\n OracleVersion memory toOracleVersion,\\n MarketParameter memory marketParameter,\\n RiskParameter memory riskParameter\\n ) private pure returns (Fixed6 interestMaker, Fixed6 interestLong, Fixed6 interestShort, UFixed6 interestFee) {\\n UFixed6 notional = position.long.add(position.short).min(position.maker).mul(fromOracleVersion.price.abs());\\n\\n // Compute maker interest\\n UFixed6 interest = riskParameter.utilizationCurve.accumulate(\\n position.utilization(),\\n fromOracleVersion.timestamp,\\n toOracleVersion.timestamp,\\n notional\\n );\\n\\n // Compute fee\\n interestFee = interest.mul(marketParameter.interestFee);\\n\\n // Adjust long and short funding with spread\\n interestLong = Fixed6Lib.from(\\n position.major().isZero() ?\\n interest :\\n interest.muldiv(position.long, position.long.add(position.short))\\n );\\n interestShort = Fixed6Lib.from(interest).sub(interestLong);\\n interestMaker = Fixed6Lib.from(interest.sub(interestFee));\\n\\n interestLong = interestLong.mul(Fixed6Lib.NEG_ONE);\\n interestShort = interestShort.mul(Fixed6Lib.NEG_ONE);\\n self.makerValue.increment(interestMaker, position.maker);\\n self.longValue.increment(interestLong, position.long);\\n self.shortValue.increment(interestShort, position.short);\\n }\\n\\n /// @notice Globally accumulates position profit & loss since last oracle update\\n /// @param self The Version object to update\\n /// @param position The previous latest position\\n /// @param fromOracleVersion The previous latest oracle version\\n /// @param toOracleVersion The next latest oracle version\\n /// @return pnlMaker The total pnl accrued by makers\\n /// @return pnlLong The total pnl accrued by longs\\n /// @return pnlShort The total pnl accrued by shorts\\n function _accumulatePNL(\\n Version memory self,\\n Position memory position,\\n OracleVersion memory fromOracleVersion,\\n OracleVersion memory toOracleVersion\\n ) private pure returns (Fixed6 pnlMaker, Fixed6 pnlLong, Fixed6 pnlShort) {\\n pnlLong = toOracleVersion.price.sub(fromOracleVersion.price)\\n .mul(Fixed6Lib.from(position.longSocialized()));\\n pnlShort = fromOracleVersion.price.sub(toOracleVersion.price)\\n .mul(Fixed6Lib.from(position.shortSocialized()));\\n pnlMaker = pnlLong.add(pnlShort).mul(Fixed6Lib.NEG_ONE);\\n\\n self.longValue.increment(pnlLong, position.long);\\n self.shortValue.increment(pnlShort, position.short);\\n self.makerValue.increment(pnlMaker, position.maker);\\n }\\n\\n /// @notice Globally accumulates position's reward share since last oracle update\\n /// @param self The Version object to update\\n /// @param position The previous latest position\\n /// @param fromOracleVersion The previous latest oracle version\\n /// @param toOracleVersion The next latest oracle version\\n /// @param marketParameter The market parameter\\n /// @return rewardMaker The total reward accrued by makers\\n /// @return rewardLong The total reward accrued by longs\\n /// @return rewardShort The total reward accrued by shorts\\n function _accumulateReward(\\n Version memory self,\\n Position memory position,\\n OracleVersion memory fromOracleVersion,\\n OracleVersion memory toOracleVersion,\\n MarketParameter memory marketParameter\\n ) private pure returns (UFixed6 rewardMaker, UFixed6 rewardLong, UFixed6 rewardShort) {\\n UFixed6 elapsed = UFixed6Lib.from(toOracleVersion.timestamp - fromOracleVersion.timestamp);\\n\\n if (!position.maker.isZero()) {\\n rewardMaker = elapsed.mul(marketParameter.makerRewardRate);\\n self.makerReward.increment(rewardMaker, position.maker);\\n }\\n if (!position.long.isZero()) {\\n rewardLong = elapsed.mul(marketParameter.longRewardRate);\\n self.longReward.increment(rewardLong, position.long);\\n }\\n if (!position.short.isZero()) {\\n rewardShort = elapsed.mul(marketParameter.shortRewardRate);\\n self.shortReward.increment(rewardShort, position.short);\\n }\\n }\\n}\\n\\n/// @dev Manually encodes and decodes the Version struct into storage.\\n///\\n/// struct StoredVersion {\\n/// /* slot 0 */\\n/// bool valid;\\n/// int64 makerValue;\\n/// int64 longValue;\\n/// int64 shortValue;\\n///\\n/// /* slot 1 */\\n/// uint64 makerReward;\\n/// uint64 longReward;\\n/// uint64 shortReward;\\n/// }\\n///\\nlibrary VersionStorageLib {\\n // sig: 0xd2777e72\\n error VersionStorageInvalidError();\\n\\n function read(VersionStorage storage self) internal view returns (Version memory) {\\n (uint256 slot0, uint256 slot1) = (self.slot0, self.slot1);\\n return Version(\\n (uint256(slot0 << (256 - 8)) >> (256 - 8)) != 0,\\n Accumulator6(Fixed6.wrap(int256(slot0 << (256 - 8 - 64)) >> (256 - 64))),\\n Accumulator6(Fixed6.wrap(int256(slot0 << (256 - 8 - 64 - 64)) >> (256 - 64))),\\n Accumulator6(Fixed6.wrap(int256(slot0 << (256 - 8 - 64 - 64 - 64)) >> (256 - 64))),\\n UAccumulator6(UFixed6.wrap(uint256(slot1 << (256 - 64)) >> (256 - 64))),\\n UAccumulator6(UFixed6.wrap(uint256(slot1 << (256 - 64 - 64)) >> (256 - 64))),\\n UAccumulator6(UFixed6.wrap(uint256(slot1 << (256 - 64 - 64 - 64)) >> (256 - 64)))\\n );\\n }\\n\\n function store(VersionStorage storage self, Version memory newValue) internal {\\n if (newValue.makerValue._value.gt(Fixed6.wrap(type(int64).max))) revert VersionStorageInvalidError();\\n if (newValue.makerValue._value.lt(Fixed6.wrap(type(int64).min))) revert VersionStorageInvalidError();\\n if (newValue.longValue._value.gt(Fixed6.wrap(type(int64).max))) revert VersionStorageInvalidError();\\n if (newValue.longValue._value.lt(Fixed6.wrap(type(int64).min))) revert VersionStorageInvalidError();\\n if (newValue.shortValue._value.gt(Fixed6.wrap(type(int64).max))) revert VersionStorageInvalidError();\\n if (newValue.shortValue._value.lt(Fixed6.wrap(type(int64).min))) revert VersionStorageInvalidError();\\n if (newValue.makerReward._value.gt(UFixed6.wrap(type(uint64).max))) revert VersionStorageInvalidError();\\n if (newValue.longReward._value.gt(UFixed6.wrap(type(uint64).max))) revert VersionStorageInvalidError();\\n if (newValue.shortReward._value.gt(UFixed6.wrap(type(uint64).max))) revert VersionStorageInvalidError();\\n\\n uint256 encoded0 =\\n uint256((newValue.valid ? uint256(1) : uint256(0)) << (256 - 8)) >> (256 - 8) |\\n uint256(Fixed6.unwrap(newValue.makerValue._value) << (256 - 64)) >> (256 - 8 - 64) |\\n uint256(Fixed6.unwrap(newValue.longValue._value) << (256 - 64)) >> (256 - 8 - 64 - 64) |\\n uint256(Fixed6.unwrap(newValue.shortValue._value) << (256 - 64)) >> (256 - 8 - 64 - 64 - 64);\\n uint256 encoded1 =\\n uint256(UFixed6.unwrap(newValue.makerReward._value) << (256 - 64)) >> (256 - 64) |\\n uint256(UFixed6.unwrap(newValue.longReward._value) << (256 - 64)) >> (256 - 64 - 64) |\\n uint256(UFixed6.unwrap(newValue.shortReward._value) << (256 - 64)) >> (256 - 64 - 64 - 64);\\n\\n assembly {\\n sstore(self.slot, encoded0)\\n sstore(add(self.slot, 1), encoded1)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x5dac2239c7dbb4c8924520ec5f8fc5b2f4653547dcb1d819bfdc1b6c8c95f88b\",\"license\":\"Apache-2.0\"},\"@equilibria/root/accumulator/types/Accumulator6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../../number/types/Fixed6.sol\\\";\\nimport \\\"../../number/types/UFixed6.sol\\\";\\n\\n/// @dev Accumulator6 type\\nstruct Accumulator6 {\\n Fixed6 _value;\\n}\\n\\nusing Accumulator6Lib for Accumulator6 global;\\nstruct StoredAccumulator6 {\\n int256 _value;\\n}\\nstruct Accumulator6Storage { StoredAccumulator6 value; }\\nusing Accumulator6StorageLib for Accumulator6Storage global;\\n\\n\\n/**\\n * @title Accumulator6Lib\\n * @notice Library that surfaces math operations for the signed Accumulator type.\\n * @dev This accumulator tracks cumulative changes to a value over time. Using the `accumulated` function, one\\n * can determine how much a value has changed between two points in time. The `increment` and `decrement` functions\\n * can be used to update the accumulator.\\n */\\nlibrary Accumulator6Lib {\\n /**\\n * Returns how much has been accumulated between two accumulators\\n * @param self The current point of the accumulation to compare with `from`\\n * @param from The starting point of the accumulation\\n * @param total Demoninator of the ratio (see `increment` and `decrement` functions)\\n */\\n function accumulated(Accumulator6 memory self, Accumulator6 memory from, UFixed6 total) internal pure returns (Fixed6) {\\n return _mul(self._value.sub(from._value), total);\\n }\\n\\n /**\\n * @notice Increments an accumulator by a given ratio\\n * @dev Always rounds down in order to prevent overstating the accumulated value\\n * @param self The accumulator to increment\\n * @param amount Numerator of the ratio\\n * @param total Denominator of the ratio\\n */\\n function increment(Accumulator6 memory self, Fixed6 amount, UFixed6 total) internal pure {\\n if (amount.isZero()) return;\\n self._value = self._value.add(_div(amount, total));\\n }\\n\\n /**\\n * @notice Decrements an accumulator by a given ratio\\n * @dev Always rounds down in order to prevent overstating the accumulated value\\n * @param self The accumulator to decrement\\n * @param amount Numerator of the ratio\\n * @param total Denominator of the ratio\\n */\\n function decrement(Accumulator6 memory self, Fixed6 amount, UFixed6 total) internal pure {\\n if (amount.isZero()) return;\\n self._value = self._value.add(_div(amount.mul(Fixed6Lib.NEG_ONE), total));\\n }\\n\\n function _div(Fixed6 amount, UFixed6 total) private pure returns (Fixed6) {\\n return amount.sign() == -1 ? amount.divOut(Fixed6Lib.from(total)) : amount.div(Fixed6Lib.from(total));\\n }\\n\\n function _mul(Fixed6 amount, UFixed6 total) private pure returns (Fixed6) {\\n return amount.sign() == -1 ? amount.mulOut(Fixed6Lib.from(total)) : amount.mul(Fixed6Lib.from(total));\\n }\\n}\\n\\nlibrary Accumulator6StorageLib {\\n function read(Accumulator6Storage storage self) internal view returns (Accumulator6 memory) {\\n StoredAccumulator6 memory storedValue = self.value;\\n return Accumulator6(Fixed6.wrap(int256(storedValue._value)));\\n }\\n\\n function store(Accumulator6Storage storage self, Accumulator6 memory newValue) internal {\\n self.value = StoredAccumulator6(Fixed6.unwrap(newValue._value));\\n }\\n}\\n\",\"keccak256\":\"0x21202b20328506bda86043889dca7b699732a9bf6ec735cc50ac8a444e643724\",\"license\":\"Apache-2.0\"},\"@equilibria/root/accumulator/types/UAccumulator6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../../number/types/UFixed6.sol\\\";\\n\\n/// @dev UAccumulator6 type\\nstruct UAccumulator6 {\\n UFixed6 _value;\\n}\\n\\nusing UAccumulator6Lib for UAccumulator6 global;\\nstruct StoredUAccumulator6 {\\n uint256 _value;\\n}\\nstruct UAccumulator6Storage { StoredUAccumulator6 value; }\\nusing UAccumulator6StorageLib for UAccumulator6Storage global;\\n\\n\\n/**\\n * @title UAccumulator6Lib\\n * @notice Library that surfaces math operations for the unsigned Accumulator type.\\n * @dev This accumulator tracks cumulative changes to a monotonically increasing value over time. Using the `accumulated` function, one\\n * can determine how much a value has changed between two points in time. The `increment` function can be used to update the accumulator.\\n */\\nlibrary UAccumulator6Lib {\\n /**\\n * Returns how much has been accumulated between two accumulators\\n * @param self The current point of the accumulation to compare with `from`\\n * @param from The starting point of the accumulation\\n * @param total Demoninator of the ratio (see `increment` function)\\n */\\n function accumulated(UAccumulator6 memory self, UAccumulator6 memory from, UFixed6 total) internal pure returns (UFixed6) {\\n return self._value.sub(from._value).mul(total);\\n }\\n\\n /**\\n * @notice Increments an accumulator by a given ratio\\n * @dev Always rounds down in order to prevent overstating the accumulated value\\n * @param self The accumulator to increment\\n * @param amount Numerator of the ratio\\n * @param total Denominator of the ratio\\n */\\n function increment(UAccumulator6 memory self, UFixed6 amount, UFixed6 total) internal pure {\\n if (amount.isZero()) return;\\n self._value = self._value.add(amount.div(total));\\n }\\n}\\n\\nlibrary UAccumulator6StorageLib {\\n function read(UAccumulator6Storage storage self) internal view returns (UAccumulator6 memory) {\\n StoredUAccumulator6 memory storedValue = self.value;\\n return UAccumulator6(UFixed6.wrap(uint256(storedValue._value)));\\n }\\n\\n function store(UAccumulator6Storage storage self, UAccumulator6 memory newValue) internal {\\n self.value = StoredUAccumulator6(UFixed6.unwrap(newValue._value));\\n }\\n}\\n\",\"keccak256\":\"0x6c8f1e358099c02e441e396172c0d8920e85185946a72eff0af9a678588d0636\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/Factory.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\\\";\\nimport \\\"./interfaces/IFactory.sol\\\";\\nimport \\\"./interfaces/IInstance.sol\\\";\\nimport \\\"./Pausable.sol\\\";\\n\\n/// @title Factory\\n/// @notice An abstract factory that manages creates and manages instances\\n/// @dev Ownable and Pausable, and satisfies the IBeacon interface by default.\\nabstract contract Factory is IFactory, Ownable, Pausable {\\n /// @notice The instances mapping storage slot\\n bytes32 private constant INSTANCE_MAP_SLOT = keccak256(\\\"equilibria.root.Factory.instances\\\");\\n\\n /// @notice The instance implementation address\\n address public immutable implementation;\\n\\n /// @notice Constructs the contract\\n /// @param implementation_ The instance implementation address\\n constructor(address implementation_) { implementation = implementation_; }\\n\\n /// @notice Initializes the contract state\\n function __Factory__initialize() internal onlyInitializer {\\n __Ownable__initialize();\\n }\\n\\n /// @notice Returns whether the instance is valid\\n /// @param instance The instance to check\\n /// @return Whether the instance is valid\\n function instances(IInstance instance) public view returns (bool) {\\n return _instances()[instance];\\n }\\n\\n /// @notice Creates a new instance\\n /// @dev Deploys a BeaconProxy with the this contract as the beacon\\n /// @param data The initialization data\\n /// @return newInstance The new instance\\n function _create(bytes memory data) internal returns (IInstance newInstance) {\\n newInstance = IInstance(address(new BeaconProxy(address(this), data)));\\n _register(newInstance);\\n }\\n\\n /// @notice Registers a new instance\\n /// @dev Called by _create automatically, or can be called manually in an extending implementation\\n /// @param newInstance The new instance\\n function _register(IInstance newInstance) internal {\\n _instances()[newInstance] = true;\\n emit InstanceRegistered(newInstance);\\n }\\n\\n /// @notice Returns the storage mapping for instances\\n /// @return r The storage mapping for instances\\n function _instances() private pure returns (mapping(IInstance => bool) storage r) {\\n bytes32 slot = INSTANCE_MAP_SLOT;\\n /// @solidity memory-safe-assembly\\n assembly { r.slot := slot }\\n }\\n\\n /// @notice Only allow the function by a valid instance\\n modifier onlyInstance {\\n if (!instances(IInstance(msg.sender))) revert FactoryNotInstanceError();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x9abf14ab56d5a94034e9eab1163c1c317a6e0a70e2e05e21ee32f7de0dadce6e\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/utils/Address.sol\\\";\\nimport \\\"./interfaces/IInitializable.sol\\\";\\nimport \\\"../storage/Storage.sol\\\";\\n\\n/**\\n * @title Initializable\\n * @notice Library to manage the initialization lifecycle of upgradeable contracts\\n * @dev `Initializable.sol` allows the creation of pseudo-constructors for upgradeable contracts. One\\n * `initializer` should be declared per top-level contract. Child contracts can use the `onlyInitializer`\\n * modifier to tag their internal initialization functions to ensure that they can only be called\\n * from a top-level `initializer` or a constructor.\\n */\\nabstract contract Initializable is IInitializable {\\n /// @dev The initialized flag\\n Uint256Storage private constant _version = Uint256Storage.wrap(keccak256(\\\"equilibria.root.Initializable.version\\\"));\\n\\n /// @dev The initializing flag\\n BoolStorage private constant _initializing = BoolStorage.wrap(keccak256(\\\"equilibria.root.Initializable.initializing\\\"));\\n\\n /// @dev Can only be called once per version, `version` is 1-indexed\\n modifier initializer(uint256 version) {\\n if (version == 0) revert InitializableZeroVersionError();\\n if (_version.read() >= version) revert InitializableAlreadyInitializedError(version);\\n\\n _version.store(version);\\n _initializing.store(true);\\n\\n _;\\n\\n _initializing.store(false);\\n emit Initialized(version);\\n }\\n\\n /// @dev Can only be called from an initializer or constructor\\n modifier onlyInitializer() {\\n if (!_constructing() && !_initializing.read()) revert InitializableNotInitializingError();\\n _;\\n }\\n\\n /**\\n * @notice Returns whether the contract is currently being constructed\\n * @dev {Address.isContract} returns false for contracts currently in the process of being constructed\\n * @return Whether the contract is currently being constructed\\n */\\n function _constructing() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0xaae151abc669fe2ec33a80e4e62da1849b7863034aeb9c16122c728d041cfb0b\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./Initializable.sol\\\";\\nimport \\\"./interfaces/IOwnable.sol\\\";\\nimport \\\"../storage/Storage.sol\\\";\\n\\n/**\\n * @title Ownable\\n * @notice Library to manage the ownership lifecycle of upgradeable contracts.\\n * @dev This contract has been extended from the Open Zeppelin library to include an\\n * unstructured storage pattern so that it can be safely mixed in with upgradeable\\n * contracts without affecting their storage patterns through inheritance.\\n */\\nabstract contract Ownable is IOwnable, Initializable {\\n /// @dev The owner address\\n AddressStorage private constant _owner = AddressStorage.wrap(keccak256(\\\"equilibria.root.Ownable.owner\\\"));\\n function owner() public view returns (address) { return _owner.read(); }\\n\\n /// @dev The pending owner address\\n AddressStorage private constant _pendingOwner = AddressStorage.wrap(keccak256(\\\"equilibria.root.Ownable.pendingOwner\\\"));\\n function pendingOwner() public view returns (address) { return _pendingOwner.read(); }\\n\\n /**\\n * @notice Initializes the contract setting `msg.sender` as the initial owner\\n */\\n function __Ownable__initialize() internal onlyInitializer {\\n _updateOwner(_sender());\\n }\\n\\n /**\\n * @notice Updates the new pending owner\\n * @dev Can only be called by the current owner\\n * New owner does not take affect until that address calls `acceptOwner()`\\n * @param newPendingOwner New pending owner address\\n */\\n function updatePendingOwner(address newPendingOwner) public onlyOwner {\\n _pendingOwner.store(newPendingOwner);\\n emit PendingOwnerUpdated(newPendingOwner);\\n }\\n\\n /**\\n * @notice Accepts and transfers the ownership of the contract to the pending owner\\n * @dev Can only be called by the pending owner to ensure correctness. Calls to the `_beforeAcceptOwner` hook\\n * to perform logic before updating ownership.\\n */\\n function acceptOwner() public {\\n _beforeAcceptOwner();\\n\\n if (_sender() != pendingOwner()) revert OwnableNotPendingOwnerError(_sender());\\n\\n _updateOwner(pendingOwner());\\n updatePendingOwner(address(0));\\n }\\n\\n\\n /// @dev Hook for inheriting contracts to perform logic before accepting ownership\\n function _beforeAcceptOwner() internal virtual {}\\n\\n /**\\n * @notice Updates the owner address\\n * @param newOwner New owner address\\n */\\n function _updateOwner(address newOwner) private {\\n _owner.store(newOwner);\\n emit OwnerUpdated(newOwner);\\n }\\n\\n function _sender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n /// @dev Throws if called by any account other than the owner\\n modifier onlyOwner {\\n if (owner() != _sender()) revert OwnableNotOwnerError(_sender());\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x9c6c64a49f94dc614c5488e4e892df59481ad143294b10f60e1940e786d48eff\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./Initializable.sol\\\";\\nimport \\\"./Ownable.sol\\\";\\nimport \\\"./interfaces/IPausable.sol\\\";\\nimport \\\"../storage/Storage.sol\\\";\\n\\n/**\\n * @title Pausable\\n * @notice Library to allow for the emergency pausing and unpausing of contract functions\\n * by an authorized account.\\n * @dev This contract has been extended from the Open Zeppelin library to include an\\n * unstructured storage pattern so that it can be safely mixed in with upgradeable\\n * contracts without affecting their storage patterns through inheritance.\\n */\\nabstract contract Pausable is IPausable, Ownable {\\n /// @dev The pauser address\\n AddressStorage private constant _pauser = AddressStorage.wrap(keccak256(\\\"equilibria.root.Pausable.pauser\\\"));\\n function pauser() public view returns (address) { return _pauser.read(); }\\n\\n /// @dev Whether the contract is paused\\n BoolStorage private constant _paused = BoolStorage.wrap(keccak256(\\\"equilibria.root.Pausable.paused\\\"));\\n function paused() public view returns (bool) { return _paused.read(); }\\n\\n /**\\n * @notice Initializes the contract setting `msg.sender` as the initial pauser\\n */\\n function __Pausable__initialize() internal onlyInitializer {\\n __Ownable__initialize();\\n updatePauser(_sender());\\n }\\n\\n /**\\n * @notice Updates the new pauser\\n * @dev Can only be called by the current owner\\n * @param newPauser New pauser address\\n */\\n function updatePauser(address newPauser) public onlyOwner {\\n _pauser.store(newPauser);\\n emit PauserUpdated(newPauser);\\n }\\n\\n /**\\n * @notice Pauses the contract\\n * @dev Can only be called by the pauser\\n */\\n function pause() external onlyPauser {\\n _paused.store(true);\\n emit Paused();\\n }\\n\\n /**\\n * @notice Unpauses the contract\\n * @dev Can only be called by the pauser\\n */\\n function unpause() external onlyPauser {\\n _paused.store(false);\\n emit Unpaused();\\n }\\n\\n /// @dev Throws if called by any account other than the pauser\\n modifier onlyPauser {\\n if (_sender() != pauser() && _sender() != owner()) revert PausableNotPauserError(_sender());\\n _;\\n }\\n\\n /// @dev Throws if called when the contract is paused\\n modifier whenNotPaused {\\n if (paused()) revert PausablePausedError();\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x84576da194beb42bd63d486e7b2ad623201f0f77a34574eae35871cf5a6b5021\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/interfaces/IFactory.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\\\";\\nimport \\\"./IPausable.sol\\\";\\nimport \\\"./IInstance.sol\\\";\\n\\ninterface IFactory is IBeacon, IOwnable, IPausable {\\n event InstanceRegistered(IInstance indexed instance);\\n\\n error FactoryNotInstanceError();\\n\\n function instances(IInstance instance) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x64c821ff5b6ff536a295bc0a24bf76dac44cd67b89183d224903f9fe1d6d3e65\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/interfaces/IInitializable.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\ninterface IInitializable {\\n error InitializableZeroVersionError();\\n error InitializableAlreadyInitializedError(uint256 version);\\n error InitializableNotInitializingError();\\n\\n event Initialized(uint256 version);\\n}\\n\",\"keccak256\":\"0xa626c401aab111b5ccdaa280b4d0137e2f4261a71796cd89a1435025083b4035\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/interfaces/IInstance.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./IFactory.sol\\\";\\nimport \\\"./IInitializable.sol\\\";\\n\\ninterface IInstance is IInitializable {\\n error InstanceNotOwnerError(address sender);\\n error InstancePausedError();\\n\\n function factory() external view returns (IFactory);\\n}\\n\",\"keccak256\":\"0x4ccbf489639c7d9dc87141133975dd4633e2e949174da5076ad2373a1b81cb88\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/interfaces/IOwnable.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./IInitializable.sol\\\";\\n\\ninterface IOwnable is IInitializable {\\n event OwnerUpdated(address indexed newOwner);\\n event PendingOwnerUpdated(address indexed newPendingOwner);\\n\\n error OwnableNotOwnerError(address sender);\\n error OwnableNotPendingOwnerError(address sender);\\n\\n function owner() external view returns (address);\\n function pendingOwner() external view returns (address);\\n function updatePendingOwner(address newPendingOwner) external;\\n function acceptOwner() external;\\n}\\n\",\"keccak256\":\"0x0f451927a2ccfc0771d38d9dcdeae79aec5ee6170b6009f1616505d83aff8733\",\"license\":\"Apache-2.0\"},\"@equilibria/root/attribute/interfaces/IPausable.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"./IInitializable.sol\\\";\\nimport \\\"./IOwnable.sol\\\";\\n\\ninterface IPausable is IInitializable, IOwnable {\\n event PauserUpdated(address indexed newPauser);\\n event Paused();\\n event Unpaused();\\n\\n error PausablePausedError();\\n error PausableNotPauserError(address sender);\\n\\n function pauser() external view returns (address);\\n function paused() external view returns (bool);\\n function updatePauser(address newPauser) external;\\n function pause() external;\\n function unpause() external;\\n}\\n\",\"keccak256\":\"0x8ae48b036875291c763787ba6730d56f4a9cb30d7d4132ec8711544b99689338\",\"license\":\"Apache-2.0\"},\"@equilibria/root/number/NumberMath.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/SignedMath.sol\\\";\\n\\n/**\\n * @title NumberMath\\n * @notice Library for additional math functions that are not included in the OpenZeppelin libraries.\\n */\\nlibrary NumberMath {\\n error DivisionByZero();\\n\\n /**\\n * @notice Divides `a` by `b`, rounding the result away from zero if there is a remainder\\n * @param a Dividend\\n * @param b Divisor\\n * @return Resulting quotient\\n */\\n function divOut(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) revert DivisionByZero();\\n return Math.ceilDiv(a, b);\\n }\\n\\n /**\\n * @notice Divides `a` by `b`, rounding the result away from zero if there is a remainder\\n * @param a Dividend\\n * @param b Divisor\\n * @return Resulting quotient\\n */\\n function divOut(int256 a, int256 b) internal pure returns (int256) {\\n return sign(a) * sign(b) * int256(divOut(SignedMath.abs(a), SignedMath.abs(b)));\\n }\\n\\n /**\\n * @notice Returns the sign of an int256\\n * @dev Returns: -1 for negative\\n * 0 for zero\\n * 1 for positive\\n * @param a int256 to find the sign of\\n * @return Sign of the int256\\n */\\n function sign(int256 a) internal pure returns (int256) {\\n if (a > 0) return 1;\\n if (a < 0) return -1;\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0x8d3578ce6e74ee6589ba0468e2c539ef1eb51d6687b508e637620926eb8396b4\",\"license\":\"Apache-2.0\"},\"@equilibria/root/number/types/Fixed18.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SignedMath.sol\\\";\\nimport \\\"../NumberMath.sol\\\";\\nimport \\\"./Fixed6.sol\\\";\\nimport \\\"./UFixed18.sol\\\";\\n\\n/// @dev Fixed18 type\\ntype Fixed18 is int256;\\nusing Fixed18Lib for Fixed18 global;\\ntype Fixed18Storage is bytes32;\\nusing Fixed18StorageLib for Fixed18Storage global;\\n\\n/**\\n * @title Fixed18Lib\\n * @notice Library for the signed fixed-decimal type.\\n */\\nlibrary Fixed18Lib {\\n error Fixed18OverflowError(uint256 value);\\n\\n int256 private constant BASE = 1e18;\\n Fixed18 public constant ZERO = Fixed18.wrap(0);\\n Fixed18 public constant ONE = Fixed18.wrap(BASE);\\n Fixed18 public constant NEG_ONE = Fixed18.wrap(-1 * BASE);\\n Fixed18 public constant MAX = Fixed18.wrap(type(int256).max);\\n Fixed18 public constant MIN = Fixed18.wrap(type(int256).min);\\n\\n /**\\n * @notice Creates a signed fixed-decimal from an unsigned fixed-decimal\\n * @param a Unsigned fixed-decimal\\n * @return New signed fixed-decimal\\n */\\n function from(UFixed18 a) internal pure returns (Fixed18) {\\n uint256 value = UFixed18.unwrap(a);\\n if (value > uint256(type(int256).max)) revert Fixed18OverflowError(value);\\n return Fixed18.wrap(int256(value));\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a sign and an unsigned fixed-decimal\\n * @param s Sign\\n * @param m Unsigned fixed-decimal magnitude\\n * @return New signed fixed-decimal\\n */\\n function from(int256 s, UFixed18 m) internal pure returns (Fixed18) {\\n if (s > 0) return from(m);\\n if (s < 0) {\\n // Since from(m) multiplies m by BASE, from(m) cannot be type(int256).min\\n // which is the only value that would overflow when negated. Therefore,\\n // we can safely negate from(m) without checking for overflow.\\n unchecked { return Fixed18.wrap(-1 * Fixed18.unwrap(from(m))); }\\n }\\n return ZERO;\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a signed integer\\n * @param a Signed number\\n * @return New signed fixed-decimal\\n */\\n function from(int256 a) internal pure returns (Fixed18) {\\n return Fixed18.wrap(a * BASE);\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a base-6 signed fixed-decimal\\n * @param a Base-6 signed fixed-decimal\\n * @return New signed fixed-decimal\\n */\\n function from(Fixed6 a) internal pure returns (Fixed18) {\\n return Fixed18.wrap(Fixed6.unwrap(a) * 1e12);\\n }\\n\\n /**\\n * @notice Returns whether the signed fixed-decimal is equal to zero.\\n * @param a Signed fixed-decimal\\n * @return Whether the signed fixed-decimal is zero.\\n */\\n function isZero(Fixed18 a) internal pure returns (bool) {\\n return Fixed18.unwrap(a) == 0;\\n }\\n\\n /**\\n * @notice Adds two signed fixed-decimals `a` and `b` together\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Resulting summed signed fixed-decimal\\n */\\n function add(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(Fixed18.unwrap(a) + Fixed18.unwrap(b));\\n }\\n\\n /**\\n * @notice Subtracts signed fixed-decimal `b` from `a`\\n * @param a Signed fixed-decimal to subtract from\\n * @param b Signed fixed-decimal to subtract\\n * @return Resulting subtracted signed fixed-decimal\\n */\\n function sub(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(Fixed18.unwrap(a) - Fixed18.unwrap(b));\\n }\\n\\n /**\\n * @notice Multiplies two signed fixed-decimals `a` and `b` together\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Resulting multiplied signed fixed-decimal\\n */\\n function mul(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(Fixed18.unwrap(a) * Fixed18.unwrap(b) / BASE);\\n }\\n\\n /**\\n * @notice Multiplies two signed fixed-decimals `a` and `b` together, rounding the result away from zero if there is a remainder\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Resulting multiplied signed fixed-decimal\\n */\\n function mulOut(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(NumberMath.divOut(Fixed18.unwrap(a) * Fixed18.unwrap(b), BASE));\\n }\\n\\n /**\\n * @notice Divides signed fixed-decimal `a` by `b`\\n * @param a Signed fixed-decimal to divide\\n * @param b Signed fixed-decimal to divide by\\n * @return Resulting divided signed fixed-decimal\\n */\\n function div(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(Fixed18.unwrap(a) * BASE / Fixed18.unwrap(b));\\n }\\n\\n /**\\n * @notice Divides signed fixed-decimal `a` by `b`, rounding the result away from zero if there is a remainder\\n * @param a Signed fixed-decimal to divide\\n * @param b Signed fixed-decimal to divide by\\n * @return Resulting divided signed fixed-decimal\\n */\\n function divOut(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18Lib.from(sign(a) * sign(b), a.abs().divOut(b.abs()));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0`, `MAX` for `n/0`, and `MIN` for `-n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDiv(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n if (isZero(b)) {\\n if (gt(a, ZERO)) return MAX;\\n if (lt(a, ZERO)) return MIN;\\n return ONE;\\n } else {\\n return div(a, b);\\n }\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`, rounding the result away from zero if there is a remainder\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0`, `MAX` for `n/0`, and `MIN` for `-n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDivOut(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n if (isZero(b)) {\\n if (gt(a, ZERO)) return MAX;\\n if (lt(a, ZERO)) return MIN;\\n return ONE;\\n } else {\\n return divOut(a, b);\\n }\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First signed fixed-decimal\\n * @param b Signed number to multiply by\\n * @param c Signed number to divide by\\n * @return Resulting computation\\n */\\n function muldiv(Fixed18 a, int256 b, int256 c) internal pure returns (Fixed18) {\\n return muldiv(a, Fixed18.wrap(b), Fixed18.wrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First signed fixed-decimal\\n * @param b Signed number to multiply by\\n * @param c Signed number to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(Fixed18 a, int256 b, int256 c) internal pure returns (Fixed18) {\\n return muldivOut(a, Fixed18.wrap(b), Fixed18.wrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First signed fixed-decimal\\n * @param b Signed fixed-decimal to multiply by\\n * @param c Signed fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldiv(Fixed18 a, Fixed18 b, Fixed18 c) internal pure returns (Fixed18) {\\n return Fixed18.wrap(Fixed18.unwrap(a) * Fixed18.unwrap(b) / Fixed18.unwrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First signed fixed-decimal\\n * @param b Signed fixed-decimal to multiply by\\n * @param c Signed fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(Fixed18 a, Fixed18 b, Fixed18 c) internal pure returns (Fixed18) {\\n return Fixed18.wrap(NumberMath.divOut(Fixed18.unwrap(a) * Fixed18.unwrap(b), Fixed18.unwrap(c)));\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is equal to `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is equal to `b`\\n */\\n function eq(Fixed18 a, Fixed18 b) internal pure returns (bool) {\\n return compare(a, b) == 1;\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is greater than `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is greater than `b`\\n */\\n function gt(Fixed18 a, Fixed18 b) internal pure returns (bool) {\\n return compare(a, b) == 2;\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is less than `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is less than `b`\\n */\\n function lt(Fixed18 a, Fixed18 b) internal pure returns (bool) {\\n return compare(a, b) == 0;\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is greater than or equal to `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is greater than or equal to `b`\\n */\\n function gte(Fixed18 a, Fixed18 b) internal pure returns (bool) {\\n return gt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is less than or equal to `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is less than or equal to `b`\\n */\\n function lte(Fixed18 a, Fixed18 b) internal pure returns (bool) {\\n return lt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Compares the signed fixed-decimals `a` and `b`\\n * @dev Returns: 2 for greater than\\n * 1 for equal to\\n * 0 for less than\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Compare result of `a` and `b`\\n */\\n function compare(Fixed18 a, Fixed18 b) internal pure returns (uint256) {\\n (int256 au, int256 bu) = (Fixed18.unwrap(a), Fixed18.unwrap(b));\\n if (au > bu) return 2;\\n if (au < bu) return 0;\\n return 1;\\n }\\n\\n /**\\n * @notice Returns a signed fixed-decimal representing the ratio of `a` over `b`\\n * @param a First signed number\\n * @param b Second signed number\\n * @return Ratio of `a` over `b`\\n */\\n function ratio(int256 a, int256 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(a * BASE / b);\\n }\\n\\n /**\\n * @notice Returns the minimum of signed fixed-decimals `a` and `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Minimum of `a` and `b`\\n */\\n function min(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(SignedMath.min(Fixed18.unwrap(a), Fixed18.unwrap(b)));\\n }\\n\\n /**\\n * @notice Returns the maximum of signed fixed-decimals `a` and `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Maximum of `a` and `b`\\n */\\n function max(Fixed18 a, Fixed18 b) internal pure returns (Fixed18) {\\n return Fixed18.wrap(SignedMath.max(Fixed18.unwrap(a), Fixed18.unwrap(b)));\\n }\\n\\n /**\\n * @notice Converts the signed fixed-decimal into an integer, truncating any decimal portion\\n * @param a Signed fixed-decimal\\n * @return Truncated signed number\\n */\\n function truncate(Fixed18 a) internal pure returns (int256) {\\n return Fixed18.unwrap(a) / BASE;\\n }\\n\\n /**\\n * @notice Returns the sign of the signed fixed-decimal\\n * @dev Returns: -1 for negative\\n * 0 for zero\\n * 1 for positive\\n * @param a Signed fixed-decimal\\n * @return Sign of the signed fixed-decimal\\n */\\n function sign(Fixed18 a) internal pure returns (int256) {\\n if (Fixed18.unwrap(a) > 0) return 1;\\n if (Fixed18.unwrap(a) < 0) return -1;\\n return 0;\\n }\\n\\n /**\\n * @notice Returns the absolute value of the signed fixed-decimal\\n * @param a Signed fixed-decimal\\n * @return Absolute value of the signed fixed-decimal\\n */\\n function abs(Fixed18 a) internal pure returns (UFixed18) {\\n return UFixed18.wrap(SignedMath.abs(Fixed18.unwrap(a)));\\n }\\n}\\n\\nlibrary Fixed18StorageLib {\\n function read(Fixed18Storage self) internal view returns (Fixed18 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n function store(Fixed18Storage self, Fixed18 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdd3541bc1dbe5ca81f996a1ed5a05a7b8c74247426aab221d1a8f37be91d0e4f\",\"license\":\"Apache-2.0\"},\"@equilibria/root/number/types/Fixed6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/SignedMath.sol\\\";\\nimport \\\"../NumberMath.sol\\\";\\nimport \\\"./Fixed18.sol\\\";\\nimport \\\"./UFixed6.sol\\\";\\n\\n/// @dev Fixed6 type\\ntype Fixed6 is int256;\\nusing Fixed6Lib for Fixed6 global;\\ntype Fixed6Storage is bytes32;\\nusing Fixed6StorageLib for Fixed6Storage global;\\n\\n/**\\n * @title Fixed6Lib\\n * @notice Library for the signed fixed-decimal type.\\n */\\nlibrary Fixed6Lib {\\n error Fixed6OverflowError(uint256 value);\\n\\n int256 private constant BASE = 1e6;\\n Fixed6 public constant ZERO = Fixed6.wrap(0);\\n Fixed6 public constant ONE = Fixed6.wrap(BASE);\\n Fixed6 public constant NEG_ONE = Fixed6.wrap(-1 * BASE);\\n Fixed6 public constant MAX = Fixed6.wrap(type(int256).max);\\n Fixed6 public constant MIN = Fixed6.wrap(type(int256).min);\\n\\n /**\\n * @notice Creates a signed fixed-decimal from an unsigned fixed-decimal\\n * @param a Unsigned fixed-decimal\\n * @return New signed fixed-decimal\\n */\\n function from(UFixed6 a) internal pure returns (Fixed6) {\\n uint256 value = UFixed6.unwrap(a);\\n if (value > uint256(type(int256).max)) revert Fixed6OverflowError(value);\\n return Fixed6.wrap(int256(value));\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a sign and an unsigned fixed-decimal\\n * @param s Sign\\n * @param m Unsigned fixed-decimal magnitude\\n * @return New signed fixed-decimal\\n */\\n function from(int256 s, UFixed6 m) internal pure returns (Fixed6) {\\n if (s > 0) return from(m);\\n if (s < 0) {\\n // Since from(m) multiplies m by BASE, from(m) cannot be type(int256).min\\n // which is the only value that would overflow when negated. Therefore,\\n // we can safely negate from(m) without checking for overflow.\\n unchecked { return Fixed6.wrap(-1 * Fixed6.unwrap(from(m))); }\\n }\\n return ZERO;\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a signed integer\\n * @param a Signed number\\n * @return New signed fixed-decimal\\n */\\n function from(int256 a) internal pure returns (Fixed6) {\\n return Fixed6.wrap(a * BASE);\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a base-18 signed fixed-decimal\\n * @param a Base-18 signed fixed-decimal\\n * @return New signed fixed-decimal\\n */\\n function from(Fixed18 a) internal pure returns (Fixed6) {\\n return Fixed6.wrap(Fixed18.unwrap(a) / 1e12);\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a base-18 signed fixed-decimal\\n * @param a Base-18 signed fixed-decimal\\n * @param roundOut Whether to round the result away from zero if there is a remainder\\n * @return New signed fixed-decimal\\n */\\n function from(Fixed18 a, bool roundOut) internal pure returns (Fixed6) {\\n return roundOut ? Fixed6.wrap(NumberMath.divOut(Fixed18.unwrap(a), 1e12)): from(a);\\n }\\n\\n /**\\n * @notice Returns whether the signed fixed-decimal is equal to zero.\\n * @param a Signed fixed-decimal\\n * @return Whether the signed fixed-decimal is zero.\\n */\\n function isZero(Fixed6 a) internal pure returns (bool) {\\n return Fixed6.unwrap(a) == 0;\\n }\\n\\n /**\\n * @notice Adds two signed fixed-decimals `a` and `b` together\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Resulting summed signed fixed-decimal\\n */\\n function add(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(Fixed6.unwrap(a) + Fixed6.unwrap(b));\\n }\\n\\n /**\\n * @notice Subtracts signed fixed-decimal `b` from `a`\\n * @param a Signed fixed-decimal to subtract from\\n * @param b Signed fixed-decimal to subtract\\n * @return Resulting subtracted signed fixed-decimal\\n */\\n function sub(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(Fixed6.unwrap(a) - Fixed6.unwrap(b));\\n }\\n\\n /**\\n * @notice Multiplies two signed fixed-decimals `a` and `b` together\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Resulting multiplied signed fixed-decimal\\n */\\n function mul(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(Fixed6.unwrap(a) * Fixed6.unwrap(b) / BASE);\\n }\\n\\n /**\\n * @notice Multiplies two signed fixed-decimals `a` and `b` together, rounding the result away from zero if there is a remainder\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Resulting multiplied signed fixed-decimal\\n */\\n function mulOut(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(NumberMath.divOut(Fixed6.unwrap(a) * Fixed6.unwrap(b), BASE));\\n }\\n\\n /**\\n * @notice Divides signed fixed-decimal `a` by `b`\\n * @param a Signed fixed-decimal to divide\\n * @param b Signed fixed-decimal to divide by\\n * @return Resulting divided signed fixed-decimal\\n */\\n function div(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(Fixed6.unwrap(a) * BASE / Fixed6.unwrap(b));\\n }\\n\\n /**\\n * @notice Divides signed fixed-decimal `a` by `b`, rounding the result away from zero if there is a remainder\\n * @param a Signed fixed-decimal to divide\\n * @param b Signed fixed-decimal to divide by\\n * @return Resulting divided signed fixed-decimal\\n */\\n function divOut(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6Lib.from(sign(a) * sign(b), a.abs().divOut(b.abs()));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0`, `MAX` for `n/0`, and `MIN` for `-n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDiv(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n if (isZero(b)) {\\n if (gt(a, ZERO)) return MAX;\\n if (lt(a, ZERO)) return MIN;\\n return ONE;\\n } else {\\n return div(a, b);\\n }\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`, rounding the result away from zero if there is a remainder\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0`, `MAX` for `n/0`, and `MIN` for `-n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDivOut(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n if (isZero(b)) {\\n if (gt(a, ZERO)) return MAX;\\n if (lt(a, ZERO)) return MIN;\\n return ONE;\\n } else {\\n return divOut(a, b);\\n }\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First signed fixed-decimal\\n * @param b Signed number to multiply by\\n * @param c Signed number to divide by\\n * @return Resulting computation\\n */\\n function muldiv(Fixed6 a, int256 b, int256 c) internal pure returns (Fixed6) {\\n return muldiv(a, Fixed6.wrap(b), Fixed6.wrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First signed fixed-decimal\\n * @param b Signed number to multiply by\\n * @param c Signed number to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(Fixed6 a, int256 b, int256 c) internal pure returns (Fixed6) {\\n return muldivOut(a, Fixed6.wrap(b), Fixed6.wrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First signed fixed-decimal\\n * @param b Signed fixed-decimal to multiply by\\n * @param c Signed fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldiv(Fixed6 a, Fixed6 b, Fixed6 c) internal pure returns (Fixed6) {\\n return Fixed6.wrap(Fixed6.unwrap(a) * Fixed6.unwrap(b) / Fixed6.unwrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First signed fixed-decimal\\n * @param b Signed fixed-decimal to multiply by\\n * @param c Signed fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(Fixed6 a, Fixed6 b, Fixed6 c) internal pure returns (Fixed6) {\\n return Fixed6.wrap(NumberMath.divOut(Fixed6.unwrap(a) * Fixed6.unwrap(b), Fixed6.unwrap(c)));\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is equal to `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is equal to `b`\\n */\\n function eq(Fixed6 a, Fixed6 b) internal pure returns (bool) {\\n return compare(a, b) == 1;\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is greater than `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is greater than `b`\\n */\\n function gt(Fixed6 a, Fixed6 b) internal pure returns (bool) {\\n return compare(a, b) == 2;\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is less than `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is less than `b`\\n */\\n function lt(Fixed6 a, Fixed6 b) internal pure returns (bool) {\\n return compare(a, b) == 0;\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is greater than or equal to `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is greater than or equal to `b`\\n */\\n function gte(Fixed6 a, Fixed6 b) internal pure returns (bool) {\\n return gt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Returns whether signed fixed-decimal `a` is less than or equal to `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Whether `a` is less than or equal to `b`\\n */\\n function lte(Fixed6 a, Fixed6 b) internal pure returns (bool) {\\n return lt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Compares the signed fixed-decimals `a` and `b`\\n * @dev Returns: 2 for greater than\\n * 1 for equal to\\n * 0 for less than\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Compare result of `a` and `b`\\n */\\n function compare(Fixed6 a, Fixed6 b) internal pure returns (uint256) {\\n (int256 au, int256 bu) = (Fixed6.unwrap(a), Fixed6.unwrap(b));\\n if (au > bu) return 2;\\n if (au < bu) return 0;\\n return 1;\\n }\\n\\n /**\\n * @notice Returns a signed fixed-decimal representing the ratio of `a` over `b`\\n * @param a First signed number\\n * @param b Second signed number\\n * @return Ratio of `a` over `b`\\n */\\n function ratio(int256 a, int256 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(a * BASE / b);\\n }\\n\\n /**\\n * @notice Returns the minimum of signed fixed-decimals `a` and `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Minimum of `a` and `b`\\n */\\n function min(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(SignedMath.min(Fixed6.unwrap(a), Fixed6.unwrap(b)));\\n }\\n\\n /**\\n * @notice Returns the maximum of signed fixed-decimals `a` and `b`\\n * @param a First signed fixed-decimal\\n * @param b Second signed fixed-decimal\\n * @return Maximum of `a` and `b`\\n */\\n function max(Fixed6 a, Fixed6 b) internal pure returns (Fixed6) {\\n return Fixed6.wrap(SignedMath.max(Fixed6.unwrap(a), Fixed6.unwrap(b)));\\n }\\n\\n /**\\n * @notice Converts the signed fixed-decimal into an integer, truncating any decimal portion\\n * @param a Signed fixed-decimal\\n * @return Truncated signed number\\n */\\n function truncate(Fixed6 a) internal pure returns (int256) {\\n return Fixed6.unwrap(a) / BASE;\\n }\\n\\n /**\\n * @notice Returns the sign of the signed fixed-decimal\\n * @dev Returns: -1 for negative\\n * 0 for zero\\n * 1 for positive\\n * @param a Signed fixed-decimal\\n * @return Sign of the signed fixed-decimal\\n */\\n function sign(Fixed6 a) internal pure returns (int256) {\\n if (Fixed6.unwrap(a) > 0) return 1;\\n if (Fixed6.unwrap(a) < 0) return -1;\\n return 0;\\n }\\n\\n /**\\n * @notice Returns the absolute value of the signed fixed-decimal\\n * @param a Signed fixed-decimal\\n * @return Absolute value of the signed fixed-decimal\\n */\\n function abs(Fixed6 a) internal pure returns (UFixed6) {\\n return UFixed6.wrap(SignedMath.abs(Fixed6.unwrap(a)));\\n }\\n}\\n\\nlibrary Fixed6StorageLib {\\n function read(Fixed6Storage self) internal view returns (Fixed6 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n function store(Fixed6Storage self, Fixed6 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xba2715da2fdf9393cc5e3ce7f9a38f7bfd3b271dcbf9a7fac5245f7c3ecc4522\",\"license\":\"Apache-2.0\"},\"@equilibria/root/number/types/UFixed18.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"../NumberMath.sol\\\";\\nimport \\\"./Fixed18.sol\\\";\\nimport \\\"./UFixed6.sol\\\";\\n\\n/// @dev UFixed18 type\\ntype UFixed18 is uint256;\\nusing UFixed18Lib for UFixed18 global;\\ntype UFixed18Storage is bytes32;\\nusing UFixed18StorageLib for UFixed18Storage global;\\n\\n/**\\n * @title UFixed18Lib\\n * @notice Library for the unsigned fixed-decimal type.\\n */\\nlibrary UFixed18Lib {\\n error UFixed18UnderflowError(int256 value);\\n\\n uint256 private constant BASE = 1e18;\\n UFixed18 public constant ZERO = UFixed18.wrap(0);\\n UFixed18 public constant ONE = UFixed18.wrap(BASE);\\n UFixed18 public constant MAX = UFixed18.wrap(type(uint256).max);\\n\\n /**\\n * @notice Creates a unsigned fixed-decimal from a signed fixed-decimal\\n * @param a Signed fixed-decimal\\n * @return New unsigned fixed-decimal\\n */\\n function from(Fixed18 a) internal pure returns (UFixed18) {\\n int256 value = Fixed18.unwrap(a);\\n if (value < 0) revert UFixed18UnderflowError(value);\\n return UFixed18.wrap(uint256(value));\\n }\\n\\n /**\\n * @notice Creates a unsigned fixed-decimal from a unsigned integer\\n * @param a Unsigned number\\n * @return New unsigned fixed-decimal\\n */\\n function from(uint256 a) internal pure returns (UFixed18) {\\n return UFixed18.wrap(a * BASE);\\n }\\n\\n /**\\n * @notice Creates a signed fixed-decimal from a base-6 signed fixed-decimal\\n * @param a Base-6 signed fixed-decimal\\n * @return New signed fixed-decimal\\n */\\n function from(UFixed6 a) internal pure returns (UFixed18) {\\n return UFixed18.wrap(UFixed6.unwrap(a) * 1e12);\\n }\\n\\n /**\\n * @notice Returns whether the unsigned fixed-decimal is equal to zero.\\n * @param a Unsigned fixed-decimal\\n * @return Whether the unsigned fixed-decimal is zero.\\n */\\n function isZero(UFixed18 a) internal pure returns (bool) {\\n return UFixed18.unwrap(a) == 0;\\n }\\n\\n /**\\n * @notice Adds two unsigned fixed-decimals `a` and `b` together\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Resulting summed unsigned fixed-decimal\\n */\\n function add(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(UFixed18.unwrap(a) + UFixed18.unwrap(b));\\n }\\n\\n /**\\n * @notice Subtracts unsigned fixed-decimal `b` from `a`\\n * @param a Unsigned fixed-decimal to subtract from\\n * @param b Unsigned fixed-decimal to subtract\\n * @return Resulting subtracted unsigned fixed-decimal\\n */\\n function sub(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(UFixed18.unwrap(a) - UFixed18.unwrap(b));\\n }\\n\\n /**\\n * @notice Multiplies two unsigned fixed-decimals `a` and `b` together\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Resulting multiplied unsigned fixed-decimal\\n */\\n function mul(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(UFixed18.unwrap(a) * UFixed18.unwrap(b) / BASE);\\n }\\n\\n /**\\n * @notice Multiplies two unsigned fixed-decimals `a` and `b` together, rounding the result up to the next integer if there is a remainder\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Resulting multiplied unsigned fixed-decimal\\n */\\n function mulOut(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(NumberMath.divOut(UFixed18.unwrap(a) * UFixed18.unwrap(b), BASE));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function div(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(UFixed18.unwrap(a) * BASE / UFixed18.unwrap(b));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`, rounding the result up to the next integer if there is a remainder\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function divOut(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(NumberMath.divOut(UFixed18.unwrap(a) * BASE, UFixed18.unwrap(b)));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0` and `MAX` for `n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDiv(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n if (isZero(b)) {\\n return isZero(a) ? ONE : MAX;\\n } else {\\n return div(a, b);\\n }\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`, rounding the result up to the next integer if there is a remainder\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0` and `MAX` for `n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDivOut(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n if (isZero(b)) {\\n return isZero(a) ? ONE : MAX;\\n } else {\\n return divOut(a, b);\\n }\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned number to multiply by\\n * @param c Unsigned number to divide by\\n * @return Resulting computation\\n */\\n function muldiv(UFixed18 a, uint256 b, uint256 c) internal pure returns (UFixed18) {\\n return muldiv(a, UFixed18.wrap(b), UFixed18.wrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned number to multiply by\\n * @param c Unsigned number to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(UFixed18 a, uint256 b, uint256 c) internal pure returns (UFixed18) {\\n return muldivOut(a, UFixed18.wrap(b), UFixed18.wrap(c));\\n }\\n\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned fixed-decimal to multiply by\\n * @param c Unsigned fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldiv(UFixed18 a, UFixed18 b, UFixed18 c) internal pure returns (UFixed18) {\\n return UFixed18.wrap(UFixed18.unwrap(a) * UFixed18.unwrap(b) / UFixed18.unwrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned fixed-decimal to multiply by\\n * @param c Unsigned fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(UFixed18 a, UFixed18 b, UFixed18 c) internal pure returns (UFixed18) {\\n return UFixed18.wrap(NumberMath.divOut(UFixed18.unwrap(a) * UFixed18.unwrap(b), UFixed18.unwrap(c)));\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is equal to `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is equal to `b`\\n */\\n function eq(UFixed18 a, UFixed18 b) internal pure returns (bool) {\\n return compare(a, b) == 1;\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is greater than `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is greater than `b`\\n */\\n function gt(UFixed18 a, UFixed18 b) internal pure returns (bool) {\\n return compare(a, b) == 2;\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is less than `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is less than `b`\\n */\\n function lt(UFixed18 a, UFixed18 b) internal pure returns (bool) {\\n return compare(a, b) == 0;\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is greater than or equal to `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is greater than or equal to `b`\\n */\\n function gte(UFixed18 a, UFixed18 b) internal pure returns (bool) {\\n return gt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is less than or equal to `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is less than or equal to `b`\\n */\\n function lte(UFixed18 a, UFixed18 b) internal pure returns (bool) {\\n return lt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Compares the unsigned fixed-decimals `a` and `b`\\n * @dev Returns: 2 for greater than\\n * 1 for equal to\\n * 0 for less than\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Compare result of `a` and `b`\\n */\\n function compare(UFixed18 a, UFixed18 b) internal pure returns (uint256) {\\n (uint256 au, uint256 bu) = (UFixed18.unwrap(a), UFixed18.unwrap(b));\\n if (au > bu) return 2;\\n if (au < bu) return 0;\\n return 1;\\n }\\n\\n /**\\n * @notice Returns a unsigned fixed-decimal representing the ratio of `a` over `b`\\n * @param a First unsigned number\\n * @param b Second unsigned number\\n * @return Ratio of `a` over `b`\\n */\\n function ratio(uint256 a, uint256 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(a * BASE / b);\\n }\\n\\n /**\\n * @notice Returns the minimum of unsigned fixed-decimals `a` and `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Minimum of `a` and `b`\\n */\\n function min(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(Math.min(UFixed18.unwrap(a), UFixed18.unwrap(b)));\\n }\\n\\n /**\\n * @notice Returns the maximum of unsigned fixed-decimals `a` and `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Maximum of `a` and `b`\\n */\\n function max(UFixed18 a, UFixed18 b) internal pure returns (UFixed18) {\\n return UFixed18.wrap(Math.max(UFixed18.unwrap(a), UFixed18.unwrap(b)));\\n }\\n\\n /**\\n * @notice Converts the unsigned fixed-decimal into an integer, truncating any decimal portion\\n * @param a Unsigned fixed-decimal\\n * @return Truncated unsigned number\\n */\\n function truncate(UFixed18 a) internal pure returns (uint256) {\\n return UFixed18.unwrap(a) / BASE;\\n }\\n}\\n\\nlibrary UFixed18StorageLib {\\n function read(UFixed18Storage self) internal view returns (UFixed18 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n function store(UFixed18Storage self, UFixed18 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8497089d30704af15ad095173e6e32dd38ef8f6213b8eca613182aec02d90fd4\",\"license\":\"Apache-2.0\"},\"@equilibria/root/number/types/UFixed6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/utils/math/Math.sol\\\";\\nimport \\\"../NumberMath.sol\\\";\\nimport \\\"./Fixed6.sol\\\";\\nimport \\\"./UFixed18.sol\\\";\\n\\n/// @dev UFixed6 type\\ntype UFixed6 is uint256;\\nusing UFixed6Lib for UFixed6 global;\\ntype UFixed6Storage is bytes32;\\nusing UFixed6StorageLib for UFixed6Storage global;\\n\\n/**\\n * @title UFixed6Lib\\n * @notice Library for the unsigned fixed-decimal type.\\n */\\nlibrary UFixed6Lib {\\n error UFixed6UnderflowError(int256 value);\\n\\n uint256 private constant BASE = 1e6;\\n UFixed6 public constant ZERO = UFixed6.wrap(0);\\n UFixed6 public constant ONE = UFixed6.wrap(BASE);\\n UFixed6 public constant MAX = UFixed6.wrap(type(uint256).max);\\n\\n /**\\n * @notice Creates a unsigned fixed-decimal from a signed fixed-decimal\\n * @param a Signed fixed-decimal\\n * @return New unsigned fixed-decimal\\n */\\n function from(Fixed6 a) internal pure returns (UFixed6) {\\n int256 value = Fixed6.unwrap(a);\\n if (value < 0) revert UFixed6UnderflowError(value);\\n return UFixed6.wrap(uint256(value));\\n }\\n\\n /**\\n * @notice Creates a unsigned fixed-decimal from a unsigned integer\\n * @param a Unsigned number\\n * @return New unsigned fixed-decimal\\n */\\n function from(uint256 a) internal pure returns (UFixed6) {\\n return UFixed6.wrap(a * BASE);\\n }\\n\\n /**\\n * @notice Creates an unsigned fixed-decimal from a base-18 unsigned fixed-decimal\\n * @param a Base-18 unsigned fixed-decimal\\n * @return New unsigned fixed-decimal\\n */\\n function from(UFixed18 a) internal pure returns (UFixed6) {\\n return UFixed6.wrap(UFixed18.unwrap(a) / 1e12);\\n }\\n\\n /**\\n * @notice Creates an unsigned fixed-decimal from a base-18 unsigned fixed-decimal\\n * @param a Base-18 unsigned fixed-decimal\\n * @param roundOut Whether to round the result away from zero if there is a remainder\\n * @return New unsigned fixed-decimal\\n */\\n function from(UFixed18 a, bool roundOut) internal pure returns (UFixed6) {\\n return roundOut ? UFixed6.wrap(NumberMath.divOut(UFixed18.unwrap(a), 1e12)): from(a);\\n }\\n\\n /**\\n * @notice Returns whether the unsigned fixed-decimal is equal to zero.\\n * @param a Unsigned fixed-decimal\\n * @return Whether the unsigned fixed-decimal is zero.\\n */\\n function isZero(UFixed6 a) internal pure returns (bool) {\\n return UFixed6.unwrap(a) == 0;\\n }\\n\\n /**\\n * @notice Adds two unsigned fixed-decimals `a` and `b` together\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Resulting summed unsigned fixed-decimal\\n */\\n function add(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(UFixed6.unwrap(a) + UFixed6.unwrap(b));\\n }\\n\\n /**\\n * @notice Subtracts unsigned fixed-decimal `b` from `a`\\n * @param a Unsigned fixed-decimal to subtract from\\n * @param b Unsigned fixed-decimal to subtract\\n * @return Resulting subtracted unsigned fixed-decimal\\n */\\n function sub(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(UFixed6.unwrap(a) - UFixed6.unwrap(b));\\n }\\n\\n /**\\n * @notice Multiplies two unsigned fixed-decimals `a` and `b` together\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Resulting multiplied unsigned fixed-decimal\\n */\\n function mul(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(UFixed6.unwrap(a) * UFixed6.unwrap(b) / BASE);\\n }\\n\\n /**\\n * @notice Multiplies two unsigned fixed-decimals `a` and `b` together, rounding the result up to the next integer if there is a remainder\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Resulting multiplied unsigned fixed-decimal\\n */\\n function mulOut(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(NumberMath.divOut(UFixed6.unwrap(a) * UFixed6.unwrap(b), BASE));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function div(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(UFixed6.unwrap(a) * BASE / UFixed6.unwrap(b));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`, rounding the result up to the next integer if there is a remainder\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function divOut(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(NumberMath.divOut(UFixed6.unwrap(a) * BASE, UFixed6.unwrap(b)));\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0` and `MAX` for `n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDiv(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n if (isZero(b)) {\\n return isZero(a) ? ONE : MAX;\\n } else {\\n return div(a, b);\\n }\\n }\\n\\n /**\\n * @notice Divides unsigned fixed-decimal `a` by `b`, rounding the result up to the next integer if there is a remainder\\n * @dev Does not revert on divide-by-0, instead returns `ONE` for `0/0` and `MAX` for `n/0`.\\n * @param a Unsigned fixed-decimal to divide\\n * @param b Unsigned fixed-decimal to divide by\\n * @return Resulting divided unsigned fixed-decimal\\n */\\n function unsafeDivOut(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n if (isZero(b)) {\\n return isZero(a) ? ONE : MAX;\\n } else {\\n return divOut(a, b);\\n }\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned number to multiply by\\n * @param c Unsigned number to divide by\\n * @return Resulting computation\\n */\\n function muldiv(UFixed6 a, uint256 b, uint256 c) internal pure returns (UFixed6) {\\n return muldiv(a, UFixed6.wrap(b), UFixed6.wrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned number to multiply by\\n * @param c Unsigned number to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(UFixed6 a, uint256 b, uint256 c) internal pure returns (UFixed6) {\\n return muldivOut(a, UFixed6.wrap(b), UFixed6.wrap(c));\\n }\\n\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned fixed-decimal to multiply by\\n * @param c Unsigned fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldiv(UFixed6 a, UFixed6 b, UFixed6 c) internal pure returns (UFixed6) {\\n return UFixed6.wrap(UFixed6.unwrap(a) * UFixed6.unwrap(b) / UFixed6.unwrap(c));\\n }\\n\\n /**\\n * @notice Computes a * b / c without loss of precision due to BASE conversion, rounding the result up to the next integer if there is a remainder\\n * @param a First unsigned fixed-decimal\\n * @param b Unsigned fixed-decimal to multiply by\\n * @param c Unsigned fixed-decimal to divide by\\n * @return Resulting computation\\n */\\n function muldivOut(UFixed6 a, UFixed6 b, UFixed6 c) internal pure returns (UFixed6) {\\n return UFixed6.wrap(NumberMath.divOut(UFixed6.unwrap(a) * UFixed6.unwrap(b), UFixed6.unwrap(c)));\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is equal to `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is equal to `b`\\n */\\n function eq(UFixed6 a, UFixed6 b) internal pure returns (bool) {\\n return compare(a, b) == 1;\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is greater than `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is greater than `b`\\n */\\n function gt(UFixed6 a, UFixed6 b) internal pure returns (bool) {\\n return compare(a, b) == 2;\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is less than `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is less than `b`\\n */\\n function lt(UFixed6 a, UFixed6 b) internal pure returns (bool) {\\n return compare(a, b) == 0;\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is greater than or equal to `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is greater than or equal to `b`\\n */\\n function gte(UFixed6 a, UFixed6 b) internal pure returns (bool) {\\n return gt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Returns whether unsigned fixed-decimal `a` is less than or equal to `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Whether `a` is less than or equal to `b`\\n */\\n function lte(UFixed6 a, UFixed6 b) internal pure returns (bool) {\\n return lt(a, b) || eq(a, b);\\n }\\n\\n /**\\n * @notice Compares the unsigned fixed-decimals `a` and `b`\\n * @dev Returns: 2 for greater than\\n * 1 for equal to\\n * 0 for less than\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Compare result of `a` and `b`\\n */\\n function compare(UFixed6 a, UFixed6 b) internal pure returns (uint256) {\\n (uint256 au, uint256 bu) = (UFixed6.unwrap(a), UFixed6.unwrap(b));\\n if (au > bu) return 2;\\n if (au < bu) return 0;\\n return 1;\\n }\\n\\n /**\\n * @notice Returns a unsigned fixed-decimal representing the ratio of `a` over `b`\\n * @param a First unsigned number\\n * @param b Second unsigned number\\n * @return Ratio of `a` over `b`\\n */\\n function ratio(uint256 a, uint256 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(a * BASE / b);\\n }\\n\\n /**\\n * @notice Returns the minimum of unsigned fixed-decimals `a` and `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Minimum of `a` and `b`\\n */\\n function min(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(Math.min(UFixed6.unwrap(a), UFixed6.unwrap(b)));\\n }\\n\\n /**\\n * @notice Returns the maximum of unsigned fixed-decimals `a` and `b`\\n * @param a First unsigned fixed-decimal\\n * @param b Second unsigned fixed-decimal\\n * @return Maximum of `a` and `b`\\n */\\n function max(UFixed6 a, UFixed6 b) internal pure returns (UFixed6) {\\n return UFixed6.wrap(Math.max(UFixed6.unwrap(a), UFixed6.unwrap(b)));\\n }\\n\\n /**\\n * @notice Converts the unsigned fixed-decimal into an integer, truncating any decimal portion\\n * @param a Unsigned fixed-decimal\\n * @return Truncated unsigned number\\n */\\n function truncate(UFixed6 a) internal pure returns (uint256) {\\n return UFixed6.unwrap(a) / BASE;\\n }\\n}\\n\\nlibrary UFixed6StorageLib {\\n function read(UFixed6Storage self) internal view returns (UFixed6 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n function store(UFixed6Storage self, UFixed6 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0b5d83bc38b4587bafd397b45b953154e12065ba3d5b755d52727dd92949b055\",\"license\":\"Apache-2.0\"},\"@equilibria/root/pid/types/PAccumulator6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../../number/types/Fixed6.sol\\\";\\nimport \\\"./PController6.sol\\\";\\n\\n/// @dev PAccumulator6 type\\nstruct PAccumulator6 {\\n Fixed6 _value;\\n Fixed6 _skew;\\n}\\nusing PAccumulator6Lib for PAccumulator6 global;\\n\\n/// @title PAccumulator6Lib\\n/// @notice Accumulator for a the fixed 6-decimal PID controller. This holds the \\\"last seen state\\\" of the PID controller\\n/// and works in conjunction with the PController6 to compute the current rate.\\n/// @dev This implementation is specifically a P controller, with I_k and D_k both set to 0. In between updates, it\\n/// continues to accumulate at a linear rate based on the previous skew, but the rate is capped at the max value.\\n/// Once the rate hits the max value, it will continue to accumulate at the max value until the next update.\\nlibrary PAccumulator6Lib {\\n /// @notice Accumulates the rate against notional given the prior and current state\\n /// @param self The controller accumulator\\n /// @param controller The controller configuration\\n /// @param skew The current skew\\n /// @param fromTimestamp The timestamp of the prior accumulation\\n /// @param toTimestamp The current timestamp\\n /// @param notional The notional to accumulate against\\n /// @return accumulated The total accumulated amount\\n function accumulate(\\n PAccumulator6 memory self,\\n PController6 memory controller,\\n Fixed6 skew,\\n uint256 fromTimestamp,\\n uint256 toTimestamp,\\n UFixed6 notional\\n ) internal pure returns (Fixed6 accumulated) {\\n // compute new value and intercept\\n (Fixed6 newValue, UFixed6 interceptTimestamp) =\\n controller.compute(self._value, self._skew, fromTimestamp, toTimestamp);\\n\\n // accumulate rate within max\\n accumulated = _accumulate(\\n self._value.add(newValue),\\n UFixed6Lib.from(fromTimestamp),\\n interceptTimestamp,\\n notional\\n ).div(Fixed6Lib.from(2)); // rate = self._value + newValue / 2 -> divide here for added precision\\n\\n // accumulate rate outside of max\\n accumulated = _accumulate(\\n newValue,\\n interceptTimestamp,\\n UFixed6Lib.from(toTimestamp),\\n notional\\n ).add(accumulated);\\n\\n // update values\\n self._value = newValue;\\n self._skew = skew;\\n }\\n\\n /// @notice Helper function to accumulate a singular rate against notional\\n /// @param rate The rate to accumulate\\n /// @param fromTimestamp The timestamp to accumulate from\\n /// @param toTimestamp The timestamp to accumulate to\\n /// @param notional The notional to accumulate against\\n /// @return The accumulated amount\\n function _accumulate(\\n Fixed6 rate,\\n UFixed6 fromTimestamp,\\n UFixed6 toTimestamp,\\n UFixed6 notional\\n ) private pure returns (Fixed6) {\\n return rate\\n .mul(Fixed6Lib.from(toTimestamp.sub(fromTimestamp)))\\n .mul(Fixed6Lib.from(notional))\\n .div(Fixed6Lib.from(365 days));\\n }\\n}\\n\",\"keccak256\":\"0xf374a9997426cc90141334cdc8f8d3d62758be7eaefd21c5885742cc18d79a3a\",\"license\":\"Apache-2.0\"},\"@equilibria/root/pid/types/PController6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../../number/types/Fixed6.sol\\\";\\n\\n/// @dev PController6 type\\nstruct PController6 {\\n UFixed6 k;\\n UFixed6 max;\\n}\\nusing PController6Lib for PController6 global;\\n\\n/// @title PController6Lib\\n/// @notice Configuration for a the fixed 6-decimal PID controller.\\n/// @dev Each second, the PID controller's value is incremented by `skew / k`, with `max` as the maximum value.\\nlibrary PController6Lib {\\n /// @notice compute the new value and intercept timestamp based on the prior controller state\\n /// @dev `interceptTimestamp` will never exceed `toTimestamp`\\n /// @param self the controller configuration\\n /// @param value the prior value\\n /// @param skew The prior skew\\n /// @param fromTimestamp The prior timestamp\\n /// @param toTimestamp The current timestamp\\n /// @return newValue the new value\\n /// @return interceptTimestamp the timestamp at which the value will be at the max\\n function compute(\\n PController6 memory self,\\n Fixed6 value,\\n Fixed6 skew,\\n uint256 fromTimestamp,\\n uint256 toTimestamp\\n ) internal pure returns (Fixed6 newValue, UFixed6 interceptTimestamp) {\\n // compute the new value without considering the max\\n Fixed6 newValueUncapped = value.add(\\n Fixed6Lib.from(int256(toTimestamp - fromTimestamp))\\n .mul(skew)\\n .div(Fixed6Lib.from(self.k))\\n );\\n\\n // cap the new value at the max\\n newValue = Fixed6Lib.from(newValueUncapped.sign(), self.max.min(newValueUncapped.abs()));\\n\\n // compute distance and range to the resultant value\\n (UFixed6 distance, Fixed6 range) = (UFixed6Lib.from(toTimestamp - fromTimestamp), newValueUncapped.sub(value));\\n\\n // compute the amount of buffer into the value is outside the max\\n UFixed6 buffer = value.abs().gt(self.max) ?\\n UFixed6Lib.ZERO :\\n Fixed6Lib.from(range.sign(), self.max).sub(value).abs();\\n\\n // compute the timestamp at which the value will be at the max\\n interceptTimestamp = range.isZero() ?\\n UFixed6Lib.from(toTimestamp) :\\n UFixed6Lib.from(fromTimestamp).add(distance.muldiv(buffer, range.abs())).min(UFixed6Lib.from(toTimestamp));\\n }\\n}\\n\",\"keccak256\":\"0xcf8baa97540b3a38e0daa82d80267b9df9deaeb229efacb49ee74200cae345d4\",\"license\":\"Apache-2.0\"},\"@equilibria/root/storage/Storage.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../number/types/UFixed18.sol\\\";\\n\\n/// @dev Stored boolean slot\\ntype BoolStorage is bytes32;\\nusing BoolStorageLib for BoolStorage global;\\n\\n/// @dev Stored uint256 slot\\ntype Uint256Storage is bytes32;\\nusing Uint256StorageLib for Uint256Storage global;\\n\\n/// @dev Stored int256 slot\\ntype Int256Storage is bytes32;\\nusing Int256StorageLib for Int256Storage global;\\n\\n/// @dev Stored address slot\\ntype AddressStorage is bytes32;\\nusing AddressStorageLib for AddressStorage global;\\n\\n/// @dev Stored bytes32 slot\\ntype Bytes32Storage is bytes32;\\nusing Bytes32StorageLib for Bytes32Storage global;\\n\\n/**\\n * @title BoolStorageLib\\n * @notice Library to manage storage and retrieval of a boolean at a fixed storage slot\\n */\\nlibrary BoolStorageLib {\\n /**\\n * @notice Retrieves the stored value\\n * @param self Storage slot\\n * @return value Stored bool value\\n */\\n function read(BoolStorage self) internal view returns (bool value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n /**\\n * @notice Stores the value at the specific slot\\n * @param self Storage slot\\n * @param value boolean value to store\\n */\\n function store(BoolStorage self, bool value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\\n/**\\n * @title Uint256StorageLib\\n * @notice Library to manage storage and retrieval of an uint256 at a fixed storage slot\\n */\\nlibrary Uint256StorageLib {\\n /**\\n * @notice Retrieves the stored value\\n * @param self Storage slot\\n * @return value Stored uint256 value\\n */\\n function read(Uint256Storage self) internal view returns (uint256 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n /**\\n * @notice Stores the value at the specific slot\\n * @param self Storage slot\\n * @param value uint256 value to store\\n */\\n function store(Uint256Storage self, uint256 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\\n/**\\n * @title Int256StorageLib\\n * @notice Library to manage storage and retrieval of an int256 at a fixed storage slot\\n */\\nlibrary Int256StorageLib {\\n /**\\n * @notice Retrieves the stored value\\n * @param self Storage slot\\n * @return value Stored int256 value\\n */\\n function read(Int256Storage self) internal view returns (int256 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n /**\\n * @notice Stores the value at the specific slot\\n * @param self Storage slot\\n * @param value int256 value to store\\n */\\n function store(Int256Storage self, int256 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\\n/**\\n * @title AddressStorageLib\\n * @notice Library to manage storage and retrieval of an address at a fixed storage slot\\n */\\nlibrary AddressStorageLib {\\n /**\\n * @notice Retrieves the stored value\\n * @param self Storage slot\\n * @return value Stored address value\\n */\\n function read(AddressStorage self) internal view returns (address value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n /**\\n * @notice Stores the value at the specific slot\\n * @param self Storage slot\\n * @param value address value to store\\n */\\n function store(AddressStorage self, address value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\\n/**\\n * @title Bytes32StorageLib\\n * @notice Library to manage storage and retrieval of a bytes32 at a fixed storage slot\\n */\\nlibrary Bytes32StorageLib {\\n /**\\n * @notice Retrieves the stored value\\n * @param self Storage slot\\n * @return value Stored bytes32 value\\n */\\n function read(Bytes32Storage self) internal view returns (bytes32 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n /**\\n * @notice Stores the value at the specific slot\\n * @param self Storage slot\\n * @param value bytes32 value to store\\n */\\n function store(Bytes32Storage self, bytes32 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf904e2f3ded161530d179eca7f405de56db377f4770e236589940b943ef0dee9\",\"license\":\"Apache-2.0\"},\"@equilibria/root/token/types/Token18.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport \\\"../../number/types/UFixed18.sol\\\";\\n\\n/// @dev Token18\\ntype Token18 is address;\\nusing Token18Lib for Token18 global;\\ntype Token18Storage is bytes32;\\nusing Token18StorageLib for Token18Storage global;\\n\\n/**\\n * @title Token18Lib\\n * @notice Library to manage 18-decimal ERC20s that is compliant with the fixed-decimal types.\\n * @dev Maintains significant gas savings over other Token implementations since no conversion take place\\n */\\nlibrary Token18Lib {\\n using SafeERC20 for IERC20;\\n\\n Token18 public constant ZERO = Token18.wrap(address(0));\\n\\n /**\\n * @notice Returns whether a token is the zero address\\n * @param self Token to check for\\n * @return Whether the token is the zero address\\n */\\n function isZero(Token18 self) internal pure returns (bool) {\\n return Token18.unwrap(self) == Token18.unwrap(ZERO);\\n }\\n\\n /**\\n * @notice Returns whether the two tokens are equal\\n * @param a First token to compare\\n * @param b Second token to compare\\n * @return Whether the two tokens are equal\\n */\\n function eq(Token18 a, Token18 b) internal pure returns (bool) {\\n return Token18.unwrap(a) == Token18.unwrap(b);\\n }\\n\\n /**\\n * @notice Approves `grantee` to spend infinite tokens from the caller\\n * @dev Uses `approve` rather than `safeApprove` since the race condition\\n * in safeApprove does not apply when going to an infinite approval\\n * @param self Token to grant approval\\n * @param grantee Address to allow spending\\n */\\n function approve(Token18 self, address grantee) internal {\\n IERC20(Token18.unwrap(self)).approve(grantee, type(uint256).max);\\n }\\n\\n /**\\n * @notice Approves `grantee` to spend `amount` tokens from the caller\\n * @dev There are important race conditions to be aware of when using this function\\n with values other than 0. This will revert if moving from non-zero to non-zero amounts\\n See https://github.com/OpenZeppelin/openzeppelin-contracts/blob/a55b7d13722e7ce850b626da2313f3e66ca1d101/contracts/token/ERC20/IERC20.sol#L57\\n * @param self Token to grant approval\\n * @param grantee Address to allow spending\\n * @param amount Amount of tokens to approve to spend\\n */\\n function approve(Token18 self, address grantee, UFixed18 amount) internal {\\n IERC20(Token18.unwrap(self)).safeApprove(grantee, UFixed18.unwrap(amount));\\n }\\n\\n /**\\n * @notice Transfers all held tokens from the caller to the `recipient`\\n * @param self Token to transfer\\n * @param recipient Address to receive the tokens\\n */\\n function push(Token18 self, address recipient) internal {\\n push(self, recipient, balanceOf(self, address(this)));\\n }\\n\\n /**\\n * @notice Transfers `amount` tokens from the caller to the `recipient`\\n * @param self Token to transfer\\n * @param recipient Address to transfer tokens to\\n * @param amount Amount of tokens to transfer\\n */\\n function push(Token18 self, address recipient, UFixed18 amount) internal {\\n IERC20(Token18.unwrap(self)).safeTransfer(recipient, UFixed18.unwrap(amount));\\n }\\n\\n /**\\n * @notice Transfers `amount` tokens from the `benefactor` to the caller\\n * @dev Reverts if trying to pull Ether\\n * @param self Token to transfer\\n * @param benefactor Address to transfer tokens from\\n * @param amount Amount of tokens to transfer\\n */\\n function pull(Token18 self, address benefactor, UFixed18 amount) internal {\\n IERC20(Token18.unwrap(self)).safeTransferFrom(benefactor, address(this), UFixed18.unwrap(amount));\\n }\\n\\n /**\\n * @notice Transfers `amount` tokens from the `benefactor` to `recipient`\\n * @dev Reverts if trying to pull Ether\\n * @param self Token to transfer\\n * @param benefactor Address to transfer tokens from\\n * @param recipient Address to transfer tokens to\\n * @param amount Amount of tokens to transfer\\n */\\n function pullTo(Token18 self, address benefactor, address recipient, UFixed18 amount) internal {\\n IERC20(Token18.unwrap(self)).safeTransferFrom(benefactor, recipient, UFixed18.unwrap(amount));\\n }\\n\\n /**\\n * @notice Returns the name of the token\\n * @param self Token to check for\\n * @return Token name\\n */\\n function name(Token18 self) internal view returns (string memory) {\\n return IERC20Metadata(Token18.unwrap(self)).name();\\n }\\n\\n /**\\n * @notice Returns the symbol of the token\\n * @param self Token to check for\\n * @return Token symbol\\n */\\n function symbol(Token18 self) internal view returns (string memory) {\\n return IERC20Metadata(Token18.unwrap(self)).symbol();\\n }\\n\\n /**\\n * @notice Returns the `self` token balance of the caller\\n * @param self Token to check for\\n * @return Token balance of the caller\\n */\\n function balanceOf(Token18 self) internal view returns (UFixed18) {\\n return balanceOf(self, address(this));\\n }\\n\\n /**\\n * @notice Returns the `self` token balance of `account`\\n * @param self Token to check for\\n * @param account Account to check\\n * @return Token balance of the account\\n */\\n function balanceOf(Token18 self, address account) internal view returns (UFixed18) {\\n return UFixed18.wrap(IERC20(Token18.unwrap(self)).balanceOf(account));\\n }\\n}\\n\\nlibrary Token18StorageLib {\\n function read(Token18Storage self) internal view returns (Token18 value) {\\n assembly (\\\"memory-safe\\\") {\\n value := sload(self)\\n }\\n }\\n\\n function store(Token18Storage self, Token18 value) internal {\\n assembly (\\\"memory-safe\\\") {\\n sstore(self, value)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa3f5e199ddf06e17cb492c99dc44a36d01cff8c28b4c57a62c1a330014d20ff7\",\"license\":\"Apache-2.0\"},\"@equilibria/root/utilization/CurveMath6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../number/types/UFixed6.sol\\\";\\nimport \\\"../number/types/Fixed6.sol\\\";\\n\\n/**\\n * @title CurveMath6\\n * @notice Library for managing math operations for utilization curves.\\n */\\nlibrary CurveMath6 {\\n error CurveMath6OutOfBoundsError();\\n\\n /**\\n * @notice Computes a linear interpolation between two points\\n * @param startX First point's x-coordinate\\n * @param startY First point's y-coordinate\\n * @param endX Second point's x-coordinate\\n * @param endY Second point's y-coordinate\\n * @param targetX x-coordinate to interpolate\\n * @return y-coordinate for `targetX` along the line from (`startX`, `startY`) -> (`endX`, `endY`)\\n */\\n function linearInterpolation(\\n UFixed6 startX,\\n Fixed6 startY,\\n UFixed6 endX,\\n Fixed6 endY,\\n UFixed6 targetX\\n ) internal pure returns (Fixed6) {\\n if (targetX.lt(startX) || targetX.gt(endX)) revert CurveMath6OutOfBoundsError();\\n\\n UFixed6 xRange = endX.sub(startX);\\n Fixed6 yRange = endY.sub(startY);\\n UFixed6 xRatio = targetX.sub(startX).div(xRange);\\n return yRange.mul(Fixed6Lib.from(xRatio)).add(startY);\\n }\\n\\n /**\\n * @notice Computes a linear interpolation between two points\\n * @param startX First point's x-coordinate\\n * @param startY First point's y-coordinate\\n * @param endX Second point's x-coordinate\\n * @param endY Second point's y-coordinate\\n * @param targetX x-coordinate to interpolate\\n * @return y-coordinate for `targetX` along the line from (`startX`, `startY`) -> (`endX`, `endY`)\\n */\\n function linearInterpolation(\\n UFixed6 startX,\\n UFixed6 startY,\\n UFixed6 endX,\\n UFixed6 endY,\\n UFixed6 targetX\\n ) internal pure returns (UFixed6) {\\n return UFixed6Lib.from(linearInterpolation(startX, Fixed6Lib.from(startY), endX, Fixed6Lib.from(endY), targetX));\\n }\\n}\\n\",\"keccak256\":\"0xb2fc0e4473772b0a48f7282ac06bf1e86cea7cf0c788e406692e2d723633d549\",\"license\":\"Apache-2.0\"},\"@equilibria/root/utilization/types/UJumpRateUtilizationCurve6.sol\":{\"content\":\"// SPDX-License-Identifier: Apache-2.0\\npragma solidity ^0.8.13;\\n\\nimport \\\"../CurveMath6.sol\\\";\\nimport \\\"../../number/types/UFixed6.sol\\\";\\n\\n/// @dev UJumpRateUtilizationCurve6 type\\nstruct UJumpRateUtilizationCurve6 {\\n UFixed6 minRate;\\n UFixed6 maxRate;\\n UFixed6 targetRate;\\n UFixed6 targetUtilization;\\n}\\nusing UJumpRateUtilizationCurve6Lib for UJumpRateUtilizationCurve6 global;\\n\\n/**\\n * @title UJumpRateUtilizationCurve6Lib\\n * @notice Library for the unsigned base-6 Jump Rate utilization curve type\\n */\\nlibrary UJumpRateUtilizationCurve6Lib {\\n /**\\n * @notice Computes the corresponding rate for a utilization ratio\\n * @param utilization The utilization ratio\\n * @return The corresponding rate\\n */\\n function compute(UJumpRateUtilizationCurve6 memory self, UFixed6 utilization) internal pure returns (UFixed6) {\\n if (utilization.lt(self.targetUtilization)) {\\n return CurveMath6.linearInterpolation(\\n UFixed6Lib.ZERO,\\n self.minRate,\\n self.targetUtilization,\\n self.targetRate,\\n utilization\\n );\\n }\\n if (utilization.lt(UFixed6Lib.ONE)) {\\n return CurveMath6.linearInterpolation(\\n self.targetUtilization,\\n self.targetRate,\\n UFixed6Lib.ONE,\\n self.maxRate,\\n utilization\\n );\\n }\\n return self.maxRate;\\n }\\n\\n function accumulate(\\n UJumpRateUtilizationCurve6 memory self,\\n UFixed6 utilization,\\n uint256 fromTimestamp,\\n uint256 toTimestamp,\\n UFixed6 notional\\n ) internal pure returns (UFixed6) {\\n return compute(self, utilization)\\n .mul(UFixed6Lib.from(toTimestamp - fromTimestamp))\\n .mul(notional)\\n .div(UFixed6Lib.from(365 days));\\n }\\n}\\n\",\"keccak256\":\"0xfc568a2f1a98e3659a2f4142f916e057fe6bf1ac70feb04ced81072d742c22e7\",\"license\":\"Apache-2.0\"},\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IBeacon.sol\\\";\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"../ERC1967/ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\\n *\\n * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't\\n * conflict with the storage layout of the implementation behind the proxy.\\n *\\n * _Available since v3.4._\\n */\\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the proxy with `beacon`.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This\\n * will typically be an encoded function call, and allows initializing the storage of the proxy like a Solidity\\n * constructor.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract with the interface {IBeacon}.\\n */\\n constructor(address beacon, bytes memory data) payable {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n\\n /**\\n * @dev Returns the current beacon address.\\n */\\n function _beacon() internal view virtual returns (address) {\\n return _getBeacon();\\n }\\n\\n /**\\n * @dev Returns the current implementation address of the associated beacon.\\n */\\n function _implementation() internal view virtual override returns (address) {\\n return IBeacon(_getBeacon()).implementation();\\n }\\n\\n /**\\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\\n *\\n * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon.\\n *\\n * Requirements:\\n *\\n * - `beacon` must be a contract.\\n * - The implementation returned by `beacon` must be a contract.\\n */\\n function _setBeacon(address beacon, bytes memory data) internal virtual {\\n _upgradeBeaconToAndCall(beacon, data, false);\\n }\\n}\\n\",\"keccak256\":\"0x85439e74ab467b6a23d45d32bdc9506cbc3760320289afd605f11638c4138e95\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.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(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x9750c6b834f7b43000631af5cc30001c5f547b3ceb3635488f140f60e897ea6b\",\"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\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-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 IERC20Permit {\\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\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/draft-IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.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 SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(\\n IERC20 token,\\n address to,\\n uint256 value\\n ) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(\\n IERC20 token,\\n address from,\\n address to,\\n uint256 value\\n ) 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(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) 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 function safeIncreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n\\n function safeDecreaseAllowance(\\n IERC20 token,\\n address spender,\\n uint256 value\\n ) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n }\\n }\\n\\n function safePermit(\\n IERC20Permit 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(IERC20 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 if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9b72f93be69ca894d8492c244259615c4a742afc8d63720dbc8bb81087d9b238\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\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 *\\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://diligence.consensys.net/posts/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.5.11/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(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) 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\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two signed numbers.\\n */\\n function min(int256 a, int256 b) internal pure returns (int256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two signed numbers without overflow.\\n * The result is rounded towards zero.\\n */\\n function average(int256 a, int256 b) internal pure returns (int256) {\\n // Formula from the book \\\"Hacker's Delight\\\"\\n int256 x = (a & b) + ((a ^ b) >> 1);\\n return x + (int256(uint256(x) >> 255) & (a ^ b));\\n }\\n\\n /**\\n * @dev Returns the absolute unsigned value of a signed value.\\n */\\n function abs(int256 n) internal pure returns (uint256) {\\n unchecked {\\n // must be unchecked in order to support `n = type(int256).min`\\n return uint256(n >= 0 ? n : -n);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60a03461006a57601f6126f638819003918201601f19168301916001600160401b0383118484101761006f5780849260209460405283398101031261006a57516001600160a01b038116810361006a576080526040516126709081610086823960805181610f740152f35b600080fd5b634e487b7160e01b600052604160045260246000fdfe604060808152600490813610156200001657600080fd5b600091823560e01c8063032bb4431462001a9c5780631d4632ac1462001a495780632302440814620018ac578063379607f5146200155f5780633f4ba83a14620014695780634420e48614620013595780634ae2ffc0146200110d578063554bab3c146200104057806357f3c0a51462000f985780635c60da1b1462000f275780635c975abb1462000ec7578063663ff5a91462000acf5780637bbf4a3f1462000a645780638456cb59146200093d5780638da5cb5b14620008c95780639fd0506d1462000855578063a81a267714620007f8578063b5ee695514620006fb578063b6a5d7de14620005e6578063b91816111462000593578063c4d66de814620003c2578063d4938db31462000383578063e30c3978146200030f578063ebbc496514620001ba5763fab52689146200014e57600080fd5b34620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6578160209360ff9273ffffffffffffffffffffffffffffffffffffffff620001a562001b48565b168252855220541690519015158152f35b8280fd5b508290346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b577f675c83682abbc3e7dd47e40515a778fbbde4393395c3dd3588244203c3e4788390815473ffffffffffffffffffffffffffffffffffffffff811690813303620002dc577fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed255807f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b600080a23303620002ac5750819055807f69f201bc2089b9be6195d876d97a0136b4cf56bbf8986a52dcb50697f7d1cac58180a280f35b6024908451907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b85517fd0d5e1b00000000000000000000000000000000000000000000000000000000081523381850152602490fd5b5080fd5b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5760209073ffffffffffffffffffffffffffffffffffffffff7f675c83682abbc3e7dd47e40515a778fbbde4393395c3dd3588244203c3e4788354915191168152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b576020906001549051908152f35b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b657620003fe62001b48565b7f6fee9688c285c5c5c97d6a1a29adced674e6b2ad0888b8ad2116b58a8b3ea2486001815410156200056357600190557f2801b00eb06461cf9fcb9758b5fafd884ff06a86177386f73b6c49f0bf5a5af09160018355303b1515806200055b575b6200052c57303b15158062000553575b6200052c5750918360209273ffffffffffffffffffffffffffffffffffffffff7fbe9b076dc5b65990cca9dd9d7366682482e7817a6f6bc7f4faf4dc32af497f3295337fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed255337f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b600080a2167fffffffffffffffffffffffff0000000000000000000000000000000000000000835416178255555160018152a180f35b83517fb9a621e1000000000000000000000000000000000000000000000000000000008152fd5b50846200046f565b50846200045f565b60248360018651917f3db738da000000000000000000000000000000000000000000000000000000008352820152fd5b5050346200030b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b57602090620005dd620005d762001b48565b62001c63565b90519015158152f35b509034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b65781359173ffffffffffffffffffffffffffffffffffffffff808416809403620006f7577fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed25433911603620006c85750816020917f6acfd92212f0ec670af78f8ba2273e4a85ac17023475650c25be0440602bff2d9385526002835280852060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905551908152a180f35b60249151907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b8480fd5b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6576200073762001b48565b907fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549273ffffffffffffffffffffffffffffffffffffffff938433911603620007c8575050807f675c83682abbc3e7dd47e40515a778fbbde4393395c3dd3588244203c3e4788355167f69f201bc2089b9be6195d876d97a0136b4cf56bbf8986a52dcb50697f7d1cac58280a280f35b6024925051907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6578160209373ffffffffffffffffffffffffffffffffffffffff92358152600385522054169051908152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5760209073ffffffffffffffffffffffffffffffffffffffff7f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b354915191168152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5760209073ffffffffffffffffffffffffffffffffffffffff7fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed254915191168152f35b509034620001b657827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b65773ffffffffffffffffffffffffffffffffffffffff807f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b35416331415908162000a35575b5062000a05578260017f3d13b7e57307bea7f94c474c597247d2da93d7de9136f8e123ed6525f50bbcec557f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e7528180a180f35b6024925051907ff7987a920000000000000000000000000000000000000000000000000000000082523390820152fd5b90507fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2541633141538620009b3565b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6573573ffffffffffffffffffffffffffffffffffffffff8116809103620001b657818360ff92602095526002855220541690519015158152f35b50913462000ec457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011262000ec45782359062000b0e62001b71565b7fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549073ffffffffffffffffffffffffffffffffffffffff91823391160362000e955781169485835260209581875260ff86852054161562000e6d578484526003875282868520541662000e4557866024918751928380927fa81a267700000000000000000000000000000000000000000000000000000000825289878301525afa90811562000e3b57908391859162000e07575b5016801562000ddf578551907fc4d66de80000000000000000000000000000000000000000000000000000000088830152602482015260248152606081019167ffffffffffffffff8284108185111762000db15783885261074183810192606084019283118684101762000d8557507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0939262000c749260a09262001efa8839309052896080820152018262001da4565b03019083f0801562000d7b57907fb37c10e9bd31f2f04a1985d7ae7c9fd566192aa02f769929da69b972f73ff9959392911692839162000cf38373ffffffffffffffffffffffffffffffffffffffff166000527f81796b4965de195665289d95668a8a9e7020858e15f5341c42bcf9951c1768ad602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055855195837f4fe45192317a7d3ad19c3eaa395c0c3a1b7a0f53c3536fb96764c3561a8e9dad8380a2848252600388528120837fffffffffffffffffffffffff000000000000000000000000000000000000000082541617905580a38152f35b84513d84823e3d90fd5b8760416024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6041827f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b5084517fe7911099000000000000000000000000000000000000000000000000000000008152fd5b62000e2c9150883d8a1162000e33575b62000e23818362001bd9565b81019062001c1b565b3862000bc3565b503d62000e17565b86513d86823e3d90fd5b5084517fe232e366000000000000000000000000000000000000000000000000000000008152fd5b5084517fbbfaa925000000000000000000000000000000000000000000000000000000008152fd5b84517f99bf63590000000000000000000000000000000000000000000000000000000081523381880152602490fd5b80fd5b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b576020907f3d13b7e57307bea7f94c474c597247d2da93d7de9136f8e123ed6525f50bbcec5490519015158152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b509034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6578135917fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed25473ffffffffffffffffffffffffffffffffffffffff33911603620006c85750816020917ffbf7b9ec922bb42be3c406407ab5eb0a4e4faac5955220c26f88821f03b60eac9360015551908152a180f35b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6576200107c62001b48565b907fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549273ffffffffffffffffffffffffffffffffffffffff938433911603620007c8575050807f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b355167fa4336c0cb1e245b95ad204faed7e940d6dc999684fd8b5e1ff597a0c4efca8ab8280a280f35b509190346200030b57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b578235906200114d62001b71565b937fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549473ffffffffffffffffffffffffffffffffffffffff958633911603620013295785169485855260209582875260ff84872054161562001301578486526003875281848720541615620012d957866024918551928380927fa81a267700000000000000000000000000000000000000000000000000000000825289888301525afa908115620012cf579082918791620012ad575b501693841562001285578596600391875252828520541692833b15620006f7576024859283855196879485937f1c1b87720000000000000000000000000000000000000000000000000000000085528401525af19081156200127c5750620012695750f35b620012749062001b95565b62000ec45780f35b513d84823e3d90fd5b8284517fe7911099000000000000000000000000000000000000000000000000000000008152fd5b620012c89150883d8a1162000e335762000e23818362001bd9565b3862001204565b84513d88823e3d90fd5b8284517ffeb0e18c000000000000000000000000000000000000000000000000000000008152fd5b8284517fbbfaa925000000000000000000000000000000000000000000000000000000008152fd5b5060249151907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b509034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6576200139662001b48565b7fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549073ffffffffffffffffffffffffffffffffffffffff9182339116036200143a5716808452602092835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519081527f937c362e6c36f9b94fecc2040d1311d0d3aa1373ae41c74b38ed937f8b6dbd2b9190a180f35b82517f99bf63590000000000000000000000000000000000000000000000000000000081523381860152602490fd5b509034620001b657827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b65773ffffffffffffffffffffffffffffffffffffffff807f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b35416331415908162001530575b5062000a055782807f3d13b7e57307bea7f94c474c597247d2da93d7de9136f8e123ed6525f50bbcec557fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d169338180a180f35b90507fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2541633141538620014df565b509034620001b657602090817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620018a85782356002620015a66001548362001e04565b14620018805733855283835260ff828620541615620018585773ffffffffffffffffffffffffffffffffffffffff85541664e8d4a51000918281029281840414901517156200182c57825190848201927fa9059cbb000000000000000000000000000000000000000000000000000000008452336024840152604483015260448252608082019267ffffffffffffffff9280851084861117620017fe5760c0810185811085821117620017d05786528685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460a082015251889182919082855af1903d15620017bf573d928311620017915790620016e5939291855192620016d7887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018562001bd9565b83523d898885013e62001e23565b80519081620016f2578580f35b83806200170493830101910162001c49565b15620017105780808580f35b6084935051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b6041877f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b90620016e593925060609162001e23565b6041897f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6041887f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6024866011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8382517fbbfaa925000000000000000000000000000000000000000000000000000000008152fd5b8382517f4ddc5544000000000000000000000000000000000000000000000000000000008152fd5b8380fd5b509190346200030b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b57823573ffffffffffffffffffffffffffffffffffffffff808216809203620018a85782517f7dc0d1d00000000000000000000000000000000000000000000000000000000081526020818781865afa90811562001a3f57916200198f9160ff93879162001a1c575b501673ffffffffffffffffffffffffffffffffffffffff166000527f81796b4965de195665289d95668a8a9e7020858e15f5341c42bcf9951c1768ad602052604060002090565b541615620019f457928383943b15620019ef5783918351809581937f99d32fc40000000000000000000000000000000000000000000000000000000083525af19081156200127c5750620019e1575080f35b620019ec9062001b95565b80f35b505050fd5b8382517f9dd1d227000000000000000000000000000000000000000000000000000000008152fd5b62001a38915060203d811162000e335762000e23818362001bd9565b3862001948565b84513d87823e3d90fd5b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b657359173ffffffffffffffffffffffffffffffffffffffff8316830362000ec4575060ff62001b3d60209373ffffffffffffffffffffffffffffffffffffffff166000527f81796b4965de195665289d95668a8a9e7020858e15f5341c42bcf9951c1768ad602052604060002090565b541690519015158152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820362001b6c57565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820362001b6c57565b67ffffffffffffffff811162001baa57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111762001baa57604052565b9081602091031262001b6c575173ffffffffffffffffffffffffffffffffffffffff8116810362001b6c5790565b9081602091031262001b6c5751801515810362001b6c5790565b6040517fc45a015500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216916020918281600481875afa90811562001d5b5760009162001d67575b501691604051907f032bb44300000000000000000000000000000000000000000000000000000000825260048201528181602481865afa90811562001d5b5760009162001d27575b501562001d20576002916000525260ff6040600020541690565b5050600090565b62001d4c9150823d841162001d53575b62001d43818362001bd9565b81019062001c49565b3862001d06565b503d62001d37565b6040513d6000823e3d90fd5b8381813d831162001d9c575b62001d7f818362001bd9565b810103126200030b575190828216820362000ec457503862001cbe565b503d62001d73565b919082519283825260005b84811062001def5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b60208183018101518483018201520162001daf565b81811162001e1c571062001e1757600190565b600090565b5050600290565b9192901562001ea1575081511562001e39575090565b3b1562001e435790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b82519091501562001eb55750805190602001fd5b62001ef5906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019062001da4565b0390fdfe608060409080825261074180380380916100198285610350565b8339810190828183031261034b5761003081610373565b6020828101516001600160401b039391929184821161034b57019084601f8301121561034b5781519161006283610387565b9261006f88519485610350565b8084528484019685828401011161034b57868561008c93016103a2565b803b156102f9578551635c60da1b60e01b80825292916001600160a01b0316908481600481855afa9081156102ee576000916102b9575b503b1561025c577fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b03191682179055865192817f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e600080a2825115801590610254575b610142575b87516102c890816104798239f35b6004848693819382525afa9182156102495760009261020f575b5085519360608501908111858210176101f9578652602784527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c83850152660819985a5b195960ca1b84870152516101e3946000918291845af4903d156101f0573d6101c781610387565b906101d488519283610350565b8152600081943d92013e6103c5565b5038808080808080610134565b606092506103c5565b634e487b7160e01b600052604160045260246000fd5b90918382813d8311610242575b6102268183610350565b8101031261023f575061023890610373565b903861015c565b80fd5b503d61021c565b86513d6000823e3d90fd5b50600061012f565b865162461bcd60e51b815260048101859052603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608490fd5b908582813d83116102e7575b6102cf8183610350565b8101031261023f57506102e190610373565b386100c3565b503d6102c5565b88513d6000823e3d90fd5b855162461bcd60e51b815260048101849052602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b6064820152608490fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176101f957604052565b51906001600160a01b038216820361034b57565b6001600160401b0381116101f957601f01601f191660200190565b60005b8381106103b55750506000910152565b81810151838201526020016103a5565b9192901561042757508151156103d9575090565b3b156103e25790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561043a5750805190602001fd5b6044604051809262461bcd60e51b82526020600483015261046a81518092816024860152602086860191016103a2565b601f01601f19168101030190fdfe6080806040523661011d5760208160048173ffffffffffffffffffffffffffffffffffffffff7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5054167f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa90811561011157600091610082575b506101f5565b6020903d8211610109575b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff8211176100dc576100d6935060405201610214565b3861007c565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b3d915061008d565b6040513d6000823e3d90fd5b6004602073ffffffffffffffffffffffffffffffffffffffff7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156101115760009161019957506101f5565b60203d81116101ee575b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f820116820182811067ffffffffffffffff8211176100dc576100d69350604052810190610266565b503d6101a3565b6000808092368280378136915af43d82803e15610210573d90f35b3d90fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8060209101126102615760805173ffffffffffffffffffffffffffffffffffffffff811681036102615790565b600080fd5b90816020910312610261575173ffffffffffffffffffffffffffffffffffffffff81168103610261579056fea2646970667358221220daf86900acfb28e586ea058dac4858519c232f66a9b314650fd6d1ad7f6a688964736f6c63430008130033a2646970667358221220b8756b918e1c96f51fbe973006cfa91706530208990011bd6aad638fce30cc2464736f6c63430008130033",
"deployedBytecode": "0x604060808152600490813610156200001657600080fd5b600091823560e01c8063032bb4431462001a9c5780631d4632ac1462001a495780632302440814620018ac578063379607f5146200155f5780633f4ba83a14620014695780634420e48614620013595780634ae2ffc0146200110d578063554bab3c146200104057806357f3c0a51462000f985780635c60da1b1462000f275780635c975abb1462000ec7578063663ff5a91462000acf5780637bbf4a3f1462000a645780638456cb59146200093d5780638da5cb5b14620008c95780639fd0506d1462000855578063a81a267714620007f8578063b5ee695514620006fb578063b6a5d7de14620005e6578063b91816111462000593578063c4d66de814620003c2578063d4938db31462000383578063e30c3978146200030f578063ebbc496514620001ba5763fab52689146200014e57600080fd5b34620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6578160209360ff9273ffffffffffffffffffffffffffffffffffffffff620001a562001b48565b168252855220541690519015158152f35b8280fd5b508290346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b577f675c83682abbc3e7dd47e40515a778fbbde4393395c3dd3588244203c3e4788390815473ffffffffffffffffffffffffffffffffffffffff811690813303620002dc577fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed255807f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b600080a23303620002ac5750819055807f69f201bc2089b9be6195d876d97a0136b4cf56bbf8986a52dcb50697f7d1cac58180a280f35b6024908451907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b85517fd0d5e1b00000000000000000000000000000000000000000000000000000000081523381850152602490fd5b5080fd5b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5760209073ffffffffffffffffffffffffffffffffffffffff7f675c83682abbc3e7dd47e40515a778fbbde4393395c3dd3588244203c3e4788354915191168152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b576020906001549051908152f35b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b657620003fe62001b48565b7f6fee9688c285c5c5c97d6a1a29adced674e6b2ad0888b8ad2116b58a8b3ea2486001815410156200056357600190557f2801b00eb06461cf9fcb9758b5fafd884ff06a86177386f73b6c49f0bf5a5af09160018355303b1515806200055b575b6200052c57303b15158062000553575b6200052c5750918360209273ffffffffffffffffffffffffffffffffffffffff7fbe9b076dc5b65990cca9dd9d7366682482e7817a6f6bc7f4faf4dc32af497f3295337fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed255337f4ffd725fc4a22075e9ec71c59edf9c38cdeb588a91b24fc5b61388c5be41282b600080a2167fffffffffffffffffffffffff0000000000000000000000000000000000000000835416178255555160018152a180f35b83517fb9a621e1000000000000000000000000000000000000000000000000000000008152fd5b50846200046f565b50846200045f565b60248360018651917f3db738da000000000000000000000000000000000000000000000000000000008352820152fd5b5050346200030b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b57602090620005dd620005d762001b48565b62001c63565b90519015158152f35b509034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b65781359173ffffffffffffffffffffffffffffffffffffffff808416809403620006f7577fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed25433911603620006c85750816020917f6acfd92212f0ec670af78f8ba2273e4a85ac17023475650c25be0440602bff2d9385526002835280852060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905551908152a180f35b60249151907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b8480fd5b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6576200073762001b48565b907fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549273ffffffffffffffffffffffffffffffffffffffff938433911603620007c8575050807f675c83682abbc3e7dd47e40515a778fbbde4393395c3dd3588244203c3e4788355167f69f201bc2089b9be6195d876d97a0136b4cf56bbf8986a52dcb50697f7d1cac58280a280f35b6024925051907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6578160209373ffffffffffffffffffffffffffffffffffffffff92358152600385522054169051908152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5760209073ffffffffffffffffffffffffffffffffffffffff7f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b354915191168152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5760209073ffffffffffffffffffffffffffffffffffffffff7fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed254915191168152f35b509034620001b657827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b65773ffffffffffffffffffffffffffffffffffffffff807f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b35416331415908162000a35575b5062000a05578260017f3d13b7e57307bea7f94c474c597247d2da93d7de9136f8e123ed6525f50bbcec557f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e7528180a180f35b6024925051907ff7987a920000000000000000000000000000000000000000000000000000000082523390820152fd5b90507fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2541633141538620009b3565b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6573573ffffffffffffffffffffffffffffffffffffffff8116809103620001b657818360ff92602095526002855220541690519015158152f35b50913462000ec457817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011262000ec45782359062000b0e62001b71565b7fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549073ffffffffffffffffffffffffffffffffffffffff91823391160362000e955781169485835260209581875260ff86852054161562000e6d578484526003875282868520541662000e4557866024918751928380927fa81a267700000000000000000000000000000000000000000000000000000000825289878301525afa90811562000e3b57908391859162000e07575b5016801562000ddf578551907fc4d66de80000000000000000000000000000000000000000000000000000000088830152602482015260248152606081019167ffffffffffffffff8284108185111762000db15783885261074183810192606084019283118684101762000d8557507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0939262000c749260a09262001efa8839309052896080820152018262001da4565b03019083f0801562000d7b57907fb37c10e9bd31f2f04a1985d7ae7c9fd566192aa02f769929da69b972f73ff9959392911692839162000cf38373ffffffffffffffffffffffffffffffffffffffff166000527f81796b4965de195665289d95668a8a9e7020858e15f5341c42bcf9951c1768ad602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055855195837f4fe45192317a7d3ad19c3eaa395c0c3a1b7a0f53c3536fb96764c3561a8e9dad8380a2848252600388528120837fffffffffffffffffffffffff000000000000000000000000000000000000000082541617905580a38152f35b84513d84823e3d90fd5b8760416024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6041827f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b5084517fe7911099000000000000000000000000000000000000000000000000000000008152fd5b62000e2c9150883d8a1162000e33575b62000e23818362001bd9565b81019062001c1b565b3862000bc3565b503d62000e17565b86513d86823e3d90fd5b5084517fe232e366000000000000000000000000000000000000000000000000000000008152fd5b5084517fbbfaa925000000000000000000000000000000000000000000000000000000008152fd5b84517f99bf63590000000000000000000000000000000000000000000000000000000081523381880152602490fd5b80fd5b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b576020907f3d13b7e57307bea7f94c474c597247d2da93d7de9136f8e123ed6525f50bbcec5490519015158152f35b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b509034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6578135917fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed25473ffffffffffffffffffffffffffffffffffffffff33911603620006c85750816020917ffbf7b9ec922bb42be3c406407ab5eb0a4e4faac5955220c26f88821f03b60eac9360015551908152a180f35b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6576200107c62001b48565b907fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549273ffffffffffffffffffffffffffffffffffffffff938433911603620007c8575050807f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b355167fa4336c0cb1e245b95ad204faed7e940d6dc999684fd8b5e1ff597a0c4efca8ab8280a280f35b509190346200030b57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b578235906200114d62001b71565b937fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549473ffffffffffffffffffffffffffffffffffffffff958633911603620013295785169485855260209582875260ff84872054161562001301578486526003875281848720541615620012d957866024918551928380927fa81a267700000000000000000000000000000000000000000000000000000000825289888301525afa908115620012cf579082918791620012ad575b501693841562001285578596600391875252828520541692833b15620006f7576024859283855196879485937f1c1b87720000000000000000000000000000000000000000000000000000000085528401525af19081156200127c5750620012695750f35b620012749062001b95565b62000ec45780f35b513d84823e3d90fd5b8284517fe7911099000000000000000000000000000000000000000000000000000000008152fd5b620012c89150883d8a1162000e335762000e23818362001bd9565b3862001204565b84513d88823e3d90fd5b8284517ffeb0e18c000000000000000000000000000000000000000000000000000000008152fd5b8284517fbbfaa925000000000000000000000000000000000000000000000000000000008152fd5b5060249151907f99bf63590000000000000000000000000000000000000000000000000000000082523390820152fd5b509034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b6576200139662001b48565b7fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2549073ffffffffffffffffffffffffffffffffffffffff9182339116036200143a5716808452602092835281842080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905590519081527f937c362e6c36f9b94fecc2040d1311d0d3aa1373ae41c74b38ed937f8b6dbd2b9190a180f35b82517f99bf63590000000000000000000000000000000000000000000000000000000081523381860152602490fd5b509034620001b657827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b65773ffffffffffffffffffffffffffffffffffffffff807f18e50ee9696440d335192aeeeffc26f47782eaa914f1700d8ad36d6d7f7261b35416331415908162001530575b5062000a055782807f3d13b7e57307bea7f94c474c597247d2da93d7de9136f8e123ed6525f50bbcec557fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d169338180a180f35b90507fe7742ddf0fecd2926e7ef4d6d6e91a7b2f0b1f8805b78953dac8454e86273ed2541633141538620014df565b509034620001b657602090817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620018a85782356002620015a66001548362001e04565b14620018805733855283835260ff828620541615620018585773ffffffffffffffffffffffffffffffffffffffff85541664e8d4a51000918281029281840414901517156200182c57825190848201927fa9059cbb000000000000000000000000000000000000000000000000000000008452336024840152604483015260448252608082019267ffffffffffffffff9280851084861117620017fe5760c0810185811085821117620017d05786528685527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656460a082015251889182919082855af1903d15620017bf573d928311620017915790620016e5939291855192620016d7887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116018562001bd9565b83523d898885013e62001e23565b80519081620016f2578580f35b83806200170493830101910162001c49565b15620017105780808580f35b6084935051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b6041877f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b90620016e593925060609162001e23565b6041897f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6041887f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b6024866011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8382517fbbfaa925000000000000000000000000000000000000000000000000000000008152fd5b8382517f4ddc5544000000000000000000000000000000000000000000000000000000008152fd5b8380fd5b509190346200030b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b57823573ffffffffffffffffffffffffffffffffffffffff808216809203620018a85782517f7dc0d1d00000000000000000000000000000000000000000000000000000000081526020818781865afa90811562001a3f57916200198f9160ff93879162001a1c575b501673ffffffffffffffffffffffffffffffffffffffff166000527f81796b4965de195665289d95668a8a9e7020858e15f5341c42bcf9951c1768ad602052604060002090565b541615620019f457928383943b15620019ef5783918351809581937f99d32fc40000000000000000000000000000000000000000000000000000000083525af19081156200127c5750620019e1575080f35b620019ec9062001b95565b80f35b505050fd5b8382517f9dd1d227000000000000000000000000000000000000000000000000000000008152fd5b62001a38915060203d811162000e335762000e23818362001bd9565b3862001948565b84513d87823e3d90fd5b5050346200030b57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126200030b5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5034620001b65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112620001b657359173ffffffffffffffffffffffffffffffffffffffff8316830362000ec4575060ff62001b3d60209373ffffffffffffffffffffffffffffffffffffffff166000527f81796b4965de195665289d95668a8a9e7020858e15f5341c42bcf9951c1768ad602052604060002090565b541690519015158152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820362001b6c57565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820362001b6c57565b67ffffffffffffffff811162001baa57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111762001baa57604052565b9081602091031262001b6c575173ffffffffffffffffffffffffffffffffffffffff8116810362001b6c5790565b9081602091031262001b6c5751801515810362001b6c5790565b6040517fc45a015500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff918216916020918281600481875afa90811562001d5b5760009162001d67575b501691604051907f032bb44300000000000000000000000000000000000000000000000000000000825260048201528181602481865afa90811562001d5b5760009162001d27575b501562001d20576002916000525260ff6040600020541690565b5050600090565b62001d4c9150823d841162001d53575b62001d43818362001bd9565b81019062001c49565b3862001d06565b503d62001d37565b6040513d6000823e3d90fd5b8381813d831162001d9c575b62001d7f818362001bd9565b810103126200030b575190828216820362000ec457503862001cbe565b503d62001d73565b919082519283825260005b84811062001def5750507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006020809697860101520116010190565b60208183018101518483018201520162001daf565b81811162001e1c571062001e1757600190565b600090565b5050600290565b9192901562001ea1575081511562001e39575090565b3b1562001e435790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b82519091501562001eb55750805190602001fd5b62001ef5906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019062001da4565b0390fdfe608060409080825261074180380380916100198285610350565b8339810190828183031261034b5761003081610373565b6020828101516001600160401b039391929184821161034b57019084601f8301121561034b5781519161006283610387565b9261006f88519485610350565b8084528484019685828401011161034b57868561008c93016103a2565b803b156102f9578551635c60da1b60e01b80825292916001600160a01b0316908481600481855afa9081156102ee576000916102b9575b503b1561025c577fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b03191682179055865192817f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e600080a2825115801590610254575b610142575b87516102c890816104798239f35b6004848693819382525afa9182156102495760009261020f575b5085519360608501908111858210176101f9578652602784527f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c83850152660819985a5b195960ca1b84870152516101e3946000918291845af4903d156101f0573d6101c781610387565b906101d488519283610350565b8152600081943d92013e6103c5565b5038808080808080610134565b606092506103c5565b634e487b7160e01b600052604160045260246000fd5b90918382813d8311610242575b6102268183610350565b8101031261023f575061023890610373565b903861015c565b80fd5b503d61021c565b86513d6000823e3d90fd5b50600061012f565b865162461bcd60e51b815260048101859052603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201526f1cc81b9bdd08184818dbdb9d1c9858dd60821b6064820152608490fd5b908582813d83116102e7575b6102cf8183610350565b8101031261023f57506102e190610373565b386100c3565b503d6102c5565b88513d6000823e3d90fd5b855162461bcd60e51b815260048101849052602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e6044820152641d1c9858dd60da1b6064820152608490fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176101f957604052565b51906001600160a01b038216820361034b57565b6001600160401b0381116101f957601f01601f191660200190565b60005b8381106103b55750506000910152565b81810151838201526020016103a5565b9192901561042757508151156103d9575090565b3b156103e25790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b82519091501561043a5750805190602001fd5b6044604051809262461bcd60e51b82526020600483015261046a81518092816024860152602086860191016103a2565b601f01601f19168101030190fdfe6080806040523661011d5760208160048173ffffffffffffffffffffffffffffffffffffffff7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5054167f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa90811561011157600091610082575b506101f5565b6020903d8211610109575b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f830116810181811067ffffffffffffffff8211176100dc576100d6935060405201610214565b3861007c565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b3d915061008d565b6040513d6000823e3d90fd5b6004602073ffffffffffffffffffffffffffffffffffffffff7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156101115760009161019957506101f5565b60203d81116101ee575b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f820116820182811067ffffffffffffffff8211176100dc576100d69350604052810190610266565b503d6101a3565b6000808092368280378136915af43d82803e15610210573d90f35b3d90fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8060209101126102615760805173ffffffffffffffffffffffffffffffffffffffff811681036102615790565b600080fd5b90816020910312610261575173ffffffffffffffffffffffffffffffffffffffff81168103610261579056fea2646970667358221220daf86900acfb28e586ea058dac4858519c232f66a9b314650fd6d1ad7f6a688964736f6c63430008130033a2646970667358221220b8756b918e1c96f51fbe973006cfa91706530208990011bd6aad638fce30cc2464736f6c63430008130033",
"devdoc": {
"kind": "dev",
"methods": {
"acceptOwner()": {
"details": "Can only be called by the pending owner to ensure correctness. Calls to the `_beforeAcceptOwner` hook to perform logic before updating ownership."
},
"authorize(address)": {
"params": {
"caller": "The factory to authorize"
}
},
"authorized(address)": {
"params": {
"caller": "The caller to check"
},
"returns": {
"_0": "Whether the caller is authorized"
}
},
"claim(uint256)": {
"details": "Can only be called by a registered underlying oracle provider factory",
"params": {
"amount": "The amount of tokens to claim"
}
},
"constructor": {
"params": {
"implementation_": "The implementation contract for the oracle"
}
},
"create(bytes32,address)": {
"params": {
"factory": "The initial underlying oracle factory for this oracle to use",
"id": "The id of the oracle to create"
},
"returns": {
"newOracle": "The newly created oracle instance"
}
},
"fund(address)": {
"params": {
"market": "The market to claim from"
}
},
"initialize(address)": {
"params": {
"incentive_": "The token that is paid out as a reward to oracle keepers"
}
},
"instances(address)": {
"params": {
"instance": "The instance to check"
},
"returns": {
"_0": "Whether the instance is valid"
}
},
"pause()": {
"details": "Can only be called by the pauser"
},
"register(address)": {
"params": {
"factory": "The factory to register"
}
},
"unpause()": {
"details": "Can only be called by the pauser"
},
"update(bytes32,address)": {
"params": {
"factory": "The new underlying oracle factory for this oracle to use",
"id": "The id of the oracle to update"
}
},
"updatePauser(address)": {
"details": "Can only be called by the current owner",
"params": {
"newPauser": "New pauser address"
}
},
"updatePendingOwner(address)": {
"details": "Can only be called by the current owner New owner does not take affect until that address calls `acceptOwner()`",
"params": {
"newPendingOwner": "New pending owner address"
}
}
},
"title": "OracleFactory",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {
"acceptOwner()": {
"notice": "Accepts and transfers the ownership of the contract to the pending owner"
},
"authorize(address)": {
"notice": "Authorizes a factory's instances to request from this contract"
},
"authorized(address)": {
"notice": "Checks whether a caller is authorized to request from this contract"
},
"callers(address)": {
"notice": "Mapping of which factory's instances are authorized to request from this contract"
},
"claim(uint256)": {
"notice": "Claims an amount of incentive tokens, to be paid out as a reward to the keeper"
},
"constructor": {
"notice": "Constructs the contract"
},
"create(bytes32,address)": {
"notice": "Creates a new oracle instance"
},
"factories(address)": {
"notice": "Mapping of factory to whether it is registered"
},
"implementation()": {
"notice": "The instance implementation address"
},
"incentive()": {
"notice": "The token that is paid out as a reward to oracle keepers"
},
"initialize(address)": {
"notice": "Initializes the contract state"
},
"instances(address)": {
"notice": "Returns whether the instance is valid"
},
"maxClaim()": {
"notice": "The maximum amount of tokens that can be rewarded in a single price update"
},
"oracles(bytes32)": {
"notice": "Mapping of oracle id to oracle instance"
},
"pause()": {
"notice": "Pauses the contract"
},
"register(address)": {
"notice": "Registers a new oracle provider factory to be used in the underlying oracle instances"
},
"unpause()": {
"notice": "Unpauses the contract"
},
"update(bytes32,address)": {
"notice": "Updates the underlying oracle factory for an oracle instance"
},
"updateMaxClaim(uint256)": {
"notice": "Updates the maximum amount of tokens that can be rewarded in a single price update"
},
"updatePauser(address)": {
"notice": "Updates the new pauser"
},
"updatePendingOwner(address)": {
"notice": "Updates the new pending owner"
}
},
"notice": "Factory for creating and managing oracles",
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 2985,
"contract": "@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol:OracleFactory",
"label": "incentive",
"offset": 0,
"slot": "0",
"type": "t_userDefinedValueType(Token18)28311"
},
{
"astId": 2989,
"contract": "@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol:OracleFactory",
"label": "maxClaim",
"offset": 0,
"slot": "1",
"type": "t_userDefinedValueType(UFixed6)27051"
},
{
"astId": 2995,
"contract": "@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol:OracleFactory",
"label": "callers",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_contract(IFactory)24163,t_bool)"
},
{
"astId": 3001,
"contract": "@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol:OracleFactory",
"label": "oracles",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_bytes32,t_contract(IOracleProvider)13958)"
},
{
"astId": 3007,
"contract": "@equilibria/perennial-v2-oracle/contracts/OracleFactory.sol:OracleFactory",
"label": "factories",
"offset": 0,
"slot": "4",
"type": "t_mapping(t_contract(IOracleProviderFactory)13985,t_bool)"
}
],
"types": {
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_contract(IFactory)24163": {
"encoding": "inplace",
"label": "contract IFactory",
"numberOfBytes": "20"
},
"t_contract(IOracleProvider)13958": {
"encoding": "inplace",
"label": "contract IOracleProvider",
"numberOfBytes": "20"
},
"t_contract(IOracleProviderFactory)13985": {
"encoding": "inplace",
"label": "contract IOracleProviderFactory",
"numberOfBytes": "20"
},
"t_mapping(t_bytes32,t_contract(IOracleProvider)13958)": {
"encoding": "mapping",
"key": "t_bytes32",
"label": "mapping(bytes32 => contract IOracleProvider)",
"numberOfBytes": "32",
"value": "t_contract(IOracleProvider)13958"
},
"t_mapping(t_contract(IFactory)24163,t_bool)": {
"encoding": "mapping",
"key": "t_contract(IFactory)24163",
"label": "mapping(contract IFactory => bool)",
"numberOfBytes": "32",
"value": "t_bool"
},
"t_mapping(t_contract(IOracleProviderFactory)13985,t_bool)": {
"encoding": "mapping",
"key": "t_contract(IOracleProviderFactory)13985",
"label": "mapping(contract IOracleProviderFactory => bool)",
"numberOfBytes": "32",
"value": "t_bool"
},
"t_userDefinedValueType(Token18)28311": {
"encoding": "inplace",
"label": "Token18",
"numberOfBytes": "20"
},
"t_userDefinedValueType(UFixed6)27051": {
"encoding": "inplace",
"label": "UFixed6",
"numberOfBytes": "32"
}
}
}
}