forked from 0xKaso/deploy-result
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFactory.json
795 lines (795 loc) · 183 KB
/
Factory.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
{
"address": "0xE76902E97203Cb9938d36C01E1ef975B4D394398",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "blabs",
"type": "address"
}
],
"name": "LOG_BLABS",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "sort",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "LOG_DEL_WHITELIST",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "manager",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
}
],
"name": "LOG_MANAGER",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "pool",
"type": "address"
}
],
"name": "LOG_NEW_POOL",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "oracle",
"type": "address"
}
],
"name": "LOG_ORACLE",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "router",
"type": "address"
}
],
"name": "LOG_ROUTER",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
}
],
"name": "LOG_USER_VAULT",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "vault",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
}
],
"name": "LOG_VAULT",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "sort",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "LOG_WHITELIST",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "etf",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "module",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "status",
"type": "bool"
}
],
"name": "MODULE_STATUS_CHANGE",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "sort",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "token",
"type": "address[]"
}
],
"name": "addTokenToWhitelist",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "bytecodes",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "token",
"type": "address"
}
],
"name": "collect",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getBLabs",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getColor",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "getManagerOwner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "etf",
"type": "address"
},
{
"internalType": "address",
"name": "module",
"type": "address"
}
],
"name": "getModuleStatus",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getOracleAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getSwapRouter",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getUserVault",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getVault",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "b",
"type": "address"
}
],
"name": "isLiquidityPool",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "sort",
"type": "uint256"
},
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "isTokenWhitelistedForVerify",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "token",
"type": "address"
}
],
"name": "isTokenWhitelistedForVerify",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "newLiquidityPool",
"outputs": [
{
"internalType": "contract IBPool",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "etf",
"type": "address"
},
{
"internalType": "address",
"name": "module",
"type": "address"
}
],
"name": "registerModule",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "etf",
"type": "address"
},
{
"internalType": "address",
"name": "module",
"type": "address"
}
],
"name": "removeModule",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256[]",
"name": "sort",
"type": "uint256[]"
},
{
"internalType": "address[]",
"name": "token",
"type": "address[]"
}
],
"name": "removeTokenFromWhitelist",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "b",
"type": "address"
}
],
"name": "setBLabs",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newManagerOwner",
"type": "address"
}
],
"name": "setManagerOwner",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "oracle",
"type": "address"
}
],
"name": "setOracle",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "router",
"type": "address"
}
],
"name": "setSwapRouter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newVault",
"type": "address"
}
],
"name": "setUserVault",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newVault",
"type": "address"
}
],
"name": "setVault",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"transactionHash": "0x103254b44add2faf965bbc8eed509f1b30f332a540bf6cb08675f4fe95e9a98b",
"receipt": {
"to": null,
"from": "0x595b85b4A418e3B8df897D02F5BD49167D00862F",
"contractAddress": "0xE76902E97203Cb9938d36C01E1ef975B4D394398",
"transactionIndex": 26,
"gasUsed": "17371485",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0xd0c8928242e0da4c703a0437db20c1b7176bb7c281a51b6d241073b63f419d96",
"transactionHash": "0x103254b44add2faf965bbc8eed509f1b30f332a540bf6cb08675f4fe95e9a98b",
"logs": [],
"blockNumber": 7836344,
"cumulativeGasUsed": "21813389",
"status": 1,
"byzantium": true
},
"args": [],
"numDeployments": 1,
"solcInputHash": "ec6aa3e489db51b52585f0a55af97c3a",
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"blabs\",\"type\":\"address\"}],\"name\":\"LOG_BLABS\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"sort\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"LOG_DEL_WHITELIST\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"LOG_MANAGER\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"LOG_NEW_POOL\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"LOG_ORACLE\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"LOG_ROUTER\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"LOG_USER_VAULT\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"}],\"name\":\"LOG_VAULT\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"sort\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"LOG_WHITELIST\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"etf\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"status\",\"type\":\"bool\"}],\"name\":\"MODULE_STATUS_CHANGE\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"sort\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"token\",\"type\":\"address[]\"}],\"name\":\"addTokenToWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bytecodes\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"collect\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBLabs\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getColor\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getManagerOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"etf\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"getModuleStatus\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getOracleAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSwapRouter\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getUserVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"b\",\"type\":\"address\"}],\"name\":\"isLiquidityPool\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"sort\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelistedForVerify\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isTokenWhitelistedForVerify\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"newLiquidityPool\",\"outputs\":[{\"internalType\":\"contract IBPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"etf\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"registerModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"etf\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"module\",\"type\":\"address\"}],\"name\":\"removeModule\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"sort\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"token\",\"type\":\"address[]\"}],\"name\":\"removeTokenFromWhitelist\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"b\",\"type\":\"address\"}],\"name\":\"setBLabs\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newManagerOwner\",\"type\":\"address\"}],\"name\":\"setManagerOwner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"setOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"setSwapRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newVault\",\"type\":\"address\"}],\"name\":\"setUserVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newVault\",\"type\":\"address\"}],\"name\":\"setVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/deploy/Factory.sol\":\"Factory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":20},\"remappings\":[]},\"sources\":{\"contracts/base/Color.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n// abstract contract BColor {\\n// function getColor()\\n// external view virtual\\n// returns (bytes32);\\n// }\\n\\ncontract BBronze {\\n function getColor() external pure returns (bytes32) {\\n return bytes32(\\\"BRONZE\\\");\\n }\\n}\\n\",\"keccak256\":\"0x739437b7b96998c98f74864044362596c566c35e25c56416c3bae25db97aaba1\",\"license\":\"GPL-3.0-or-later\"},\"contracts/base/Const.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\nimport \\\"./Color.sol\\\";\\n\\ncontract Const is BBronze {\\n uint public constant BONE = 10**18;\\n\\n uint public constant MIN_BOUND_TOKENS = 1;\\n uint public constant MAX_BOUND_TOKENS = 16;\\n\\n uint public constant MIN_FEE = BONE / 10**6;\\n uint public constant MAX_FEE = BONE / 10;\\n uint public constant EXIT_FEE = 0;\\n\\n uint public constant MIN_WEIGHT = BONE;\\n uint public constant MAX_WEIGHT = BONE * 50;\\n uint public constant MAX_TOTAL_WEIGHT = BONE * 50;\\n uint public constant MIN_BALANCE = BONE / 10**12;\\n\\n uint public constant INIT_POOL_SUPPLY = BONE * 100;\\n\\n uint public constant MIN_BPOW_BASE = 1 wei;\\n uint public constant MAX_BPOW_BASE = (2 * BONE) - 1 wei;\\n uint public constant BPOW_PRECISION = BONE / 10**10;\\n\\n uint public constant MAX_IN_RATIO = BONE / 2;\\n uint public constant MAX_OUT_RATIO = (BONE / 3) + 1 wei;\\n}\\n\",\"keccak256\":\"0x8a359fca5b843a757809a3388d7be7dd673967f28e2981a1a24c9a2267cc4014\",\"license\":\"GPL-3.0-or-later\"},\"contracts/base/LiquidityPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n// This program is free software: you can redistribute it and/or modify\\n// it under the terms of the GNU General Public License as published by\\n// the Free Software Foundation, either version 3 of the License, or\\n// (at your option) any later version.\\n\\n// This program is distributed in the hope that it will be useful,\\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n// GNU General Public License for more details.\\n\\n// You should have received a copy of the GNU General Public License\\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"./LpToken.sol\\\";\\nimport \\\"./Math.sol\\\";\\nimport \\\"../interfaces/IUniswapV2Router02.sol\\\";\\nimport \\\"../interfaces/IBFactory.sol\\\";\\nimport \\\"../libraries/Address.sol\\\";\\n\\ncontract LiquidityPool is BBronze, LpToken, Math {\\n using Address for address;\\n\\n struct Record {\\n bool bound; // is token bound to pool\\n uint index; // private\\n uint denorm; // denormalized weight\\n uint balance;\\n }\\n\\n event LOG_JOIN(address indexed caller, address indexed tokenIn, uint tokenAmountIn);\\n\\n event LOG_EXIT(address indexed caller, address indexed tokenOut, uint tokenAmountOut);\\n\\n event LOG_REBALANCE(address indexed tokenA, address indexed tokenB, uint newWeightA, uint newWeightB, uint newBalanceA, uint newBalanceB, bool isSoldout);\\n\\n event LOG_CALL(bytes4 indexed sig, address indexed caller, bytes data) anonymous;\\n\\n modifier _logs_() {\\n emit LOG_CALL(msg.sig, msg.sender, msg.data);\\n _;\\n }\\n\\n modifier _lock_() {\\n require(!_mutex, \\\"ERR_REENTRY\\\");\\n _mutex = true;\\n _;\\n _mutex = false;\\n }\\n\\n modifier _viewlock_() {\\n require(!_mutex, \\\"ERR_REENTRY\\\");\\n _;\\n }\\n\\n bool private _mutex;\\n\\n IBFactory private _factory; // Factory address to push token exitFee to\\n address private _controller; // has CONTROL role\\n bool private _publicSwap; // true if PUBLIC can call SWAP functions\\n\\n // `setSwapFee` and `finalize` require CONTROL\\n // `finalize` sets `PUBLIC can SWAP`, `PUBLIC can JOIN`\\n uint private _swapFee;\\n bool private _finalized;\\n\\n address[] private _tokens;\\n mapping(address => Record) private _records;\\n uint private _totalWeight;\\n\\n Oracles private oracle;\\n\\n constructor() public {\\n _controller = msg.sender;\\n _factory = IBFactory(msg.sender);\\n _swapFee = MIN_FEE;\\n _publicSwap = false;\\n _finalized = false;\\n\\n oracle = Oracles(_factory.getOracleAddress());\\n }\\n\\n function isPublicSwap() external view returns (bool) {\\n return _publicSwap;\\n }\\n\\n function isFinalized() external view returns (bool) {\\n return _finalized;\\n }\\n\\n function isBound(address t) external view returns (bool) {\\n return _records[t].bound;\\n }\\n\\n function getNumTokens() external view returns (uint) {\\n return _tokens.length;\\n }\\n\\n function getCurrentTokens() external view _viewlock_ returns (address[] memory tokens) {\\n return _tokens;\\n }\\n\\n function getFinalTokens() external view _viewlock_ returns (address[] memory tokens) {\\n require(_finalized, \\\"ERR_NOT_FINALIZED\\\");\\n return _tokens;\\n }\\n\\n function getDenormalizedWeight(address token) external view _viewlock_ returns (uint) {\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n return _records[token].denorm;\\n }\\n\\n function getTotalDenormalizedWeight() external view _viewlock_ returns (uint) {\\n return _totalWeight;\\n }\\n\\n function getNormalizedWeight(address token) external _viewlock_ returns (uint) {\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n uint denorm = _records[token].denorm;\\n uint price = oracle.getPrice(token);\\n\\n uint[] memory _balances = new uint[](_tokens.length);\\n for (uint i = 0; i < _tokens.length; i++) {\\n _balances[i] = getBalance(_tokens[i]);\\n }\\n uint totalValue = oracle.getAllPrice(_tokens, _balances);\\n uint currentValue = bmul(price, getBalance(token));\\n return bdiv(currentValue, totalValue);\\n }\\n\\n function getBalance(address token) public view _viewlock_ returns (uint) {\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n return _records[token].balance;\\n }\\n\\n function getSwapFee() external view _viewlock_ returns (uint) {\\n return _swapFee;\\n }\\n\\n function getController() external view _viewlock_ returns (address) {\\n return _controller;\\n }\\n\\n function setSwapFee(uint swapFee) external _logs_ _lock_ {\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(swapFee >= MIN_FEE, \\\"ERR_MIN_FEE\\\");\\n require(swapFee <= MAX_FEE, \\\"ERR_MAX_FEE\\\");\\n _swapFee = swapFee;\\n }\\n\\n function setController(address manager) external _logs_ _lock_ {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n _controller = manager;\\n }\\n\\n function setPublicSwap(bool public_) external _logs_ _lock_ {\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n _publicSwap = public_;\\n }\\n\\n function finalize() external _logs_ _lock_ {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n require(_tokens.length >= MIN_BOUND_TOKENS, \\\"ERR_MIN_TOKENS\\\");\\n\\n _finalized = true;\\n _publicSwap = true;\\n\\n _mintPoolShare(INIT_POOL_SUPPLY);\\n _pushPoolShare(msg.sender, INIT_POOL_SUPPLY);\\n }\\n\\n function bind(\\n address token,\\n uint balance,\\n uint denorm\\n )\\n external\\n _logs_ // _lock_ Bind does not lock because it jumps to `rebind`, which does\\n {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(!_records[token].bound, \\\"ERR_IS_BOUND\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n\\n require(_tokens.length < MAX_BOUND_TOKENS, \\\"ERR_MAX_TOKENS\\\");\\n\\n _records[token] = Record({\\n bound: true,\\n index: _tokens.length,\\n denorm: 0, // balance and denorm will be validated\\n balance: 0 // and set by `rebind`\\n });\\n _tokens.push(token);\\n rebind(token, balance, denorm);\\n }\\n\\n function rebind(\\n address token,\\n uint balance,\\n uint denorm\\n ) public _logs_ _lock_ {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n\\n require(denorm >= MIN_WEIGHT, \\\"ERR_MIN_WEIGHT\\\");\\n require(denorm <= MAX_WEIGHT, \\\"ERR_MAX_WEIGHT\\\");\\n require(balance >= MIN_BALANCE, \\\"ERR_MIN_BALANCE\\\");\\n\\n // Adjust the denorm and totalWeight\\n uint oldWeight = _records[token].denorm;\\n if (denorm > oldWeight) {\\n _totalWeight = badd(_totalWeight, bsub(denorm, oldWeight));\\n require(_totalWeight <= MAX_TOTAL_WEIGHT, \\\"ERR_MAX_TOTAL_WEIGHT\\\");\\n } else if (denorm < oldWeight) {\\n _totalWeight = bsub(_totalWeight, bsub(oldWeight, denorm));\\n }\\n _records[token].denorm = denorm;\\n\\n // Adjust the balance record and actual token balance\\n uint oldBalance = _records[token].balance;\\n _records[token].balance = balance;\\n if (balance > oldBalance) {\\n _pullUnderlying(token, msg.sender, bsub(balance, oldBalance));\\n } else if (balance < oldBalance) {\\n // In this case liquidity is being withdrawn, so charge EXIT_FEE\\n uint tokenBalanceWithdrawn = bsub(oldBalance, balance);\\n _pushUnderlying(token, msg.sender, tokenBalanceWithdrawn);\\n }\\n }\\n\\n function rebindSmart(\\n address tokenA,\\n address tokenB,\\n uint deltaWeight,\\n uint deltaBalance,\\n bool isSoldout,\\n uint minAmountOut\\n ) public _logs_ _lock_ {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n\\n address[] memory paths = new address[](2);\\n paths[0] = tokenA;\\n paths[1] = tokenB;\\n\\n IUniswapV2Router02 swapRouter = IUniswapV2Router02(_factory.getSwapRouter());\\n // tokenB is inside the etf\\n if (_records[tokenB].bound) {\\n uint oldWeightB = _records[tokenB].denorm;\\n uint oldBalanceB = _records[tokenB].balance;\\n uint newWeightB = badd(oldWeightB, deltaWeight);\\n\\n require(newWeightB <= MAX_WEIGHT, \\\"ERR_MAX_WEIGHT_B\\\");\\n\\n if (isSoldout) {\\n require(_tokens.length >= MIN_BOUND_TOKENS, \\\"ERR_MIN_TOKENS\\\");\\n } else {\\n require(_records[tokenA].bound, \\\"ERR_NOT_BOUND_A\\\");\\n\\n uint newWeightA = bsub(_records[tokenA].denorm, deltaWeight);\\n uint newBalanceA = bsub(_records[tokenA].balance, deltaBalance);\\n require(newWeightA >= MIN_WEIGHT, \\\"ERR_MIN_WEIGHT_A\\\");\\n require(newBalanceA >= MIN_BALANCE, \\\"ERR_MIN_BALANCE_A\\\");\\n\\n _records[tokenA].balance = newBalanceA;\\n _records[tokenA].denorm = newWeightA;\\n }\\n\\n // sell tokenA to get tokenB\\n uint balanceBBefore = IERC20(tokenB).balanceOf(address(this));\\n\\n _safeApprove(IERC20(tokenA), address(swapRouter), uint(-1));\\n\\n swapRouter.swapExactTokensForTokens(deltaBalance, minAmountOut, paths, address(this), badd(block.timestamp, 1800));\\n uint balanceBAfter = IERC20(tokenB).balanceOf(address(this));\\n\\n uint newBalanceB = badd(oldBalanceB, bsub(balanceBAfter, balanceBBefore));\\n\\n _records[tokenB].balance = newBalanceB;\\n _records[tokenB].denorm = newWeightB;\\n }\\n // tokenB is outside the etf\\n else {\\n if (!isSoldout) {\\n require(_records[tokenA].bound, \\\"ERR_NOT_BOUND_A\\\");\\n\\n uint newWeightA = bsub(_records[tokenA].denorm, deltaWeight);\\n uint newBalanceA = bsub(_records[tokenA].balance, deltaBalance);\\n\\n require(newWeightA >= MIN_WEIGHT, \\\"ERR_MIN_WEIGHT_A\\\");\\n require(newBalanceA >= MIN_BALANCE, \\\"ERR_MIN_BALANCE_A\\\");\\n require(_tokens.length < MAX_BOUND_TOKENS, \\\"ERR_MAX_TOKENS\\\");\\n\\n _records[tokenA].balance = newBalanceA;\\n _records[tokenA].denorm = newWeightA;\\n }\\n\\n // sell all tokenA to get tokenB\\n uint balanceBBefore = IERC20(tokenB).balanceOf(address(this));\\n\\n _safeApprove(IERC20(tokenA), address(swapRouter), uint(-1));\\n\\n swapRouter.swapExactTokensForTokens(deltaBalance, minAmountOut, paths, address(this), badd(block.timestamp, 1800));\\n uint balanceBAfter = IERC20(tokenB).balanceOf(address(this));\\n\\n uint newBalanceB = bsub(balanceBAfter, balanceBBefore);\\n require(newBalanceB >= MIN_BALANCE, \\\"ERR_MIN_BALANCE\\\");\\n require(deltaWeight >= MIN_WEIGHT, \\\"ERR_MIN_WEIGHT_DELTA\\\");\\n\\n _records[tokenB] = Record({bound: true, index: _tokens.length, denorm: deltaWeight, balance: newBalanceB});\\n _tokens.push(tokenB);\\n }\\n\\n emit LOG_REBALANCE(tokenA, tokenB, _records[tokenA].denorm, _records[tokenB].denorm, _records[tokenA].balance, _records[tokenB].balance, isSoldout);\\n }\\n\\n function execute(\\n address _target,\\n uint _value,\\n bytes calldata _data\\n ) external _logs_ _lock_ returns (bytes memory _returnValue) {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n\\n _returnValue = _target.functionCallWithValue(_data, _value);\\n\\n return _returnValue;\\n }\\n\\n function unbind(address token) external _logs_ _lock_ {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n\\n uint tokenBalance = _records[token].balance;\\n\\n _totalWeight = bsub(_totalWeight, _records[token].denorm);\\n\\n // Swap the token-to-unbind with the last token,\\n // then delete the last token\\n uint index = _records[token].index;\\n uint last = _tokens.length - 1;\\n _tokens[index] = _tokens[last];\\n _records[_tokens[index]].index = index;\\n _tokens.pop();\\n _records[token] = Record({bound: false, index: 0, denorm: 0, balance: 0});\\n\\n _pushUnderlying(token, msg.sender, tokenBalance);\\n }\\n\\n function unbindPure(address token) external _logs_ _lock_ {\\n require(msg.sender == _controller, \\\"ERR_NOT_CONTROLLER\\\");\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n require(!_finalized, \\\"ERR_IS_FINALIZED\\\");\\n\\n // Swap the token-to-unbind with the last token,\\n // then delete the last token\\n uint index = _records[token].index;\\n uint last = _tokens.length - 1;\\n _tokens[index] = _tokens[last];\\n _records[_tokens[index]].index = index;\\n _tokens.pop();\\n _records[token] = Record({bound: false, index: 0, denorm: 0, balance: 0});\\n }\\n\\n // Absorb any tokens that have been sent to this contract into the pool\\n function gulp(address token) external _logs_ _lock_ {\\n require(_records[token].bound, \\\"ERR_NOT_BOUND\\\");\\n _records[token].balance = IERC20(token).balanceOf(address(this));\\n }\\n\\n function joinPool(uint poolAmountOut, uint[] calldata maxAmountsIn) external _logs_ _lock_ {\\n require(_finalized, \\\"ERR_NOT_FINALIZED\\\");\\n\\n uint poolTotal = totalSupply();\\n uint ratio = bdiv(poolAmountOut, poolTotal);\\n require(ratio != 0, \\\"ERR_MATH_APPROX\\\");\\n\\n for (uint i = 0; i < _tokens.length; i++) {\\n address t = _tokens[i];\\n uint bal = _records[t].balance;\\n uint tokenAmountIn = bmul(ratio, bal);\\n require(tokenAmountIn != 0, \\\"ERR_MATH_APPROX\\\");\\n require(tokenAmountIn <= maxAmountsIn[i], \\\"ERR_LIMIT_IN\\\");\\n _records[t].balance = badd(_records[t].balance, tokenAmountIn);\\n emit LOG_JOIN(msg.sender, t, tokenAmountIn);\\n _pullUnderlying(t, msg.sender, tokenAmountIn);\\n }\\n _mintPoolShare(poolAmountOut);\\n _pushPoolShare(msg.sender, poolAmountOut);\\n }\\n\\n function exitPool(uint poolAmountIn, uint[] calldata minAmountsOut) external _logs_ _lock_ {\\n require(_finalized, \\\"ERR_NOT_FINALIZED\\\");\\n\\n uint poolTotal = totalSupply();\\n uint ratio = bdiv(poolAmountIn, poolTotal);\\n require(ratio != 0, \\\"ERR_MATH_APPROX\\\");\\n\\n _pullPoolShare(msg.sender, poolAmountIn);\\n _burnPoolShare(poolAmountIn);\\n\\n for (uint i = 0; i < _tokens.length; i++) {\\n address t = _tokens[i];\\n uint bal = _records[t].balance;\\n uint tokenAmountOut = bmul(ratio, bal);\\n require(tokenAmountOut != 0, \\\"ERR_MATH_APPROX\\\");\\n require(tokenAmountOut >= minAmountsOut[i], \\\"ERR_LIMIT_OUT\\\");\\n _records[t].balance = bsub(_records[t].balance, tokenAmountOut);\\n emit LOG_EXIT(msg.sender, t, tokenAmountOut);\\n _pushUnderlying(t, msg.sender, tokenAmountOut);\\n }\\n }\\n\\n // 'Underlying' token-manipulation functions make external calls but are NOT locked\\n // You must `_lock_` or otherwise ensure reentry-safety\\n function _safeApprove(\\n IERC20 token,\\n address spender,\\n uint amount\\n ) internal {\\n if (token.allowance(address(this), spender) > 0) {\\n token.approve(spender, 0);\\n }\\n token.approve(spender, amount);\\n }\\n\\n function _pullUnderlying(\\n address erc20,\\n address from,\\n uint amount\\n ) internal {\\n bool xfer = IERC20(erc20).transferFrom(from, address(this), amount);\\n require(xfer, \\\"ERR_ERC20_FALSE\\\");\\n }\\n\\n function _pushUnderlying(\\n address erc20,\\n address to,\\n uint amount\\n ) internal {\\n bool xfer = IERC20(erc20).transfer(to, amount);\\n require(xfer, \\\"ERR_ERC20_FALSE\\\");\\n }\\n\\n function _pullPoolShare(address from, uint amount) internal {\\n _pull(from, amount);\\n }\\n\\n function _pushPoolShare(address to, uint amount) internal {\\n _push(to, amount);\\n }\\n\\n function _mintPoolShare(uint amount) internal {\\n _mint(amount);\\n }\\n\\n function _burnPoolShare(uint amount) internal {\\n _burn(amount);\\n }\\n\\n receive() external payable {}\\n}\\n\",\"keccak256\":\"0x8e6a3549c791efb4da36f2ec86d6a59724e611f6bd1b39b48761f75c6bf92308\",\"license\":\"GPL-3.0-or-later\"},\"contracts/base/LpToken.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"./Num.sol\\\";\\nimport \\\"../interfaces/IERC20.sol\\\";\\n\\n// Highly opinionated token implementation\\n\\ncontract LpTokenBase is Num {\\n mapping(address => uint) internal _balance;\\n mapping(address => mapping(address => uint)) internal _allowance;\\n uint internal _totalSupply;\\n\\n event Approval(address indexed src, address indexed dst, uint amt);\\n event Transfer(address indexed src, address indexed dst, uint amt);\\n\\n function _mint(uint amt) internal {\\n _balance[address(this)] = badd(_balance[address(this)], amt);\\n _totalSupply = badd(_totalSupply, amt);\\n emit Transfer(address(0), address(this), amt);\\n }\\n\\n function _burn(uint amt) internal {\\n require(_balance[address(this)] >= amt, \\\"ERR_INSUFFICIENT_BAL\\\");\\n _balance[address(this)] = bsub(_balance[address(this)], amt);\\n _totalSupply = bsub(_totalSupply, amt);\\n emit Transfer(address(this), address(0), amt);\\n }\\n\\n function _move(\\n address src,\\n address dst,\\n uint amt\\n ) internal {\\n require(_balance[src] >= amt, \\\"ERR_INSUFFICIENT_BAL\\\");\\n _balance[src] = bsub(_balance[src], amt);\\n _balance[dst] = badd(_balance[dst], amt);\\n emit Transfer(src, dst, amt);\\n }\\n\\n function _push(address to, uint amt) internal {\\n _move(address(this), to, amt);\\n }\\n\\n function _pull(address from, uint amt) internal {\\n _move(from, address(this), amt);\\n }\\n}\\n\\ncontract LpToken is LpTokenBase, IERC20 {\\n string private _name = \\\"Desyn Pool Token\\\";\\n string private _symbol = \\\"DPT\\\";\\n uint8 private _decimals = 18;\\n\\n function name() public view returns (string memory) {\\n return _name;\\n }\\n\\n function symbol() public view override returns (string memory) {\\n return _symbol;\\n }\\n\\n function decimals() public view override returns (uint8) {\\n return _decimals;\\n }\\n\\n function allowance(address src, address dst) external view override returns (uint) {\\n return _allowance[src][dst];\\n }\\n\\n function balanceOf(address whom) external view override returns (uint) {\\n return _balance[whom];\\n }\\n\\n function totalSupply() public view override returns (uint) {\\n return _totalSupply;\\n }\\n\\n function approve(address dst, uint amt) external override returns (bool) {\\n _allowance[msg.sender][dst] = amt;\\n emit Approval(msg.sender, dst, amt);\\n return true;\\n }\\n\\n function increaseApproval(address dst, uint amt) external returns (bool) {\\n _allowance[msg.sender][dst] = badd(_allowance[msg.sender][dst], amt);\\n emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);\\n return true;\\n }\\n\\n function decreaseApproval(address dst, uint amt) external returns (bool) {\\n uint oldValue = _allowance[msg.sender][dst];\\n if (amt > oldValue) {\\n _allowance[msg.sender][dst] = 0;\\n } else {\\n _allowance[msg.sender][dst] = bsub(oldValue, amt);\\n }\\n emit Approval(msg.sender, dst, _allowance[msg.sender][dst]);\\n return true;\\n }\\n\\n function transfer(address dst, uint amt) external override returns (bool) {\\n _move(msg.sender, dst, amt);\\n return true;\\n }\\n\\n function transferFrom(\\n address src,\\n address dst,\\n uint amt\\n ) external override returns (bool) {\\n require(msg.sender == src || amt <= _allowance[src][msg.sender], \\\"ERR_LPTOKEN_BAD_CALLER\\\");\\n _move(src, dst, amt);\\n if (msg.sender != src && _allowance[src][msg.sender] != uint(-1)) {\\n _allowance[src][msg.sender] = bsub(_allowance[src][msg.sender], amt);\\n emit Approval(src, msg.sender, _allowance[src][msg.sender]);\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xb72b64c1ce99e3c62e35608fe5b10a469566b1fb1f6887e466373831af0d27eb\",\"license\":\"GPL-3.0-or-later\"},\"contracts/base/Math.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"./Num.sol\\\";\\n\\ncontract Math is BBronze, Const, Num {\\n /**********************************************************************************************\\n // calcSpotPrice //\\n // sP = spotPrice //\\n // bI = tokenBalanceIn ( bI / wI ) 1 //\\n // bO = tokenBalanceOut sP = ----------- * ---------- //\\n // wI = tokenWeightIn ( bO / wO ) ( 1 - sF ) //\\n // wO = tokenWeightOut //\\n // sF = swapFee //\\n **********************************************************************************************/\\n function calcSpotPrice(\\n uint tokenBalanceIn,\\n uint tokenWeightIn,\\n uint tokenBalanceOut,\\n uint tokenWeightOut,\\n uint swapFee\\n ) public pure returns (uint spotPrice) {\\n uint numer = bdiv(tokenBalanceIn, tokenWeightIn);\\n uint denom = bdiv(tokenBalanceOut, tokenWeightOut);\\n uint ratio = bdiv(numer, denom);\\n uint scale = bdiv(BONE, bsub(BONE, swapFee));\\n return (spotPrice = bmul(ratio, scale));\\n }\\n\\n /**********************************************************************************************\\n // calcOutGivenIn //\\n // aO = tokenAmountOut //\\n // bO = tokenBalanceOut //\\n // bI = tokenBalanceIn / / bI \\\\ (wI / wO) \\\\ //\\n // aI = tokenAmountIn aO = bO * | 1 - | -------------------------- | ^ | //\\n // wI = tokenWeightIn \\\\ \\\\ ( bI + ( aI * ( 1 - sF )) / / //\\n // wO = tokenWeightOut //\\n // sF = swapFee //\\n **********************************************************************************************/\\n function calcOutGivenIn(\\n uint tokenBalanceIn,\\n uint tokenWeightIn,\\n uint tokenBalanceOut,\\n uint tokenWeightOut,\\n uint tokenAmountIn,\\n uint swapFee\\n ) public pure returns (uint tokenAmountOut) {\\n uint weightRatio = bdiv(tokenWeightIn, tokenWeightOut);\\n uint adjustedIn = bsub(BONE, swapFee);\\n adjustedIn = bmul(tokenAmountIn, adjustedIn);\\n uint y = bdiv(tokenBalanceIn, badd(tokenBalanceIn, adjustedIn));\\n uint foo = bpow(y, weightRatio);\\n uint bar = bsub(BONE, foo);\\n tokenAmountOut = bmul(tokenBalanceOut, bar);\\n return tokenAmountOut;\\n }\\n\\n /**********************************************************************************************\\n // calcInGivenOut //\\n // aI = tokenAmountIn //\\n // bO = tokenBalanceOut / / bO \\\\ (wO / wI) \\\\ //\\n // bI = tokenBalanceIn bI * | | ------------ | ^ - 1 | //\\n // aO = tokenAmountOut aI = \\\\ \\\\ ( bO - aO ) / / //\\n // wI = tokenWeightIn -------------------------------------------- //\\n // wO = tokenWeightOut ( 1 - sF ) //\\n // sF = swapFee //\\n **********************************************************************************************/\\n function calcInGivenOut(\\n uint tokenBalanceIn,\\n uint tokenWeightIn,\\n uint tokenBalanceOut,\\n uint tokenWeightOut,\\n uint tokenAmountOut,\\n uint swapFee\\n ) public pure returns (uint tokenAmountIn) {\\n uint weightRatio = bdiv(tokenWeightOut, tokenWeightIn);\\n uint diff = bsub(tokenBalanceOut, tokenAmountOut);\\n uint y = bdiv(tokenBalanceOut, diff);\\n uint foo = bpow(y, weightRatio);\\n foo = bsub(foo, BONE);\\n tokenAmountIn = bsub(BONE, swapFee);\\n tokenAmountIn = bdiv(bmul(tokenBalanceIn, foo), tokenAmountIn);\\n return tokenAmountIn;\\n }\\n\\n /**********************************************************************************************\\n // calcPoolOutGivenSingleIn //\\n // pAo = poolAmountOut / \\\\ //\\n // tAi = tokenAmountIn /// / // wI \\\\ \\\\\\\\ \\\\ wI \\\\ //\\n // wI = tokenWeightIn //| tAi *| 1 - || 1 - -- | * sF || + tBi \\\\ -- \\\\ //\\n // tW = totalWeight pAo=|| \\\\ \\\\ \\\\\\\\ tW / // | ^ tW | * pS - pS //\\n // tBi = tokenBalanceIn \\\\\\\\ ------------------------------------- / / //\\n // pS = poolSupply \\\\\\\\ tBi / / //\\n // sF = swapFee \\\\ / //\\n **********************************************************************************************/\\n function calcPoolOutGivenSingleIn(\\n uint tokenBalanceIn,\\n uint tokenWeightIn,\\n uint poolSupply,\\n uint totalWeight,\\n uint tokenAmountIn,\\n uint swapFee\\n ) public pure returns (uint poolAmountOut) {\\n // Charge the trading fee for the proportion of tokenAi\\n // which is implicitly traded to the other pool tokens.\\n // That proportion is (1- weightTokenIn)\\n // tokenAiAfterFee = tAi * (1 - (1-weightTi) * poolFee);\\n uint normalizedWeight = bdiv(tokenWeightIn, totalWeight);\\n uint zaz = bmul(bsub(BONE, normalizedWeight), swapFee);\\n uint tokenAmountInAfterFee = bmul(tokenAmountIn, bsub(BONE, zaz));\\n\\n uint newTokenBalanceIn = badd(tokenBalanceIn, tokenAmountInAfterFee);\\n uint tokenInRatio = bdiv(newTokenBalanceIn, tokenBalanceIn);\\n\\n // uint newPoolSupply = (ratioTi ^ weightTi) * poolSupply;\\n uint poolRatio = bpow(tokenInRatio, normalizedWeight);\\n uint newPoolSupply = bmul(poolRatio, poolSupply);\\n poolAmountOut = bsub(newPoolSupply, poolSupply);\\n return poolAmountOut;\\n }\\n\\n /**********************************************************************************************\\n // calcSingleInGivenPoolOut //\\n // tAi = tokenAmountIn //(pS + pAo)\\\\ / 1 \\\\\\\\ //\\n // pS = poolSupply || --------- | ^ | --------- || * bI - bI //\\n // pAo = poolAmountOut \\\\\\\\ pS / \\\\(wI / tW)// //\\n // bI = balanceIn tAi = -------------------------------------------- //\\n // wI = weightIn / wI \\\\ //\\n // tW = totalWeight | 1 - ---- | * sF //\\n // sF = swapFee \\\\ tW / //\\n **********************************************************************************************/\\n function calcSingleInGivenPoolOut(\\n uint tokenBalanceIn,\\n uint tokenWeightIn,\\n uint poolSupply,\\n uint totalWeight,\\n uint poolAmountOut,\\n uint swapFee\\n ) public pure returns (uint tokenAmountIn) {\\n uint normalizedWeight = bdiv(tokenWeightIn, totalWeight);\\n uint newPoolSupply = badd(poolSupply, poolAmountOut);\\n uint poolRatio = bdiv(newPoolSupply, poolSupply);\\n\\n //uint newBalTi = poolRatio^(1/weightTi) * balTi;\\n uint boo = bdiv(BONE, normalizedWeight);\\n uint tokenInRatio = bpow(poolRatio, boo);\\n uint newTokenBalanceIn = bmul(tokenInRatio, tokenBalanceIn);\\n uint tokenAmountInAfterFee = bsub(newTokenBalanceIn, tokenBalanceIn);\\n // Do reverse order of fees charged in joinswap_ExternAmountIn, this way\\n // ``` pAo == joinswap_ExternAmountIn(Ti, joinswap_PoolAmountOut(pAo, Ti)) ```\\n //uint tAi = tAiAfterFee / (1 - (1-weightTi) * swapFee) ;\\n uint zar = bmul(bsub(BONE, normalizedWeight), swapFee);\\n tokenAmountIn = bdiv(tokenAmountInAfterFee, bsub(BONE, zar));\\n return tokenAmountIn;\\n }\\n\\n /**********************************************************************************************\\n // calcSingleOutGivenPoolIn //\\n // tAo = tokenAmountOut / / \\\\\\\\ //\\n // bO = tokenBalanceOut / // pS - (pAi * (1 - eF)) \\\\ / 1 \\\\ \\\\\\\\ //\\n // pAi = poolAmountIn | bO - || ----------------------- | ^ | --------- | * b0 || //\\n // ps = poolSupply \\\\ \\\\\\\\ pS / \\\\(wO / tW)/ // //\\n // wI = tokenWeightIn tAo = \\\\ \\\\ // //\\n // tW = totalWeight / / wO \\\\ \\\\ //\\n // sF = swapFee * | 1 - | 1 - ---- | * sF | //\\n // eF = exitFee \\\\ \\\\ tW / / //\\n **********************************************************************************************/\\n function calcSingleOutGivenPoolIn(\\n uint tokenBalanceOut,\\n uint tokenWeightOut,\\n uint poolSupply,\\n uint totalWeight,\\n uint poolAmountIn,\\n uint swapFee\\n ) public pure returns (uint tokenAmountOut) {\\n uint normalizedWeight = bdiv(tokenWeightOut, totalWeight);\\n // charge exit fee on the pool token side\\n // pAiAfterExitFee = pAi*(1-exitFee)\\n uint poolAmountInAfterExitFee = bmul(poolAmountIn, bsub(BONE, EXIT_FEE));\\n uint newPoolSupply = bsub(poolSupply, poolAmountInAfterExitFee);\\n uint poolRatio = bdiv(newPoolSupply, poolSupply);\\n\\n // newBalTo = poolRatio^(1/weightTo) * balTo;\\n uint tokenOutRatio = bpow(poolRatio, bdiv(BONE, normalizedWeight));\\n uint newTokenBalanceOut = bmul(tokenOutRatio, tokenBalanceOut);\\n\\n uint tokenAmountOutBeforeSwapFee = bsub(tokenBalanceOut, newTokenBalanceOut);\\n\\n // charge swap fee on the output token side\\n //uint tAo = tAoBeforeSwapFee * (1 - (1-weightTo) * swapFee)\\n uint zaz = bmul(bsub(BONE, normalizedWeight), swapFee);\\n tokenAmountOut = bmul(tokenAmountOutBeforeSwapFee, bsub(BONE, zaz));\\n return tokenAmountOut;\\n }\\n\\n /**********************************************************************************************\\n // calcPoolInGivenSingleOut //\\n // pAi = poolAmountIn // / tAo \\\\\\\\ / wO \\\\ \\\\ //\\n // bO = tokenBalanceOut // | bO - -------------------------- |\\\\ | ---- | \\\\ //\\n // tAo = tokenAmountOut pS - || \\\\ 1 - ((1 - (tO / tW)) * sF)/ | ^ \\\\ tW / * pS | //\\n // ps = poolSupply \\\\\\\\ -----------------------------------/ / //\\n // wO = tokenWeightOut pAi = \\\\\\\\ bO / / //\\n // tW = totalWeight ------------------------------------------------------------- //\\n // sF = swapFee ( 1 - eF ) //\\n // eF = exitFee //\\n **********************************************************************************************/\\n function calcPoolInGivenSingleOut(\\n uint tokenBalanceOut,\\n uint tokenWeightOut,\\n uint poolSupply,\\n uint totalWeight,\\n uint tokenAmountOut,\\n uint swapFee\\n ) public pure returns (uint poolAmountIn) {\\n // charge swap fee on the output token side\\n uint normalizedWeight = bdiv(tokenWeightOut, totalWeight);\\n //uint tAoBeforeSwapFee = tAo / (1 - (1-weightTo) * swapFee) ;\\n uint zoo = bsub(BONE, normalizedWeight);\\n uint zar = bmul(zoo, swapFee);\\n uint tokenAmountOutBeforeSwapFee = bdiv(tokenAmountOut, bsub(BONE, zar));\\n\\n uint newTokenBalanceOut = bsub(tokenBalanceOut, tokenAmountOutBeforeSwapFee);\\n uint tokenOutRatio = bdiv(newTokenBalanceOut, tokenBalanceOut);\\n\\n //uint newPoolSupply = (ratioTo ^ weightTo) * poolSupply;\\n uint poolRatio = bpow(tokenOutRatio, normalizedWeight);\\n uint newPoolSupply = bmul(poolRatio, poolSupply);\\n uint poolAmountInAfterExitFee = bsub(poolSupply, newPoolSupply);\\n\\n // charge exit fee on the pool token side\\n // pAi = pAiAfterExitFee/(1-exitFee)\\n poolAmountIn = bdiv(poolAmountInAfterExitFee, bsub(BONE, EXIT_FEE));\\n return poolAmountIn;\\n }\\n}\\n\",\"keccak256\":\"0x95320c72abfe582ed45e79a4376207362b8bf196a4d82a048017b93b8c4b8e8c\",\"license\":\"GPL-3.0-or-later\"},\"contracts/base/Num.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\nimport \\\"./Const.sol\\\";\\n\\n// Core contract; can't be changed. So disable solhint (reminder for v2)\\n\\n/* solhint-disable private-vars-leading-underscore */\\n\\ncontract Num is Const {\\n function btoi(uint a) internal pure returns (uint) {\\n return a / BONE;\\n }\\n\\n function bfloor(uint a) internal pure returns (uint) {\\n return btoi(a) * BONE;\\n }\\n\\n function badd(uint a, uint b) internal pure returns (uint) {\\n uint c = a + b;\\n require(c >= a, \\\"ERR_ADD_OVERFLOW\\\");\\n return c;\\n }\\n\\n function bsub(uint a, uint b) internal pure returns (uint) {\\n (uint c, bool flag) = bsubSign(a, b);\\n require(!flag, \\\"ERR_SUB_UNDERFLOW\\\");\\n return c;\\n }\\n\\n function bsubSign(uint a, uint b) internal pure returns (uint, bool) {\\n if (a >= b) {\\n return (a - b, false);\\n } else {\\n return (b - a, true);\\n }\\n }\\n\\n function bmul(uint a, uint b) internal pure returns (uint) {\\n uint c0 = a * b;\\n require(a == 0 || c0 / a == b, \\\"ERR_MUL_OVERFLOW\\\");\\n uint c1 = c0 + (BONE / 2);\\n require(c1 >= c0, \\\"ERR_MUL_OVERFLOW\\\");\\n uint c2 = c1 / BONE;\\n return c2;\\n }\\n\\n function bdiv(uint a, uint b) internal pure returns (uint) {\\n require(b != 0, \\\"ERR_DIV_ZERO\\\");\\n uint c0 = a * BONE;\\n require(a == 0 || c0 / a == BONE, \\\"ERR_DIV_INTERNAL\\\"); // bmul overflow\\n uint c1 = c0 + (b / 2);\\n require(c1 >= c0, \\\"ERR_DIV_INTERNAL\\\"); // badd require\\n uint c2 = c1 / b;\\n return c2;\\n }\\n\\n // DSMath.wpow\\n function bpowi(uint a, uint n) internal pure returns (uint) {\\n uint z = n % 2 != 0 ? a : BONE;\\n\\n for (n /= 2; n != 0; n /= 2) {\\n a = bmul(a, a);\\n\\n if (n % 2 != 0) {\\n z = bmul(z, a);\\n }\\n }\\n return z;\\n }\\n\\n // Compute b^(e.w) by splitting it into (b^e)*(b^0.w).\\n // Use `bpowi` for `b^e` and `bpowK` for k iterations\\n // of approximation of b^0.w\\n function bpow(uint base, uint exp) internal pure returns (uint) {\\n require(base >= MIN_BPOW_BASE, \\\"ERR_BPOW_BASE_TOO_LOW\\\");\\n require(base <= MAX_BPOW_BASE, \\\"ERR_BPOW_BASE_TOO_HIGH\\\");\\n\\n uint whole = bfloor(exp);\\n uint remain = bsub(exp, whole);\\n\\n uint wholePow = bpowi(base, btoi(whole));\\n\\n if (remain == 0) {\\n return wholePow;\\n }\\n\\n uint partialResult = bpowApprox(base, remain, BPOW_PRECISION);\\n return bmul(wholePow, partialResult);\\n }\\n\\n function bpowApprox(\\n uint base,\\n uint exp,\\n uint precision\\n ) internal pure returns (uint) {\\n // term 0:\\n uint a = exp;\\n (uint x, bool xneg) = bsubSign(base, BONE);\\n uint term = BONE;\\n uint sum = term;\\n bool negative = false;\\n\\n // term(k) = numer / denom\\n // = (product(a - i - 1, i=1-->k) * x^k) / (k!)\\n // each iteration, multiply previous term by (a-(k-1)) * x / k\\n // continue until term is less than precision\\n for (uint i = 1; term >= precision; i++) {\\n uint bigK = i * BONE;\\n (uint c, bool cneg) = bsubSign(a, bsub(bigK, BONE));\\n term = bmul(term, bmul(c, x));\\n term = bdiv(term, bigK);\\n if (term == 0) break;\\n\\n if (xneg) negative = !negative;\\n if (cneg) negative = !negative;\\n if (negative) {\\n sum = bsub(sum, term);\\n } else {\\n sum = badd(sum, term);\\n }\\n }\\n\\n return sum;\\n }\\n}\\n\",\"keccak256\":\"0x77fcd4820332801e887874b4557b796e2e28a9d5e103778eafd0bec353e2111f\",\"license\":\"GPL-3.0-or-later\"},\"contracts/base/WhiteToken.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\ncontract WhiteToken {\\n // add token log\\n event LOG_WHITELIST(address indexed spender, uint indexed sort, address indexed caller, address token);\\n // del token log\\n event LOG_DEL_WHITELIST(address indexed spender, uint indexed sort, address indexed caller, address token);\\n\\n // has config state\\n bool private _hasInit;\\n // record the number of whitelists.\\n uint private _whiteTokenCount;\\n // token address => is white token.\\n mapping(address => bool) private _isTokenWhitelisted;\\n // Multi level white token.\\n // type => token address => is white token.\\n mapping(uint => mapping(address => bool)) private _tokenWhitelistedInfo;\\n\\n function _queryIsTokenWhitelisted(address token) internal view returns (bool) {\\n return _isTokenWhitelisted[token];\\n }\\n\\n // for factory to verify\\n function _isTokenWhitelistedForVerify(uint sort, address token) internal view returns (bool) {\\n return _tokenWhitelistedInfo[sort][token];\\n }\\n\\n // add sort token\\n function _addTokenToWhitelist(uint sort, address token) internal {\\n require(token != address(0), \\\"ERR_INVALID_TOKEN_ADDRESS\\\");\\n require(_queryIsTokenWhitelisted(token) == false, \\\"ERR_HAS_BEEN_ADDED_WHITE\\\");\\n\\n _tokenWhitelistedInfo[sort][token] = true;\\n _isTokenWhitelisted[token] = true;\\n if (_hasInit == false) {\\n _hasInit = true;\\n }\\n _whiteTokenCount++;\\n _countListener();\\n\\n emit LOG_WHITELIST(address(this), sort, msg.sender, token);\\n }\\n\\n // remove sort token\\n function _removeTokenFromWhitelist(uint sort, address token) internal {\\n require(_queryIsTokenWhitelisted(token) == true, \\\"ERR_NOT_WHITE_TOKEN\\\");\\n\\n _tokenWhitelistedInfo[sort][token] = false;\\n _isTokenWhitelisted[token] = false;\\n _whiteTokenCount--;\\n _countListener();\\n\\n emit LOG_DEL_WHITELIST(address(this), sort, msg.sender, token);\\n }\\n\\n // listen the white token counts change.\\n function _countListener() private {\\n _whiteTokenCount == 0 ? _hasInit = false : _hasInit = true;\\n }\\n\\n // already has init\\n function _initWhiteTokenState() internal view returns (bool) {\\n return _hasInit;\\n }\\n}\\n\",\"keccak256\":\"0x4756e4c5f8d46f79babf536bee07b1e4426dda27c7863fe7178722eeb36a6799\",\"license\":\"GPL-3.0-or-later\"},\"contracts/deploy/Factory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n// This program is free software: you can redistribute it and/or modify\\n// it under the terms of the GNU General Public License as published by\\n// the Free Software Foundation, either version 3 of the License, or\\n// (at your option) any later version.\\n\\n// This program is disstributed in the hope that it will be useful,\\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\n// GNU General Public License for more details.\\n\\n// You should have received a copy of the GNU General Public License\\n// along with this program. If not, see <http://www.gnu.org/licenses/>.\\n\\npragma solidity 0.6.12;\\nimport \\\"../base/WhiteToken.sol\\\";\\nimport \\\"../base/LiquidityPool.sol\\\";\\nimport \\\"../interfaces/IBFactory.sol\\\";\\n\\ncontract Factory is BBronze, WhiteToken {\\n event LOG_NEW_POOL(address indexed caller, address indexed pool);\\n\\n event LOG_BLABS(address indexed caller, address indexed blabs);\\n\\n event LOG_ROUTER(address indexed caller, address indexed router);\\n\\n event LOG_VAULT(address indexed vault, address indexed caller);\\n event LOG_USER_VAULT(address indexed vault, address indexed caller);\\n event LOG_MANAGER(address indexed manager, address indexed caller);\\n\\n event LOG_ORACLE(address indexed caller, address indexed oracle);\\n\\n event MODULE_STATUS_CHANGE(address etf, address module, bool status);\\n mapping(address => bool) private _isLiquidityPool;\\n mapping(address => mapping(address => bool)) private _isModuleRegistered;\\n uint private counters;\\n bytes public bytecodes = type(LiquidityPool).creationCode;\\n\\n function addTokenToWhitelist(uint[] memory sort, address[] memory token) external onlyBlabs {\\n require(sort.length == token.length, \\\"ERR_SORT_TOKEN_MISMATCH\\\");\\n for (uint i = 0; i < sort.length; i++) {\\n _addTokenToWhitelist(sort[i], token[i]);\\n }\\n }\\n\\n function removeTokenFromWhitelist(uint[] memory sort, address[] memory token) external onlyBlabs {\\n require(sort.length == token.length, \\\"ERR_SORT_TOKEN_MISMATCH\\\");\\n for (uint i = 0; i < sort.length; i++) {\\n _removeTokenFromWhitelist(sort[i], token[i]);\\n }\\n }\\n\\n function isTokenWhitelistedForVerify(uint sort, address token) external view returns (bool) {\\n return _isTokenWhitelistedForVerify(sort, token);\\n }\\n\\n function isTokenWhitelistedForVerify(address token) external view returns (bool) {\\n return _queryIsTokenWhitelisted(token);\\n }\\n\\n function isLiquidityPool(address b) external view returns (bool) {\\n return _isLiquidityPool[b];\\n }\\n\\n function createPool() internal returns (address base) {\\n bytes memory bytecode = bytecodes;\\n bytes32 salt = keccak256(abi.encodePacked(counters++));\\n\\n assembly {\\n base := create2(0, add(bytecode, 32), mload(bytecode), salt)\\n if iszero(extcodesize(base)) {\\n revert(0, 0)\\n }\\n }\\n counters++;\\n }\\n\\n function newLiquidityPool() external returns (IBPool) {\\n address lpool = createPool();\\n _isLiquidityPool[lpool] = true;\\n emit LOG_NEW_POOL(msg.sender, lpool);\\n IBPool(lpool).setController(msg.sender);\\n return IBPool(lpool);\\n }\\n\\n address private _blabs;\\n address private _swapRouter;\\n address private _vault;\\n address private _oracle;\\n address private _managerOwner;\\n address private _vaultAddress;\\n address private _userVaultAddress;\\n\\n constructor() public {\\n _blabs = msg.sender;\\n }\\n\\n function getBLabs() external view returns (address) {\\n return _blabs;\\n }\\n\\n function setBLabs(address b) external onlyBlabs {\\n emit LOG_BLABS(msg.sender, b);\\n _blabs = b;\\n }\\n\\n function getSwapRouter() external view returns (address) {\\n return _swapRouter;\\n }\\n\\n function getModuleStatus(address etf, address module) external view returns (bool) {\\n return _isModuleRegistered[etf][module];\\n }\\n\\n function getOracleAddress() external view returns (address) {\\n return _oracle;\\n }\\n\\n function setSwapRouter(address router) external onlyBlabs {\\n emit LOG_ROUTER(msg.sender, router);\\n _swapRouter = router;\\n }\\n\\n function registerModule(address etf, address module) external {\\n require(msg.sender == _blabs, \\\"ERR_NOT_BLABS\\\");\\n\\n require(etf != address(0), \\\"ZERO ETF ADDRESS\\\");\\n\\n require(module != address(0), \\\"ZERO ADDRESS\\\");\\n\\n _isModuleRegistered[etf][module] = true;\\n\\n emit MODULE_STATUS_CHANGE(etf, module, true);\\n }\\n\\n function removeModule(address etf, address module) external {\\n require(msg.sender == _blabs, \\\"ERR_NOT_BLABS\\\");\\n\\n require(etf != address(0), \\\"ZERO ETF ADDRESS\\\");\\n\\n require(module != address(0), \\\"ZERO ADDRESS\\\");\\n\\n _isModuleRegistered[etf][module] = false;\\n\\n emit MODULE_STATUS_CHANGE(etf, module, false);\\n }\\n\\n function setOracle(address oracle) external {\\n require(msg.sender == _blabs, \\\"ERR_NOT_BLABS\\\");\\n emit LOG_ORACLE(msg.sender, oracle);\\n _oracle = oracle;\\n }\\n\\n function collect(IERC20 token) external onlyBlabs {\\n uint collected = token.balanceOf(address(this));\\n bool xfer = token.transfer(_blabs, collected);\\n require(xfer, \\\"ERR_ERC20_FAILED\\\");\\n }\\n\\n function getVault() external view returns (address) {\\n return _vaultAddress;\\n }\\n\\n function setVault(address newVault) external onlyBlabs {\\n _vaultAddress = newVault;\\n emit LOG_VAULT(newVault, msg.sender);\\n }\\n\\n function getUserVault() external view returns (address) {\\n return _userVaultAddress;\\n }\\n\\n function setUserVault(address newVault) external onlyBlabs {\\n _userVaultAddress = newVault;\\n emit LOG_USER_VAULT(newVault, msg.sender);\\n }\\n\\n function getManagerOwner() external view returns (address) {\\n return _managerOwner;\\n }\\n\\n function setManagerOwner(address newManagerOwner) external onlyBlabs {\\n _managerOwner = newManagerOwner;\\n emit LOG_MANAGER(newManagerOwner, msg.sender);\\n }\\n\\n modifier onlyBlabs() {\\n require(msg.sender == _blabs, \\\"ERR_NOT_BLABS\\\");\\n _;\\n }\\n}\\n\",\"keccak256\":\"0x7249583ca0a385796b556f69d7fa101b6cb2031aded725fcd43b1153defe95e8\",\"license\":\"GPL-3.0-or-later\"},\"contracts/interfaces/IBFactory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\npragma experimental ABIEncoderV2;\\nimport \\\"../libraries/SmartPoolManager.sol\\\";\\n\\ninterface IBPool {\\n function rebind(\\n address token,\\n uint balance,\\n uint denorm\\n ) external;\\n\\n function rebindSmart(\\n address tokenA,\\n address tokenB,\\n uint deltaWeight,\\n uint deltaBalance,\\n bool isSoldout,\\n uint minAmountOut\\n ) external;\\n\\n function execute(\\n address _target,\\n uint _value,\\n bytes calldata _data\\n ) external returns (bytes memory _returnValue);\\n\\n function bind(\\n address token,\\n uint balance,\\n uint denorm\\n ) external;\\n\\n function unbind(address token) external;\\n\\n function unbindPure(address token) external;\\n\\n function isBound(address token) external view returns (bool);\\n\\n function getBalance(address token) external view returns (uint);\\n\\n function totalSupply() external view returns (uint);\\n\\n function getSwapFee() external view returns (uint);\\n\\n function isPublicSwap() external view returns (bool);\\n\\n function getDenormalizedWeight(address token) external view returns (uint);\\n\\n function getTotalDenormalizedWeight() external view returns (uint);\\n\\n function EXIT_FEE() external view returns (uint);\\n\\n function getCurrentTokens() external view returns (address[] memory tokens);\\n\\n function setController(address owner) external;\\n}\\n\\ninterface IBFactory {\\n function newLiquidityPool() external returns (IBPool);\\n\\n function setBLabs(address b) external;\\n\\n function collect(IBPool pool) external;\\n\\n function isBPool(address b) external view returns (bool);\\n\\n function getBLabs() external view returns (address);\\n\\n function getSwapRouter() external view returns (address);\\n\\n function getVault() external view returns (address);\\n\\n function getUserVault() external view returns (address);\\n\\n function getVaultAddress() external view returns (address);\\n\\n function getOracleAddress() external view returns (address);\\n\\n function getManagerOwner() external view returns (address);\\n\\n function isTokenWhitelistedForVerify(uint sort, address token) external view returns (bool);\\n\\n function isTokenWhitelistedForVerify(address token) external view returns (bool);\\n\\n function getModuleStatus(address etf, address module) external view returns (bool);\\n}\\n\\ninterface IVault {\\n function depositManagerToken(address[] calldata poolTokens, uint[] calldata tokensAmount) external;\\n\\n function depositIssueRedeemPToken(\\n address[] calldata poolTokens,\\n uint[] calldata tokensAmount,\\n uint[] calldata tokensAmountP,\\n bool isPerfermance\\n ) external;\\n\\n function managerClaim(address pool) external;\\n\\n function getManagerClaimBool(address pool) external view returns (bool);\\n}\\n\\ninterface IUserVault {\\n function recordTokenInfo(\\n address kol,\\n address user,\\n address[] calldata poolTokens,\\n uint[] calldata tokensAmount\\n ) external;\\n}\\n\\ninterface Oracles {\\n function getPrice(address tokenAddress) external returns (uint price);\\n\\n function getAllPrice(address[] calldata poolTokens, uint[] calldata tokensAmount) external returns (uint);\\n}\\n\",\"keccak256\":\"0x13c400ca7a5f59c8730f553fcf189c14af0c0d65a79012793cbde56ce221a419\",\"license\":\"GPL-3.0-or-later\"},\"contracts/interfaces/IConfigurableRightsPool.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n// Interface declarations\\n\\n// Introduce to avoid circularity (otherwise, the CRP and SmartPoolManager include each other)\\n// Removing circularity allows flattener tools to work, which enables Etherscan verification\\ninterface IConfigurableRightsPool {\\n function mintPoolShareFromLib(uint amount) external;\\n\\n function pushPoolShareFromLib(address to, uint amount) external;\\n\\n function pullPoolShareFromLib(address from, uint amount) external;\\n\\n function burnPoolShareFromLib(uint amount) external;\\n\\n function totalSupply() external view returns (uint);\\n\\n function getController() external view returns (address);\\n}\\n\",\"keccak256\":\"0x54defbc333ab8f90c4fe352c694c360cc38fd707606199caf05fc165a64da788\",\"license\":\"GPL-3.0-or-later\"},\"contracts/interfaces/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n// Interface declarations\\n\\n/* solhint-disable func-order */\\n\\ninterface IERC20 {\\n // Emitted when the allowance of a spender for an owner is set by a call to approve.\\n // Value is the new allowance\\n event Approval(address indexed owner, address indexed spender, uint value);\\n\\n // Emitted when value tokens are moved from one account (from) to another (to).\\n // Note that value may be zero\\n event Transfer(address indexed from, address indexed to, uint value);\\n\\n // Returns the amount of tokens in existence\\n function totalSupply() external view returns (uint);\\n\\n // Returns the amount of tokens owned by account\\n function balanceOf(address account) external view returns (uint);\\n\\n // Returns the decimals of tokens\\n function decimals() external view returns (uint8);\\n\\n function symbol() external view returns (string memory);\\n\\n // Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner\\n // through transferFrom. This is zero by default\\n // This value changes when approve or transferFrom are called\\n function allowance(address owner, address spender) external view returns (uint);\\n\\n // Sets amount as the allowance of spender over the caller\\u2019s tokens\\n // Returns a boolean value indicating whether the operation succeeded\\n // Emits an Approval event.\\n function approve(address spender, uint amount) external returns (bool);\\n\\n // Moves amount tokens from the caller\\u2019s account to recipient\\n // Returns a boolean value indicating whether the operation succeeded\\n // Emits a Transfer event.\\n function transfer(address recipient, uint amount) external returns (bool);\\n\\n // Moves amount tokens from sender to recipient using the allowance mechanism\\n // Amount is then deducted from the caller\\u2019s allowance\\n // Returns a boolean value indicating whether the operation succeeded\\n // Emits a Transfer event\\n function transferFrom(\\n address sender,\\n address recipient,\\n uint amount\\n ) external returns (bool);\\n}\\n\",\"keccak256\":\"0xfe22b6d6029b400b9cce7f9b39c546f99cd6922b2fd926e480e2b4d476ab26f8\",\"license\":\"GPL-3.0-or-later\"},\"contracts/interfaces/IUniswapV2Router02.sol\":{\"content\":\"// SPDX-License-Identifier: SimPL-2.0\\npragma solidity 0.6.12;\\n\\ninterface IUniswapV2Router02 {\\n function swapExactTokensForETH(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n\\n function swapExactTokensForTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n\\n function swapTokensForExactTokens(\\n uint amountOut,\\n uint amountInMax,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n}\\n\",\"keccak256\":\"0x60d530741cfbb28a1b39a0969cc0a7d330d1b3372be8a9ca5d521c8bc7dd3d3d\",\"license\":\"SimPL-2.0\"},\"contracts/libraries/Address.sol\":{\"content\":\"// SPDX-License-Identifier: agpl-3.0\\npragma solidity 0.6.12;\\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 function isContract(address account) internal view returns (bool) {\\n // According to EIP-1052, 0x0 is the value returned for not-yet created accounts\\n // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned\\n // for accounts without code, i.e. `keccak256('')`\\n bytes32 codehash;\\n bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\\n // solhint-disable-next-line no-inline-assembly\\n assembly {\\n codehash := extcodehash(account)\\n }\\n return (codehash != accountHash && codehash != 0x0);\\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, uint amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\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 uint 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 uint value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n return _functionCallWithValue(target, data, value, errorMessage);\\n }\\n\\n function _functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint weiValue,\\n string memory errorMessage\\n ) private returns (bytes memory) {\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n // solhint-disable-next-line avoid-low-level-calls\\n (bool success, bytes memory returndata) = target.call{value: weiValue}(data);\\n if (success) {\\n return returndata;\\n } else {\\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\\n // solhint-disable-next-line no-inline-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}\\n\",\"keccak256\":\"0x3ca4db613bd8c572ca2ed757e1fb0a3331fe48b4ce416fabac43e48aaf86e0ed\",\"license\":\"agpl-3.0\"},\"contracts/libraries/DesynConstants.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n/**\\n * @author Desyn Labs\\n * @title Put all the constants in one place\\n */\\n\\nlibrary DesynConstants {\\n // State variables (must be constant in a library)\\n\\n // B \\\"ONE\\\" - all math is in the \\\"realm\\\" of 10 ** 18;\\n // where numeric 1 = 10 ** 18\\n uint public constant BONE = 10**18;\\n uint public constant MIN_WEIGHT = BONE;\\n uint public constant MAX_WEIGHT = BONE * 50;\\n uint public constant MAX_TOTAL_WEIGHT = BONE * 50;\\n uint public constant MIN_BALANCE = BONE / 10**6;\\n uint public constant MAX_BALANCE = BONE * 10**12;\\n uint public constant MIN_POOL_SUPPLY = BONE * 100;\\n uint public constant MAX_POOL_SUPPLY = BONE * 10**9;\\n uint public constant MIN_FEE = BONE / 10**6;\\n uint public constant MAX_FEE = BONE / 10;\\n uint public constant MANAGER_MIN_FEE = BONE / 10**6;\\n uint public constant MANAGER_MAX_FEE = BONE / 10;\\n // EXIT_FEE must always be zero, or ConfigurableRightsPool._pushUnderlying will fail\\n uint public constant EXIT_FEE = 0;\\n uint public constant MAX_IN_RATIO = BONE / 2;\\n uint public constant MAX_OUT_RATIO = (BONE / 3) + 1 wei;\\n // Must match BConst.MIN_BOUND_TOKENS and BConst.MAX_BOUND_TOKENS\\n uint public constant MIN_ASSET_LIMIT = 1;\\n uint public constant MAX_ASSET_LIMIT = 16;\\n uint public constant MAX_UINT = uint(-1);\\n uint public constant MAX_COLLECT_PERIOD = 60 days;\\n}\\n\",\"keccak256\":\"0xc143170522bbdc5b746f70602005e15612ae72224bd6ff194514df473ae887de\",\"license\":\"GPL-3.0-or-later\"},\"contracts/libraries/DesynSafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n// Imports\\n\\nimport \\\"./DesynConstants.sol\\\";\\n\\n/**\\n * @author Desyn Labs\\n * @title SafeMath - wrap Solidity operators to prevent underflow/overflow\\n * @dev badd and bsub are basically identical to OpenZeppelin SafeMath; mul/div have extra checks\\n */\\nlibrary DesynSafeMath {\\n /**\\n * @notice Safe addition\\n * @param a - first operand\\n * @param b - second operand\\n * @dev if we are adding b to a, the resulting sum must be greater than a\\n * @return - sum of operands; throws if overflow\\n */\\n function badd(uint a, uint b) internal pure returns (uint) {\\n uint c = a + b;\\n require(c >= a, \\\"ERR_ADD_OVERFLOW\\\");\\n return c;\\n }\\n\\n /**\\n * @notice Safe unsigned subtraction\\n * @param a - first operand\\n * @param b - second operand\\n * @dev Do a signed subtraction, and check that it produces a positive value\\n * (i.e., a - b is valid if b <= a)\\n * @return - a - b; throws if underflow\\n */\\n function bsub(uint a, uint b) internal pure returns (uint) {\\n (uint c, bool negativeResult) = bsubSign(a, b);\\n require(!negativeResult, \\\"ERR_SUB_UNDERFLOW\\\");\\n return c;\\n }\\n\\n /**\\n * @notice Safe signed subtraction\\n * @param a - first operand\\n * @param b - second operand\\n * @dev Do a signed subtraction\\n * @return - difference between a and b, and a flag indicating a negative result\\n * (i.e., a - b if a is greater than or equal to b; otherwise b - a)\\n */\\n function bsubSign(uint a, uint b) internal pure returns (uint, bool) {\\n if (b <= a) {\\n return (a - b, false);\\n } else {\\n return (b - a, true);\\n }\\n }\\n\\n /**\\n * @notice Safe multiplication\\n * @param a - first operand\\n * @param b - second operand\\n * @dev Multiply safely (and efficiently), rounding down\\n * @return - product of operands; throws if overflow or rounding error\\n */\\n function bmul(uint a, uint b) internal pure returns (uint) {\\n // Gas optimization (see github.com/OpenZeppelin/openzeppelin-contracts/pull/522)\\n if (a == 0) {\\n return 0;\\n }\\n\\n // Standard overflow check: a/a*b=b\\n uint c0 = a * b;\\n require(c0 / a == b, \\\"ERR_MUL_OVERFLOW\\\");\\n\\n // Round to 0 if x*y < BONE/2?\\n uint c1 = c0 + (DesynConstants.BONE / 2);\\n require(c1 >= c0, \\\"ERR_MUL_OVERFLOW\\\");\\n uint c2 = c1 / DesynConstants.BONE;\\n return c2;\\n }\\n\\n /**\\n * @notice Safe division\\n * @param dividend - first operand\\n * @param divisor - second operand\\n * @dev Divide safely (and efficiently), rounding down\\n * @return - quotient; throws if overflow or rounding error\\n */\\n function bdiv(uint dividend, uint divisor) internal pure returns (uint) {\\n require(divisor != 0, \\\"ERR_DIV_ZERO\\\");\\n\\n // Gas optimization\\n if (dividend == 0) {\\n return 0;\\n }\\n\\n uint c0 = dividend * DesynConstants.BONE;\\n require(c0 / dividend == DesynConstants.BONE, \\\"ERR_DIV_INTERNAL\\\"); // bmul overflow\\n\\n uint c1 = c0 + (divisor / 2);\\n require(c1 >= c0, \\\"ERR_DIV_INTERNAL\\\"); // badd require\\n\\n uint c2 = c1 / divisor;\\n return c2;\\n }\\n\\n /**\\n * @notice Safe unsigned integer modulo\\n * @dev Returns the remainder of dividing two unsigned integers.\\n * Reverts when dividing by zero.\\n *\\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n * opcode (which leaves remaining gas untouched) while Solidity uses an\\n * invalid opcode to revert (consuming all remaining gas).\\n *\\n * @param dividend - first operand\\n * @param divisor - second operand -- cannot be zero\\n * @return - quotient; throws if overflow or rounding error\\n */\\n function bmod(uint dividend, uint divisor) internal pure returns (uint) {\\n require(divisor != 0, \\\"ERR_MODULO_BY_ZERO\\\");\\n\\n return dividend % divisor;\\n }\\n\\n /**\\n * @notice Safe unsigned integer max\\n * @dev Returns the greater of the two input values\\n *\\n * @param a - first operand\\n * @param b - second operand\\n * @return - the maximum of a and b\\n */\\n function bmax(uint a, uint b) internal pure returns (uint) {\\n return a >= b ? a : b;\\n }\\n\\n /**\\n * @notice Safe unsigned integer min\\n * @dev returns b, if b < a; otherwise returns a\\n *\\n * @param a - first operand\\n * @param b - second operand\\n * @return - the lesser of the two input values\\n */\\n function bmin(uint a, uint b) internal pure returns (uint) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @notice Safe unsigned integer average\\n * @dev Guard against (a+b) overflow by dividing each operand separately\\n *\\n * @param a - first operand\\n * @param b - second operand\\n * @return - the average of the two values\\n */\\n function baverage(uint a, uint b) internal pure returns (uint) {\\n // (a + b) / 2 can overflow, so we distribute\\n return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2);\\n }\\n\\n /**\\n * @notice Babylonian square root implementation\\n * @dev (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)\\n * @param y - operand\\n * @return z - the square root result\\n */\\n function sqrt(uint y) internal pure returns (uint z) {\\n if (y > 3) {\\n z = y;\\n uint x = y / 2 + 1;\\n while (x < z) {\\n z = x;\\n x = (y / x + x) / 2;\\n }\\n } else if (y != 0) {\\n z = 1;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9baf30b98a5f3a8c13ac9c4d5d4b176eabfd936aba8f5172c95b7c568fba68f3\",\"license\":\"GPL-3.0-or-later\"},\"contracts/libraries/SafeApprove.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n// Imports\\n\\nimport \\\"../interfaces/IERC20.sol\\\";\\n\\n// Libraries\\n\\n/**\\n * @author PieDAO (ported to Desyn Labs)\\n * @title SafeApprove - set approval for tokens that require 0 prior approval\\n * @dev Perhaps to address the known ERC20 race condition issue\\n * See https://github.com/crytic/not-so-smart-contracts/tree/master/race_condition\\n * Some tokens - notably KNC - only allow approvals to be increased from 0\\n */\\nlibrary SafeApprove {\\n /**\\n * @notice handle approvals of tokens that require approving from a base of 0\\n * @param token - the token we're approving\\n * @param spender - entity the owner (sender) is approving to spend his tokens\\n * @param amount - number of tokens being approved\\n */\\n function safeApprove(\\n IERC20 token,\\n address spender,\\n uint amount\\n ) internal returns (bool) {\\n uint currentAllowance = token.allowance(address(this), spender);\\n\\n // Do nothing if allowance is already set to this value\\n if (currentAllowance == amount) {\\n return true;\\n }\\n\\n // If approval is not zero reset it to zero first\\n if (currentAllowance != 0) {\\n token.approve(spender, 0);\\n }\\n\\n // do the actual approval\\n return token.approve(spender, amount);\\n }\\n}\\n\",\"keccak256\":\"0xa51ebf770f2676085b89b1636688cc086289cfe27f614dfd0c15142535c26752\",\"license\":\"GPL-3.0-or-later\"},\"contracts/libraries/SmartPoolManager.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\npragma solidity 0.6.12;\\n\\n// Needed to pass in structs\\npragma experimental ABIEncoderV2;\\n\\n// Imports\\n\\nimport \\\"../interfaces/IERC20.sol\\\";\\nimport \\\"../interfaces/IConfigurableRightsPool.sol\\\";\\nimport \\\"../interfaces/IBFactory.sol\\\"; // unused\\nimport \\\"./DesynSafeMath.sol\\\"; // unused\\nimport \\\"./SafeApprove.sol\\\";\\n\\n/**\\n * @author Desyn Labs\\n * @title Factor out the weight updates\\n */\\nlibrary SmartPoolManager {\\n //kol pool params\\n struct levelParams {\\n uint level;\\n uint ratio;\\n }\\n\\n struct feeParams {\\n levelParams firstLevel;\\n levelParams secondLevel;\\n levelParams thirdLevel;\\n levelParams fourLevel;\\n }\\n struct KolPoolParams {\\n feeParams managerFee;\\n feeParams issueFee;\\n feeParams redeemFee;\\n feeParams perfermanceFee;\\n }\\n\\n // Type declarations\\n enum Etypes {\\n OPENED,\\n CLOSED\\n }\\n\\n enum Period {\\n HALF,\\n ONE,\\n TWO\\n }\\n\\n // updateWeight and pokeWeights are unavoidably long\\n /* solhint-disable function-max-lines */\\n struct Status {\\n uint collectPeriod;\\n uint collectEndTime;\\n uint closurePeriod;\\n uint closureEndTime;\\n uint upperCap;\\n uint floorCap;\\n uint managerFee;\\n uint redeemFee;\\n uint issueFee;\\n uint perfermanceFee;\\n uint startClaimFeeTime;\\n }\\n\\n struct PoolParams {\\n // Desyn Pool Token (representing shares of the pool)\\n string poolTokenSymbol;\\n string poolTokenName;\\n // Tokens inside the Pool\\n address[] constituentTokens;\\n uint[] tokenBalances;\\n uint[] tokenWeights;\\n uint swapFee;\\n uint managerFee;\\n uint redeemFee;\\n uint issueFee;\\n uint perfermanceFee;\\n Etypes etype;\\n }\\n\\n struct PoolTokenRange {\\n uint bspFloor;\\n uint bspCap;\\n }\\n\\n struct Fund {\\n uint etfAmount;\\n uint fundAmount;\\n }\\n\\n function initRequire(\\n uint swapFee,\\n uint managerFee,\\n uint tokenBalancesLength,\\n uint tokenWeightsLength,\\n uint constituentTokensLength,\\n bool initBool\\n ) external pure {\\n // We don't have a pool yet; check now or it will fail later (in order of likelihood to fail)\\n // (and be unrecoverable if they don't have permission set to change it)\\n // Most likely to fail, so check first\\n require(!initBool, \\\"Init fail\\\");\\n require(swapFee >= DesynConstants.MIN_FEE, \\\"ERR_INVALID_SWAP_FEE\\\");\\n require(swapFee <= DesynConstants.MAX_FEE, \\\"ERR_INVALID_SWAP_FEE\\\");\\n require(managerFee >= DesynConstants.MANAGER_MIN_FEE, \\\"ERR_INVALID_MANAGER_FEE\\\");\\n require(managerFee <= DesynConstants.MANAGER_MAX_FEE, \\\"ERR_INVALID_MANAGER_FEE\\\");\\n\\n // Arrays must be parallel\\n require(tokenBalancesLength == constituentTokensLength, \\\"ERR_START_BALANCES_MISMATCH\\\");\\n require(tokenWeightsLength == constituentTokensLength, \\\"ERR_START_WEIGHTS_MISMATCH\\\");\\n // Cannot have too many or too few - technically redundant, since BPool.bind() would fail later\\n // But if we don't check now, we could have a useless contract with no way to create a pool\\n\\n require(constituentTokensLength >= DesynConstants.MIN_ASSET_LIMIT, \\\"ERR_TOO_FEW_TOKENS\\\");\\n require(constituentTokensLength <= DesynConstants.MAX_ASSET_LIMIT, \\\"ERR_TOO_MANY_TOKENS\\\");\\n // There are further possible checks (e.g., if they use the same token twice), but\\n // we can let bind() catch things like that (i.e., not things that might reasonably work)\\n }\\n\\n /**\\n * @notice Update the weight of an existing token\\n * @dev Refactored to library to make CRPFactory deployable\\n * @param self - ConfigurableRightsPool instance calling the library\\n * @param bPool - Core BPool the CRP is wrapping\\n * @param tokenA - token to sell\\n * @param tokenB - token to buy\\n */\\n function rebalance(\\n IConfigurableRightsPool self,\\n IBPool bPool,\\n address tokenA,\\n address tokenB,\\n uint deltaWeight,\\n uint minAmountOut\\n ) external {\\n uint currentWeightA = bPool.getDenormalizedWeight(tokenA);\\n uint currentBalanceA = bPool.getBalance(tokenA);\\n // uint currentWeightB = bPool.getDenormalizedWeight(tokenB);\\n\\n require(deltaWeight <= currentWeightA, \\\"ERR_DELTA_WEIGHT_TOO_BIG\\\");\\n\\n // deltaBalance = currentBalance * (deltaWeight / currentWeight)\\n uint deltaBalanceA = DesynSafeMath.bmul(currentBalanceA, DesynSafeMath.bdiv(deltaWeight, currentWeightA));\\n\\n // uint currentBalanceB = bPool.getBalance(tokenB);\\n\\n // uint deltaWeight = DesynSafeMath.bsub(newWeight, currentWeightA);\\n\\n // uint newWeightB = DesynSafeMath.bsub(currentWeightB, deltaWeight);\\n // require(newWeightB >= 0, \\\"ERR_INCORRECT_WEIGHT_B\\\");\\n bool soldout;\\n if (deltaWeight == currentWeightA) {\\n // reduct token A\\n bPool.unbindPure(tokenA);\\n soldout = true;\\n }\\n\\n // Now with the tokens this contract can bind them to the pool it controls\\n bPool.rebindSmart(tokenA, tokenB, deltaWeight, deltaBalanceA, soldout, minAmountOut);\\n }\\n\\n /**\\n * @notice Non ERC20-conforming tokens are problematic; don't allow them in pools\\n * @dev Will revert if invalid\\n * @param token - The prospective token to verify\\n */\\n function verifyTokenCompliance(address token) external {\\n verifyTokenComplianceInternal(token);\\n }\\n\\n /**\\n * @notice Non ERC20-conforming tokens are problematic; don't allow them in pools\\n * @dev Will revert if invalid - overloaded to save space in the main contract\\n * @param tokens - The prospective tokens to verify\\n */\\n function verifyTokenCompliance(address[] calldata tokens) external {\\n for (uint i = 0; i < tokens.length; i++) {\\n verifyTokenComplianceInternal(tokens[i]);\\n }\\n }\\n\\n function createPoolInternalHandle(IBPool bPool, uint initialSupply) external view {\\n require(initialSupply >= DesynConstants.MIN_POOL_SUPPLY, \\\"ERR_INIT_SUPPLY_MIN\\\");\\n require(initialSupply <= DesynConstants.MAX_POOL_SUPPLY, \\\"ERR_INIT_SUPPLY_MAX\\\");\\n require(bPool.EXIT_FEE() == 0, \\\"ERR_NONZERO_EXIT_FEE\\\");\\n // EXIT_FEE must always be zero, or ConfigurableRightsPool._pushUnderlying will fail\\n require(DesynConstants.EXIT_FEE == 0, \\\"ERR_NONZERO_EXIT_FEE\\\");\\n }\\n\\n function createPoolHandle(\\n uint collectPeriod,\\n uint upperCap,\\n uint initialSupply\\n ) external pure {\\n require(collectPeriod <= DesynConstants.MAX_COLLECT_PERIOD, \\\"ERR_EXCEEDS_FUND_RAISING_PERIOD\\\");\\n require(upperCap >= initialSupply, \\\"ERR_CAP_BIGGER_THAN_INITSUPPLY\\\");\\n // collectEndTime = block.timestamp + collectPeriod;\\n // if (boolA) {\\n // period = 1 seconds; // for test only\\n // } else if (boolB) {\\n // period = 365 days;\\n // } else {\\n // period = 730 days;\\n // }\\n // closureEndTime = period + collectEndTime;\\n }\\n\\n function exitPoolHandle(\\n uint _endEtfAmount,\\n uint _endFundAmount,\\n uint _beginEtfAmount,\\n uint _beginFundAmount,\\n uint poolAmountIn,\\n uint totalEnd\\n )\\n external\\n pure\\n returns (\\n uint endEtfAmount,\\n uint endFundAmount,\\n uint profitRate\\n )\\n {\\n endEtfAmount = DesynSafeMath.badd(_endEtfAmount, poolAmountIn);\\n endFundAmount = DesynSafeMath.badd(_endFundAmount, totalEnd);\\n uint amount1 = DesynSafeMath.bdiv(endFundAmount, endEtfAmount);\\n uint amount2 = DesynSafeMath.bdiv(_beginFundAmount, _beginEtfAmount);\\n if (amount1 > amount2) {\\n profitRate = DesynSafeMath.bdiv(\\n DesynSafeMath.bmul(DesynSafeMath.bsub(DesynSafeMath.bdiv(endFundAmount, endEtfAmount), DesynSafeMath.bdiv(_beginFundAmount, _beginEtfAmount)), poolAmountIn),\\n totalEnd\\n );\\n }\\n }\\n\\n function exitPoolHandleA(\\n uint _tokenAmountOut,\\n uint redeemFee,\\n uint profitRate,\\n uint perfermanceFee\\n )\\n external\\n pure\\n returns (\\n uint tokenAmountOutNew,\\n uint amount,\\n uint tokensAmountRedeem\\n )\\n {\\n uint tokenAmountOut = _tokenAmountOut;\\n tokenAmountOutNew = DesynSafeMath.bmul(tokenAmountOut, redeemFee);\\n tokensAmountRedeem = tokenAmountOutNew;\\n tokenAmountOutNew = DesynSafeMath.badd(DesynSafeMath.bmul(DesynSafeMath.bmul(tokenAmountOut, profitRate), perfermanceFee), tokenAmountOutNew);\\n amount = DesynSafeMath.bsub(tokenAmountOut, tokenAmountOutNew);\\n }\\n\\n function exitPoolHandleB(\\n bool bools,\\n bool isCompletedCollect,\\n uint closureEndTime,\\n uint collectEndTime,\\n uint _etfAmount,\\n uint _fundAmount,\\n uint poolAmountIn\\n ) external view returns (uint etfAmount, uint fundAmount) {\\n if (bools) {\\n bool isCloseEtfCollectEndWithFailure = isCompletedCollect == false && block.timestamp >= collectEndTime;\\n bool isCloseEtfClosureEnd = block.timestamp >= closureEndTime;\\n require(isCloseEtfCollectEndWithFailure || isCloseEtfClosureEnd, \\\"ERR_CLOSURE_TIME_NOT_ARRIVED!\\\");\\n }\\n fundAmount = _fundAmount;\\n etfAmount = _etfAmount;\\n if (bools && block.timestamp <= collectEndTime) {\\n fundAmount = DesynSafeMath.bmul(DesynSafeMath.bdiv(DesynSafeMath.bsub(_etfAmount, poolAmountIn), _etfAmount), _fundAmount);\\n etfAmount = DesynSafeMath.bsub(_etfAmount, poolAmountIn);\\n }\\n }\\n\\n function joinPoolHandle(\\n bool canWhitelistLPs,\\n bool isList,\\n bool bools,\\n uint collectEndTime\\n ) external view {\\n require(!canWhitelistLPs || isList, \\\"ERR_NOT_ON_WHITELIST\\\");\\n\\n if (bools) {\\n require(block.timestamp <= collectEndTime, \\\"ERR_COLLECT_PERIOD_FINISHED!\\\");\\n }\\n }\\n\\n function rebalanceHandle(\\n bool bools,\\n uint collectEndTime,\\n uint closureEndTime,\\n bool canChangeWeights,\\n address tokenA,\\n address tokenB\\n ) external view {\\n if (bools) {\\n require(block.timestamp > collectEndTime && block.timestamp < closureEndTime, \\\"ERR_NOT_REBALANCE_PERIOD\\\");\\n }\\n\\n require(canChangeWeights, \\\"ERR_NOT_CONFIGURABLE_WEIGHTS\\\");\\n require(tokenA != tokenB, \\\"ERR_TOKENS_SAME\\\");\\n }\\n\\n /**\\n * @notice Join a pool\\n * @param self - ConfigurableRightsPool instance calling the library\\n * @param bPool - Core BPool the CRP is wrapping\\n * @param poolAmountOut - number of pool tokens to receive\\n * @param maxAmountsIn - Max amount of asset tokens to spend\\n * @return actualAmountsIn - calculated values of the tokens to pull in\\n */\\n function joinPool(\\n IConfigurableRightsPool self,\\n IBPool bPool,\\n uint poolAmountOut,\\n uint[] calldata maxAmountsIn\\n ) external view returns (uint[] memory actualAmountsIn) {\\n address[] memory tokens = bPool.getCurrentTokens();\\n\\n require(maxAmountsIn.length == tokens.length, \\\"ERR_AMOUNTS_MISMATCH\\\");\\n\\n uint poolTotal = self.totalSupply();\\n // Subtract 1 to ensure any rounding errors favor the pool\\n uint ratio = DesynSafeMath.bdiv(poolAmountOut, DesynSafeMath.bsub(poolTotal, 1));\\n\\n require(ratio != 0, \\\"ERR_MATH_APPROX\\\");\\n\\n // We know the length of the array; initialize it, and fill it below\\n // Cannot do \\\"push\\\" in memory\\n actualAmountsIn = new uint[](tokens.length);\\n\\n // This loop contains external calls\\n // External calls are to math libraries or the underlying pool, so low risk\\n for (uint i = 0; i < tokens.length; i++) {\\n address t = tokens[i];\\n uint bal = bPool.getBalance(t);\\n // Add 1 to ensure any rounding errors favor the pool\\n uint tokenAmountIn = DesynSafeMath.bmul(ratio, DesynSafeMath.badd(bal, 1));\\n\\n require(tokenAmountIn != 0, \\\"ERR_MATH_APPROX\\\");\\n require(tokenAmountIn <= maxAmountsIn[i], \\\"ERR_LIMIT_IN\\\");\\n\\n actualAmountsIn[i] = tokenAmountIn;\\n }\\n }\\n\\n /**\\n * @notice Exit a pool - redeem pool tokens for underlying assets\\n * @param self - ConfigurableRightsPool instance calling the library\\n * @param bPool - Core BPool the CRP is wrapping\\n * @param poolAmountIn - amount of pool tokens to redeem\\n * @param minAmountsOut - minimum amount of asset tokens to receive\\n * @return pAiAfterExitFee - final amount in (after accounting for exit fee)\\n * @return actualAmountsOut - calculated amounts of each token to pull\\n */\\n function exitPool(\\n IConfigurableRightsPool self,\\n IBPool bPool,\\n uint poolAmountIn,\\n uint[] calldata minAmountsOut\\n ) external view returns (uint pAiAfterExitFee, uint[] memory actualAmountsOut) {\\n address[] memory tokens = bPool.getCurrentTokens();\\n\\n require(minAmountsOut.length == tokens.length, \\\"ERR_AMOUNTS_MISMATCH\\\");\\n\\n uint poolTotal = self.totalSupply();\\n\\n // Calculate exit fee and the final amount in\\n pAiAfterExitFee = DesynSafeMath.bsub(poolAmountIn, 0);\\n\\n uint ratio = DesynSafeMath.bdiv(pAiAfterExitFee, DesynSafeMath.badd(poolTotal, 1));\\n\\n require(ratio != 0, \\\"ERR_MATH_APPROX\\\");\\n\\n actualAmountsOut = new uint[](tokens.length);\\n\\n // This loop contains external calls\\n // External calls are to math libraries or the underlying pool, so low risk\\n for (uint i = 0; i < tokens.length; i++) {\\n address t = tokens[i];\\n uint bal = bPool.getBalance(t);\\n // Subtract 1 to ensure any rounding errors favor the pool\\n uint tokenAmountOut = DesynSafeMath.bmul(ratio, DesynSafeMath.bsub(bal, 1));\\n\\n require(tokenAmountOut != 0, \\\"ERR_MATH_APPROX\\\");\\n require(tokenAmountOut >= minAmountsOut[i], \\\"ERR_LIMIT_OUT\\\");\\n\\n actualAmountsOut[i] = tokenAmountOut;\\n }\\n }\\n\\n // Internal functions\\n // Check for zero transfer, and make sure it returns true to returnValue\\n function verifyTokenComplianceInternal(address token) internal {\\n bool returnValue = IERC20(token).transfer(msg.sender, 0);\\n require(returnValue, \\\"ERR_NONCONFORMING_TOKEN\\\");\\n }\\n\\n function WhitelistHandle(\\n bool bool1,\\n bool bool2,\\n address adr\\n ) external pure {\\n require(bool1, \\\"ERR_CANNOT_WHITELIST_LPS\\\");\\n require(bool2, \\\"ERR_LP_NOT_WHITELISTED\\\");\\n require(adr != address(0), \\\"ERR_INVALID_ADDRESS\\\");\\n }\\n}\\n\",\"keccak256\":\"0x5a6f6f1d68c0266c06abce0a1c7ddeee1cff45b3eabfe311bd9dd34ae71807b6\",\"license\":\"GPL-3.0-or-later\"}},\"version\":1}",
"bytecode": "0x608060408190526200001260a062000063565b601f1982820381018352601f9091011660405280516200003c916007916020919091019062000071565b503480156200004a57600080fd5b50600880546001600160a01b031916331790556200010d565b615856806200177e83390190565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000b457805160ff1916838001178555620000e4565b82800160010185558215620000e4579182015b82811115620000e4578251825591602001919060010190620000c7565b50620000f2929150620000f6565b5090565b5b80821115620000f25760008155600101620000f7565b611661806200011d6000396000f3fe608060405234801561001057600080fd5b50600436106101285760003560e01c806306ec16f81461012d5780630846396514610155578063131d6a12146101d257806336ffb167146102f557806338f0d24514610319578063412736571461035b5780636817031b146103815780636a36e3a2146103a7578063703a9ec9146103d5578063725c9c49146103dd5780637adbf973146103e55780638a53ea771461040b5780638b0e8e67146104395780638d928af81461045f5780638f49f44d14610467578063911fb0351461049357806391cefde41461049b5780639a86139b146104a3578063a6c245c4146104bd578063b18b78dd146105e0578063c6ce34fb146105e8578063ce2958ed1461060e578063db7ca46b14610634578063e85455d71461065a575b600080fd5b6101536004803603602081101561014357600080fd5b50356001600160a01b0316610680565b005b61015d61081d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019757818101518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610153600480360360408110156101e857600080fd5b810190602081018135600160201b81111561020257600080fd5b82018360208201111561021457600080fd5b803590602001918460208302840111600160201b8311171561023557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561028457600080fd5b82018360208201111561029657600080fd5b803590602001918460208302840111600160201b831117156102b757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108ab945050505050565b6102fd61098e565b604080516001600160a01b039092168252519081900360200190f35b6103476004803603604081101561032f57600080fd5b506001600160a01b038135811691602001351661099d565b604080519115158252519081900360200190f35b6101536004803603602081101561037157600080fd5b50356001600160a01b03166109cb565b6101536004803603602081101561039757600080fd5b50356001600160a01b0316610a72565b610153600480360360408110156103bd57600080fd5b506001600160a01b0381358116916020013516610b0e565b6102fd610c65565b6102fd610c74565b610153600480360360208110156103fb57600080fd5b50356001600160a01b0316610c83565b6101536004803603604081101561042157600080fd5b506001600160a01b0381358116916020013516610d2a565b6101536004803603602081101561044f57600080fd5b50356001600160a01b0316610e8b565b6102fd610f27565b6103476004803603604081101561047d57600080fd5b50803590602001356001600160a01b0316610f36565b6102fd610f49565b6102fd610f58565b6104ab611017565b60408051918252519081900360200190f35b610153600480360360408110156104d357600080fd5b810190602081018135600160201b8111156104ed57600080fd5b8201836020820111156104ff57600080fd5b803590602001918460208302840111600160201b8311171561052057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561056f57600080fd5b82018360208201111561058157600080fd5b803590602001918460208302840111600160201b831117156105a257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611024945050505050565b6102fd611107565b610153600480360360208110156105fe57600080fd5b50356001600160a01b0316611116565b6101536004803603602081101561062457600080fd5b50356001600160a01b03166111bd565b6103476004803603602081101561064a57600080fd5b50356001600160a01b0316611259565b6103476004803603602081101561067057600080fd5b50356001600160a01b031661126a565b6008546001600160a01b031633146106cf576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b50516008546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293506000929185169163a9059cbb9160448082019260209290919082900301818787803b1580156107a557600080fd5b505af11580156107b9573d6000803e3d6000fd5b505050506040513d60208110156107cf57600080fd5b5051905080610818576040805162461bcd60e51b815260206004820152601060248201526f11549497d15490cc8c17d1905253115160821b604482015290519081900360640190fd5b505050565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a35780601f10610878576101008083540402835291602001916108a3565b820191906000526020600020905b81548152906001019060200180831161088657829003601f168201915b505050505081565b6008546001600160a01b031633146108fa576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b805182511461094a576040805162461bcd60e51b815260206004820152601760248201527608aa4a4bea69ea4a8bea89e968a9cbe9a92a69a82a8869604b1b604482015290519081900360640190fd5b60005b82518110156108185761098683828151811061096557fe5b602002602001015183838151811061097957fe5b6020026020010151611288565b60010161094d565b6008546001600160a01b031690565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6008546001600160a01b03163314610a1a576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6040516001600160a01b0382169033907ff815765bd6d6c517d28ff37f93b0a22f1aaee69b50d788b6266f2d13f20c6d0990600090a3600980546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314610ac1576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b600d80546001600160a01b0319166001600160a01b0383169081179091556040513391907fb4dea88882442451a462d3bdfdca2f8ef2b3516e079b0d5aaff6460ccdb706f490600090a350565b6008546001600160a01b03163314610b5d576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6001600160a01b038216610bab576040805162461bcd60e51b815260206004820152601060248201526f5a45524f20455446204144445245535360801b604482015290519081900360640190fd5b6001600160a01b038116610bf5576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b604482015290519081900360640190fd5b6001600160a01b038083166000818152600560209081526040808320948616808452948252808320805460ff191690558051938452908301939093528183015290517f68c33efced6f26119f0dd6351ae1fb557d5329dfac87e377d4f9d1a1d77d8acb9181900360600190a15050565b600e546001600160a01b031690565b6009546001600160a01b031690565b6008546001600160a01b03163314610cd2576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6040516001600160a01b0382169033907f7301a3fa5e149ffdc294fe3b3ac0abb0ec25be499c812f4daa2edacaa85e44cd90600090a3600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314610d79576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6001600160a01b038216610dc7576040805162461bcd60e51b815260206004820152601060248201526f5a45524f20455446204144445245535360801b604482015290519081900360640190fd5b6001600160a01b038116610e11576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b604482015290519081900360640190fd5b6001600160a01b03808316600081815260056020908152604080832094861680845294825291829020805460ff191660019081179091558251938452908301939093528181019290925290517f68c33efced6f26119f0dd6351ae1fb557d5329dfac87e377d4f9d1a1d77d8acb9181900360600190a15050565b6008546001600160a01b03163314610eda576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b600e80546001600160a01b0319166001600160a01b0383169081179091556040513391907fbe29361fcb0d6d7a528b06b7e3c978b225c152a431ac559470986926fe26692590600090a350565b600d546001600160a01b031690565b6000610f428383611372565b9392505050565b600c546001600160a01b031690565b600080610f6361139d565b6001600160a01b038116600081815260046020526040808220805460ff1916600117905551929350909133917f8ccec77b0cb63ac2cafd0f5de8cdfadab91ce656d262240ba8a6343bccc5f94591a3604080516392eefe9b60e01b815233600482015290516001600160a01b038316916392eefe9b91602480830192600092919082900301818387803b158015610ff957600080fd5b505af115801561100d573d6000803e3d6000fd5b5092935050505090565b6542524f4e5a4560d01b90565b6008546001600160a01b03163314611073576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b80518251146110c3576040805162461bcd60e51b815260206004820152601760248201527608aa4a4bea69ea4a8bea89e968a9cbe9a92a69a82a8869604b1b604482015290519081900360640190fd5b60005b8251811015610818576110ff8382815181106110de57fe5b60200260200101518383815181106110f257fe5b6020026020010151611487565b6001016110c6565b600b546001600160a01b031690565b6008546001600160a01b03163314611165576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6040516001600160a01b0382169033907ff586fa6ee1fc42f5b727f3b214ccbd0b6d7e698c45d49ba32f224fbb8670155d90600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b0316331461120c576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b600c80546001600160a01b0319166001600160a01b0383169081179091556040513391907fdfa80e1b5701b0f43e2c819edc582ef49b743b1c914e8824cb01ed6156868c0a90600090a350565b6000611264826115e2565b92915050565b6001600160a01b031660009081526004602052604090205460ff1690565b611291816115e2565b15156001146112dd576040805162461bcd60e51b815260206004820152601360248201527222a9292fa727aa2faba424aa22afaa27a5a2a760691b604482015290519081900360640190fd5b60008281526003602090815260408083206001600160a01b03851684528252808320805460ff199081169091556002909252909120805490911690556001805460001901905561132b611600565b604080516001600160a01b038316815290513391849130917ff27ed63b9bdfafba10ef35fe37741d317458bbdb30dddc979bd9df79fc8b5d4f919081900360200190a45050565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6007805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181526000936060939192909183018282801561142b5780601f106114005761010080835404028352916020019161142b565b820191906000526020600020905b81548152906001019060200180831161140e57829003601f168201915b50506006805460018101909155604080516020808201939093528151808203840181529082019091528051908201208551959650948594509250850190506000f59250823b61147957600080fd5b505060068054600101905590565b6001600160a01b0381166114de576040805162461bcd60e51b81526020600482015260196024820152784552525f494e56414c49445f544f4b454e5f4144445245535360381b604482015290519081900360640190fd5b6114e7816115e2565b15611534576040805162461bcd60e51b81526020600482015260186024820152774552525f4841535f4245454e5f41444445445f574849544560401b604482015290519081900360640190fd5b60008281526003602090815260408083206001600160a01b038516845282528083208054600160ff199182168117909255600290935290832080549092161790555460ff1661158b576000805460ff191660011790555b600180548101905561159b611600565b604080516001600160a01b038316815290513391849130917f5ab6a0d7af8e86f78c34acea4f8aff1be027227ce1bc29e03f57f39b788f4b04919081900360200190a45050565b6001600160a01b031660009081526002602052604090205460ff1690565b6001541561161d576000805460ff19166001908117909155611628565b6000805460ff191681555b5056fea2646970667358221220a9f0a275ef6b3dd0f409912ae488579a0c18da988541594e9bb49be176dcbe1f64736f6c634300060c003360c0604052601060808190526f2232b9bcb7102837b7b6102a37b5b2b760811b60a090815262000033916003919062000175565b506040805180820190915260038082526211141560ea1b6020909201918252620000609160049162000175565b506005805460ff191660121790553480156200007b57600080fd5b5060068054336001600160a01b031990911681179091556005805462010000600160b01b03191662010000909202919091179055620f4240670de0b6b3a7640000046007556006805460ff60a01b191690556008805460ff191690556005546040805163b18b78dd60e01b81529051620100009092046001600160a01b03169163b18b78dd91600480820192602092909190829003018186803b1580156200012257600080fd5b505afa15801562000137573d6000803e3d6000fd5b505050506040513d60208110156200014e57600080fd5b5051600c80546001600160a01b0319166001600160a01b0390921691909117905562000211565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620001b857805160ff1916838001178555620001e8565b82800160010185558215620001e8579182015b82811115620001e8578251825591602001919060010190620001cb565b50620001f6929150620001fa565b5090565b5b80821115620001f65760008155600101620001fb565b61563580620002216000396000f3fe6080604052600436106102bb5760003560e01c8063992e2a921161016c578063992e2a92146108a75780639a86139b146108bc578063a221ee49146108d1578063a61e44f514610913578063a9059cbb14610946578063b02f0b731461097f578063b0e0d13614610a01578063b61d27f614610a16578063b7b800a414610aa6578063ba019dab14610aa6578063ba9530a614610abb578063bc063e1a14610b03578063bc694ea214610b18578063be3bbd2e14610b2d578063c36596a6146103ef578063c6580d1214610b92578063cbf3a56b14610ba7578063cc77828d14610bfe578063cd2ed8fb14610c13578063cf5e7bd314610c28578063d4cadf6814610c5b578063d73dd62314610c70578063dd62ed3e14610ca9578063e4a28a521461039e578063e4e1e53814610ce4578063ec09302114610d23578063f1b8a9b714610d38578063f8b2cb4f14610d6b578063f8d6aed414610d9e578063fde924f714610de6576102c2565b806306fdde03146102c7578063095ea7b31461035157806309a3bbe41461039e57806318160ddd146103c5578063189d00ca146103da578063218b5382146103ef57806323b872dd146104045780632f37b624146104475780633018205f1461047a578063313ce567146104ab57806334e19907146104d65780633fdddaa21461050257806349b59552146105415780634bb278f31461056d5780634f69c0d4146105825780635c1bbaf714610604578063661884631461064c57806370a082311461068557806376c7a3c7146106b857806382f652ad146106cd5780638656b65314610715578063867378c51461075d57806389298012146107725780638c28cbe8146107ba5780638d4e4083146107ed57806392eefe9b14610802578063936c3477146108355780639381cd2b1461084a578063948d8ce61461085f57806395d89b4114610892576102c2565b366102c257005b600080fd5b3480156102d357600080fd5b506102dc610dfb565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103165781810151838201526020016102fe565b50505050905090810190601f1680156103435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035d57600080fd5b5061038a6004803603604081101561037457600080fd5b506001600160a01b038135169060200135610e91565b604080519115158252519081900360200190f35b3480156103aa57600080fd5b506103b3610ee6565b60408051918252519081900360200190f35b3480156103d157600080fd5b506103b3610ef3565b3480156103e657600080fd5b506103b3610ef9565b3480156103fb57600080fd5b506103b3610f0d565b34801561041057600080fd5b5061038a6004803603606081101561042757600080fd5b506001600160a01b03813581169160208101359091169060400135610f19565b34801561045357600080fd5b5061038a6004803603602081101561046a57600080fd5b50356001600160a01b0316611070565b34801561048657600080fd5b5061048f61108e565b604080516001600160a01b039092168252519081900360200190f35b3480156104b757600080fd5b506104c06110ec565b6040805160ff9092168252519081900360200190f35b3480156104e257600080fd5b50610500600480360360208110156104f957600080fd5b50356110f5565b005b34801561050e57600080fd5b506105006004803603606081101561052557600080fd5b506001600160a01b0381351690602081013590604001356112e6565b34801561054d57600080fd5b506105006004803603602081101561056457600080fd5b503515156116b0565b34801561057957600080fd5b50610500611827565b34801561058e57600080fd5b50610500600480360360408110156105a557600080fd5b81359190810190604081016020820135600160201b8111156105c657600080fd5b8201836020820111156105d857600080fd5b803590602001918460208302840111600160201b831117156105f957600080fd5b509092509050611a12565b34801561061057600080fd5b506103b3600480360360c081101561062757600080fd5b5080359060208101359060408101359060608101359060808101359060a00135611d0b565b34801561065857600080fd5b5061038a6004803603604081101561066f57600080fd5b506001600160a01b038135169060200135611dc3565b34801561069157600080fd5b506103b3600480360360208110156106a857600080fd5b50356001600160a01b0316611e9b565b3480156106c457600080fd5b506103b3611eb6565b3480156106d957600080fd5b506103b3600480360360c08110156106f057600080fd5b5080359060208101359060408101359060608101359060808101359060a00135611ec8565b34801561072157600080fd5b506103b3600480360360c081101561073857600080fd5b5080359060208101359060408101359060608101359060808101359060a00135611f87565b34801561076957600080fd5b506103b3612028565b34801561077e57600080fd5b506103b3600480360360c081101561079557600080fd5b5080359060208101359060408101359060608101359060808101359060a0013561203c565b3480156107c657600080fd5b50610500600480360360208110156107dd57600080fd5b50356001600160a01b03166120ec565b3480156107f957600080fd5b5061038a6122a0565b34801561080e57600080fd5b506105006004803603602081101561082557600080fd5b50356001600160a01b03166122a9565b34801561084157600080fd5b506103b36123e0565b34801561085657600080fd5b506103b3612435565b34801561086b57600080fd5b506103b36004803603602081101561088257600080fd5b50356001600160a01b0316612442565b34801561089e57600080fd5b506102dc61250c565b3480156108b357600080fd5b506103b361256d565b3480156108c857600080fd5b506103b3612579565b3480156108dd57600080fd5b506103b3600480360360a08110156108f457600080fd5b5080359060208101359060408101359060608101359060800135612586565b34801561091f57600080fd5b506105006004803603602081101561093657600080fd5b50356001600160a01b03166125eb565b34801561095257600080fd5b5061038a6004803603604081101561096957600080fd5b506001600160a01b0381351690602001356128f3565b34801561098b57600080fd5b50610500600480360360408110156109a257600080fd5b81359190810190604081016020820135600160201b8111156109c357600080fd5b8201836020820111156109d557600080fd5b803590602001918460208302840111600160201b831117156109f657600080fd5b509092509050612909565b348015610a0d57600080fd5b506103b3612c02565b348015610a2257600080fd5b506102dc60048036036060811015610a3957600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b811115610a6857600080fd5b820183602082011115610a7a57600080fd5b803590602001918460018302840111600160201b83111715610a9b57600080fd5b509092509050612c07565b348015610ab257600080fd5b506103b3612db8565b348015610ac757600080fd5b506103b3600480360360c0811015610ade57600080fd5b5080359060208101359060408101359060608101359060808101359060a00135612dbd565b348015610b0f57600080fd5b506103b3612e3e565b348015610b2457600080fd5b506103b3612e4e565b348015610b3957600080fd5b50610b42612e5a565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610b7e578181015183820152602001610b66565b505050509050019250505060405180910390f35b348015610b9e57600080fd5b506103b3612f52565b348015610bb357600080fd5b50610500600480360360c0811015610bca57600080fd5b506001600160a01b038135811691602081013590911690604081013590606081013590608081013515159060a00135612f57565b348015610c0a57600080fd5b50610b42613d3d565b348015610c1f57600080fd5b506103b3613d8b565b348015610c3457600080fd5b5061050060048036036020811015610c4b57600080fd5b50356001600160a01b0316613d91565b348015610c6757600080fd5b506103b36140d5565b348015610c7c57600080fd5b5061038a60048036036040811015610c9357600080fd5b506001600160a01b03813516906020013561412a565b348015610cb557600080fd5b506103b360048036036040811015610ccc57600080fd5b506001600160a01b03813581169160200135166141ab565b348015610cf057600080fd5b5061050060048036036060811015610d0757600080fd5b506001600160a01b0381351690602081013590604001356141d6565b348015610d2f57600080fd5b506103b3614421565b348015610d4457600080fd5b506103b360048036036020811015610d5b57600080fd5b50356001600160a01b0316614431565b348015610d7757600080fd5b506103b360048036036020811015610d8e57600080fd5b50356001600160a01b031661473e565b348015610daa57600080fd5b506103b3600480360360c0811015610dc157600080fd5b5080359060208101359060408101359060608101359060808101359060a00135614808565b348015610df257600080fd5b5061038a61488b565b60038054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e875780601f10610e5c57610100808354040283529160200191610e87565b820191906000526020600020905b815481529060010190602001808311610e6a57829003601f168201915b5050505050905090565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390926000805160206155c0833981519152928290030190a35060015b92915050565b6802b5e3af16b188000081565b60025490565b6402540be400670de0b6b3a76400005b0481565b670de0b6b3a764000081565b6000336001600160a01b0385161480610f5557506001600160a01b03841660009081526001602090815260408083203384529091529020548211155b610f9f576040805162461bcd60e51b815260206004820152601660248201527522a9292fa6282a27a5a2a72fa120a22fa1a0a62622a960511b604482015290519081900360640190fd5b610faa84848461489b565b336001600160a01b03851614801590610fe857506001600160a01b038416600090815260016020908152604080832033845290915290205460001914155b15611066576001600160a01b038416600090815260016020908152604080832033845290915290205461101b9083614999565b6001600160a01b0385166000818152600160209081526040808320338085529083529281902085905580519485525191936000805160206155c0833981519152929081900390910190a35b5060019392505050565b6001600160a01b03166000908152600a602052604090205460ff1690565b600554600090610100900460ff16156110dc576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b506006546001600160a01b031690565b60055460ff1690565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156111a1576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16156111f6576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b6006546001600160a01b03163314611243576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b64e8d4a5100081101561128b576040805162461bcd60e51b815260206004820152600b60248201526a4552525f4d494e5f46454560a81b604482015290519081900360640190fd5b67016345785d8a00008111156112d6576040805162461bcd60e51b815260206004820152600b60248201526a4552525f4d41585f46454560a81b604482015290519081900360640190fd5b6007556005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611392576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b03909116146113f0576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b6001600160a01b0383166000908152600a602052604090205460ff1661144d576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b60085460ff1615611493576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b670de0b6b3a76400008110156114e1576040805162461bcd60e51b815260206004820152600e60248201526d11549497d3525397d5d15251d21560921b604482015290519081900360640190fd5b6802b5e3af16b1880000811115611530576040805162461bcd60e51b815260206004820152600e60248201526d11549497d3505617d5d15251d21560921b604482015290519081900360640190fd5b620f424082101561157a576040805162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015290519081900360640190fd5b6001600160a01b0383166000908152600a602052604090206002015480821115611611576115b3600b546115ae8484614999565b6149fb565b600b8190556802b5e3af16b1880000101561160c576040805162461bcd60e51b815260206004820152601460248201527311549497d3505617d513d5105317d5d15251d21560621b604482015290519081900360640190fd5b611632565b808210156116325761162e600b546116298385614999565b614999565b600b555b6001600160a01b0384166000908152600a60205260409020600281018390556003018054908490558084111561167b5761167685336116718785614999565b614a4f565b61169e565b8084101561169e57600061168f8286614999565b905061169c863383614b20565b505b50506005805461ff0019169055505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff161561175c576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16156117b1576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b6006546001600160a01b031633146117fe576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b60068054911515600160a01b0260ff60a01b199092169190911790556005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156118d3576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b0390911614611931576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b60085460ff1615611977576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b600954600111156119c0576040805162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015290519081900360640190fd5b6008805460ff191660011790556006805460ff60a01b1916600160a01b1790556119f268056bc75e2d63100000614b79565b611a053368056bc75e2d63100000614b85565b6005805461ff0019169055565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615611abe576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16611b18576040805162461bcd60e51b815260206004820152601160248201527011549497d393d517d19253905312569151607a1b604482015290519081900360640190fd5b6000611b22610ef3565b90506000611b308583614b93565b905080611b76576040805162461bcd60e51b815260206004820152600f60248201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604482015290519081900360640190fd5b60005b600954811015611cf757600060098281548110611b9257fe5b60009182526020808320909101546001600160a01b0316808352600a909152604082206003015490925090611bc78583614ca6565b905080611c0d576040805162461bcd60e51b815260206004820152600f60248201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604482015290519081900360640190fd5b878785818110611c1957fe5b90506020020135811115611c63576040805162461bcd60e51b815260206004820152600c60248201526b22a9292fa624a6a4aa2fa4a760a11b604482015290519081900360640190fd5b6001600160a01b0383166000908152600a6020526040902060030154611c8990826149fb565b6001600160a01b0384166000818152600a60209081526040918290206003019390935580518481529051919233927f63982df10efd8dfaaaa0fcc7f50b2d93b7cba26ccc48adee2873220d485dc39a9281900390910190a3611cec833383614a4f565b505050600101611b79565b50611d0185614b79565b61169e3386614b85565b600080611d188786614b93565b90506000611d2687866149fb565b90506000611d348289614b93565b90506000611d4a670de0b6b3a764000085614b93565b90506000611d588383614d68565b90506000611d66828e614ca6565b90506000611d74828f614999565b90506000611d93611d8d670de0b6b3a76400008a614999565b8b614ca6565b9050611db082611dab670de0b6b3a764000084614999565b614b93565b9f9e505050505050505050505050505050565b3360009081526001602090815260408083206001600160a01b038616845290915281205480831115611e18573360009081526001602090815260408083206001600160a01b0388168452909152812055611e47565b611e228184614999565b3360009081526001602090815260408083206001600160a01b03891684529091529020555b3360008181526001602090815260408083206001600160a01b0389168085529083529281902054815190815290519293926000805160206155c0833981519152929181900390910190a35060019392505050565b6001600160a01b031660009081526020819052604090205490565b620f4240670de0b6b3a7640000610f09565b600080611ed58786614b93565b90506000611eeb670de0b6b3a764000083614999565b90506000611ef98286614ca6565b90506000611f1387611dab670de0b6b3a764000085614999565b90506000611f218c83614999565b90506000611f2f828e614b93565b90506000611f3d8288614d68565b90506000611f4b828e614ca6565b90506000611f598e83614999565b9050611f7281611dab670de0b6b3a76400006000614999565b99505050505050505050509695505050505050565b600080611f948786614b93565b90506000611fb3611fad670de0b6b3a764000084614999565b85614ca6565b90506000611fd286611fcd670de0b6b3a764000085614999565b614ca6565b90506000611fe08b836149fb565b90506000611fee828d614b93565b90506000611ffc8287614d68565b9050600061200a828d614ca6565b9050612016818d614999565b9e9d5050505050505050505050505050565b64e8d4a51000670de0b6b3a7640000610f09565b6000806120498786614b93565b9050600061206485611fcd670de0b6b3a76400006000614999565b905060006120728883614999565b90506000612080828a614b93565b9050600061209f8261209a670de0b6b3a764000088614b93565b614d68565b905060006120ad828e614ca6565b905060006120bb8e83614999565b905060006120d4611d8d670de0b6b3a76400008a614999565b9050611db082611fcd670de0b6b3a764000084614999565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612198576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff0019166101001790556001600160a01b0381166000908152600a602052604090205460ff16612204576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561224a57600080fd5b505afa15801561225e573d6000803e3d6000fd5b505050506040513d602081101561227457600080fd5b50516001600160a01b039091166000908152600a60205260409020600301556005805461ff0019169055565b60085460ff1690565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612355576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b03909116146123b3576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b03929092169190911790556005805461ff0019169055565b600554600090610100900460ff161561242e576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b50600b5490565b68056bc75e2d6310000081565b600554600090610100900460ff1615612490576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a602052604090205460ff166124ed576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b506001600160a01b03166000908152600a602052604090206002015490565b60048054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610e875780601f10610e5c57610100808354040283529160200191610e87565b6704a03ce68d21555681565b6542524f4e5a4560d01b90565b6000806125938787614b93565b905060006125a18686614b93565b905060006125af8383614b93565b905060006125d1670de0b6b3a7640000611dab670de0b6b3a764000089614999565b90506125dd8282614ca6565b9a9950505050505050505050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612697576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b03909116146126f5576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600a602052604090205460ff16612752576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b60085460ff1615612798576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600a60205260409020600101546009805460001981019190829081106127c957fe5b600091825260209091200154600980546001600160a01b0390921691849081106127ef57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600a60006009858154811061282f57fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902060010155600980548061286257fe5b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b03999099168652600a909452919093209251835460ff1916901515178355516001830155516002820155925160039093019290925550506005805461ff0019169055565b600061290033848461489b565b50600192915050565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff16156129b5576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff00191661010017905560085460ff16612a0f576040805162461bcd60e51b815260206004820152601160248201527011549497d393d517d19253905312569151607a1b604482015290519081900360640190fd5b6000612a19610ef3565b90506000612a278583614b93565b905080612a6d576040805162461bcd60e51b815260206004820152600f60248201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604482015290519081900360640190fd5b612a773386614e6b565b612a8085614e75565b60005b60095481101561169c57600060098281548110612a9c57fe5b60009182526020808320909101546001600160a01b0316808352600a909152604082206003015490925090612ad18583614ca6565b905080612b17576040805162461bcd60e51b815260206004820152600f60248201526e08aa4a4be9a82a890be82a0a0a49eb608b1b604482015290519081900360640190fd5b878785818110612b2357fe5b90506020020135811015612b6e576040805162461bcd60e51b815260206004820152600d60248201526c11549497d31253525517d3d555609a1b604482015290519081900360640190fd5b6001600160a01b0383166000908152600a6020526040902060030154612b949082614999565b6001600160a01b0384166000818152600a60209081526040918290206003019390935580518481529051919233927fe74c91552b64c2e2e7bd255639e004e693bd3e1d01cc33e65610b86afcc1ffed9281900390910190a3612bf7833383614b20565b505050600101612a83565b601081565b6060336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615612cb5576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b0390911614612d13576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b60085460ff1615612d59576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b612da483838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050506001600160a01b03881691905086614e7e565b6005805461ff001916905595945050505050565b600181565b600080612dca8786614b93565b90506000612de0670de0b6b3a764000085614999565b9050612dec8582614ca6565b90506000612dfe8a611dab8c856149fb565b90506000612e0c8285614d68565b90506000612e22670de0b6b3a764000083614999565b9050612e2e8a82614ca6565b9c9b505050505050505050505050565b600a670de0b6b3a7640000610f09565b671bc16d674ec7ffff81565b600554606090610100900460ff1615612ea8576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b60085460ff16612ef3576040805162461bcd60e51b815260206004820152601160248201527011549497d393d517d19253905312569151607a1b604482015290519081900360640190fd5b6009805480602002602001604051908101604052809291908181526020018280548015610e8757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612f2b575050505050905090565b600081565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613003576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b0390911614613061576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b60085460ff16156130a7576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b604080516002808252606080830184529260208301908036833701905050905086816000815181106130d557fe5b60200260200101906001600160a01b031690816001600160a01b031681525050858160018151811061310357fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506000600560029054906101000a90046001600160a01b03166001600160a01b031663725c9c496040518163ffffffff1660e01b815260040160206040518083038186803b15801561317357600080fd5b505afa158015613187573d6000803e3d6000fd5b505050506040513d602081101561319d57600080fd5b50516001600160a01b0388166000908152600a602052604090205490915060ff16156136d4576001600160a01b0387166000908152600a60205260408120600281015460039091015490916131f2838a6149fb565b90506802b5e3af16b1880000811115613245576040805162461bcd60e51b815260206004820152601060248201526f22a9292fa6a0ac2faba2a4a3a42a2fa160811b604482015290519081900360640190fd5b86156132995760095460011115613294576040805162461bcd60e51b815260206004820152600e60248201526d4552525f4d494e5f544f4b454e5360901b604482015290519081900360640190fd5b61340b565b6001600160a01b038b166000908152600a602052604090205460ff166132f8576040805162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f545f424f554e445f4160881b604482015290519081900360640190fd5b6001600160a01b038b166000908152600a602052604081206002015461331e908b614999565b6001600160a01b038d166000908152600a602052604081206003015491925090613348908b614999565b9050670de0b6b3a764000082101561339a576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d494e5f5745494748545f4160801b604482015290519081900360640190fd5b620f42408110156133e6576040805162461bcd60e51b81526020600482015260116024820152704552525f4d494e5f42414c414e43455f4160781b604482015290519081900360640190fd5b6001600160a01b038d166000908152600a602052604090206003810191909155600201555b60008a6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561345a57600080fd5b505afa15801561346e573d6000803e3d6000fd5b505050506040513d602081101561348457600080fd5b505190506134958c86600019614eac565b846001600160a01b03166338ed17398a8989306134b4426107086149fb565b6040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561352457818101518382015260200161350c565b505050509050019650505050505050600060405180830381600087803b15801561354d57600080fd5b505af1158015613561573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561358a57600080fd5b8101908080516040519392919084600160201b8211156135a957600080fd5b9083019060208201858111156135be57600080fd5b82518660208202830111600160201b821117156135da57600080fd5b82525081516020918201928201910280838360005b838110156136075781810151838201526020016135ef565b505050509050016040525050505060008b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561366457600080fd5b505afa158015613678573d6000803e3d6000fd5b505050506040513d602081101561368e57600080fd5b5051905060006136a2856115ae8486614999565b6001600160a01b038e166000908152600a6020526040902060038101919091556002019390935550613ca29350505050565b83613893576001600160a01b0388166000908152600a602052604090205460ff16613738576040805162461bcd60e51b815260206004820152600f60248201526e4552525f4e4f545f424f554e445f4160881b604482015290519081900360640190fd5b6001600160a01b0388166000908152600a602052604081206002015461375e9088614999565b6001600160a01b038a166000908152600a6020526040812060030154919250906137889088614999565b9050670de0b6b3a76400008210156137da576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d494e5f5745494748545f4160801b604482015290519081900360640190fd5b620f4240811015613826576040805162461bcd60e51b81526020600482015260116024820152704552525f4d494e5f42414c414e43455f4160781b604482015290519081900360640190fd5b60095460101161386e576040805162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015290519081900360640190fd5b6001600160a01b038a166000908152600a602052604090206003810191909155600201555b6000876001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156138e257600080fd5b505afa1580156138f6573d6000803e3d6000fd5b505050506040513d602081101561390c57600080fd5b5051905061391d8983600019614eac565b816001600160a01b03166338ed17398786863061393c426107086149fb565b6040518663ffffffff1660e01b81526004018086815260200185815260200180602001846001600160a01b03168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156139ac578181015183820152602001613994565b505050509050019650505050505050600060405180830381600087803b1580156139d557600080fd5b505af11580156139e9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015613a1257600080fd5b8101908080516040519392919084600160201b821115613a3157600080fd5b908301906020820185811115613a4657600080fd5b82518660208202830111600160201b82111715613a6257600080fd5b82525081516020918201928201910280838360005b83811015613a8f578181015183820152602001613a77565b50505050905001604052505050506000886001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015613aec57600080fd5b505afa158015613b00573d6000803e3d6000fd5b505050506040513d6020811015613b1657600080fd5b505190506000613b268284614999565b9050620f4240811015613b72576040805162461bcd60e51b815260206004820152600f60248201526e4552525f4d494e5f42414c414e434560881b604482015290519081900360640190fd5b670de0b6b3a7640000891015613bc6576040805162461bcd60e51b81526020600482015260146024820152734552525f4d494e5f5745494748545f44454c544160601b604482015290519081900360640190fd5b604051806080016040528060011515815260200160098054905081526020018a815260200182815250600a60008c6001600160a01b03166001600160a01b0316815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160010155604082015181600201556060820151816003015590505060098a9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b031602179055505050505b6001600160a01b038881166000818152600a60209081526040808320600280820154968e168086529483902090810154600392830154929091015483519788529387015285820152606085019190915287151560808501525190927f1443af20d568c33073f294c76ace1e6eaa41ce1c11cbfe69a4d58cb11410deb4919081900360a00190a350506005805461ff0019169055505050505050565b600554606090610100900460ff1615612ef3576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b60095490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2600554610100900460ff1615613e3d576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6005805461ff001916610100179055600654336001600160a01b0390911614613e9b576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600a602052604090205460ff16613ef8576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b60085460ff1615613f3e576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b6001600160a01b0381166000908152600a602052604090206003810154600b546002909201549091613f6f91614999565b600b556001600160a01b0382166000908152600a6020526040902060010154600980546000198101919082908110613fa357fe5b600091825260209091200154600980546001600160a01b039092169184908110613fc957fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600a60006009858154811061400957fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902060010155600980548061403c57fe5b60008281526020808220600019908401810180546001600160a01b031916905590920190925560408051608081018252838152808301848152818301858152606083018681526001600160a01b038b168752600a909552929094209051815460ff191690151517815592516001840155516002830155516003909101556140c4843385614b20565b50506005805461ff00191690555050565b600554600090610100900460ff1615614123576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b5060075490565b3360009081526001602090815260408083206001600160a01b038616845290915281205461415890836149fb565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191936000805160206155c0833981519152929081900390910190a350600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b336001600160a01b03166000356001600160e01b0319166001600160e01b03191660003660405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a26006546001600160a01b03163314614284576040805162461bcd60e51b81526020600482015260126024820152600080516020615557833981519152604482015290519081900360640190fd5b6001600160a01b0383166000908152600a602052604090205460ff16156142e1576040805162461bcd60e51b815260206004820152600c60248201526b11549497d254d7d093d5539160a21b604482015290519081900360640190fd5b60085460ff1615614327576040805162461bcd60e51b815260206004820152601060248201526000805160206155e0833981519152604482015290519081900360640190fd5b60095460101161436f576040805162461bcd60e51b815260206004820152600e60248201526d4552525f4d41585f544f4b454e5360901b604482015290519081900360640190fd5b6040805160808101825260018082526009805460208085019182526000858701818152606087018281526001600160a01b038c16808452600a9094529782209651875460ff1916901515178755925186860155915160028601559451600390940193909355805491820181559091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b031916909117905561441c8383836112e6565b505050565b6002670de0b6b3a7640000610f09565b600554600090610100900460ff161561447f576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a602052604090205460ff166144dc576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b6001600160a01b038083166000818152600a6020908152604080832060020154600c5482516341976e0960e01b8152600481019690965291519095939491909316926341976e099260248084019391929182900301818787803b15801561454257600080fd5b505af1158015614556573d6000803e3d6000fd5b505050506040513d602081101561456c57600080fd5b505160095490915060609067ffffffffffffffff8111801561458d57600080fd5b506040519080825280602002602001820160405280156145b7578160200160208202803683370190505b50905060005b600954811015614610576145f1600982815481106145d757fe5b6000918252602090912001546001600160a01b031661473e565b8282815181106145fd57fe5b60209081029190910101526001016145bd565b50600c546040805163108ad9bd60e21b81526004810191825260098054604483018190526000946001600160a01b03169363422b66f4938792829160248101916064909101908690801561468d57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161466f575b50508381038252845181528451602091820191808701910280838360005b838110156146c35781810151838201526020016146ab565b50505050905001945050505050602060405180830381600087803b1580156146ea57600080fd5b505af11580156146fe573d6000803e3d6000fd5b505050506040513d602081101561471457600080fd5b50519050600061472784611fcd8961473e565b90506147338183614b93565b979650505050505050565b600554600090610100900460ff161561478c576040805162461bcd60e51b815260206004820152600b60248201526a4552525f5245454e54525960a81b604482015290519081900360640190fd5b6001600160a01b0382166000908152600a602052604090205460ff166147e9576040805162461bcd60e51b815260206004820152600d60248201526c11549497d393d517d093d55391609a1b604482015290519081900360640190fd5b506001600160a01b03166000908152600a602052604090206003015490565b6000806148158588614b93565b905060006148238786614999565b905060006148318883614b93565b9050600061483f8285614d68565b905061485381670de0b6b3a7640000614999565b9050614867670de0b6b3a764000087614999565b945061487c6148768c83614ca6565b86614b93565b9b9a5050505050505050505050565b600654600160a01b900460ff1690565b6001600160a01b0383166000908152602081905260409020548111156148ff576040805162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015290519081900360640190fd5b6001600160a01b0383166000908152602081905260409020546149229082614999565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461495190826149fb565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716926000805160206155a083398151915292918290030190a3505050565b60008060006149a8858561503c565b9150915080156149f3576040805162461bcd60e51b81526020600482015260116024820152704552525f5355425f554e444552464c4f5760781b604482015290519081900360640190fd5b509392505050565b600082820183811015614a48576040805162461bcd60e51b815260206004820152601060248201526f4552525f4144445f4f564552464c4f5760801b604482015290519081900360640190fd5b9392505050565b604080516323b872dd60e01b81526001600160a01b0384811660048301523060248301526044820184905291516000928616916323b872dd91606480830192602092919082900301818787803b158015614aa857600080fd5b505af1158015614abc573d6000803e3d6000fd5b505050506040513d6020811015614ad257600080fd5b5051905080614b1a576040805162461bcd60e51b815260206004820152600f60248201526e4552525f45524332305f46414c534560881b604482015290519081900360640190fd5b50505050565b6000836001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015614aa857600080fd5b614b8281615061565b50565b614b8f82826150c4565b5050565b600081614bd6576040805162461bcd60e51b815260206004820152600c60248201526b4552525f4449565f5a45524f60a01b604482015290519081900360640190fd5b670de0b6b3a76400008302831580614bfe5750670de0b6b3a7640000848281614bfb57fe5b04145b614c42576040805162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015290519081900360640190fd5b60028304810181811015614c90576040805162461bcd60e51b815260206004820152601060248201526f11549497d1125597d25395115493905360821b604482015290519081900360640190fd5b6000848281614c9b57fe5b049695505050505050565b6000828202831580614cc0575082848281614cbd57fe5b04145b614d04576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015290519081900360640190fd5b6706f05b59d3b20000810181811015614d57576040805162461bcd60e51b815260206004820152601060248201526f4552525f4d554c5f4f564552464c4f5760801b604482015290519081900360640190fd5b6000670de0b6b3a764000082614c9b565b60006001831015614db8576040805162461bcd60e51b81526020600482015260156024820152744552525f42504f575f424153455f544f4f5f4c4f5760581b604482015290519081900360640190fd5b671bc16d674ec7ffff831115614e0e576040805162461bcd60e51b815260206004820152601660248201527508aa4a4be84a09eaebe8482a68abea89e9ebe90928e960531b604482015290519081900360640190fd5b6000614e19836150cf565b90506000614e278483614999565b90506000614e3d86614e38856150ea565b6150f8565b905081614e4e579250610ee0915050565b6000614e5f87846305f5e10061514f565b90506147338282614ca6565b614b8f828261522d565b614b8281615238565b6060614ea4848484604051806060016040528060298152602001615577602991396152f6565b949350505050565b60408051636eb1769f60e11b81523060048201526001600160a01b038481166024830152915160009286169163dd62ed3e916044808301926020929190829003018186803b158015614efd57600080fd5b505afa158015614f11573d6000803e3d6000fd5b505050506040513d6020811015614f2757600080fd5b50511115614fb457826001600160a01b031663095ea7b38360006040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015614f8757600080fd5b505af1158015614f9b573d6000803e3d6000fd5b505050506040513d6020811015614fb157600080fd5b50505b826001600160a01b031663095ea7b383836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561500b57600080fd5b505af115801561501f573d6000803e3d6000fd5b505050506040513d602081101561503557600080fd5b5050505050565b600080828410615052575050808203600061505a565b505081810360015b9250929050565b3060009081526020819052604090205461507b90826149fb565b3060009081526020819052604090205560025461509890826149fb565b60025560408051828152905130916000916000805160206155a08339815191529181900360200190a350565b614b8f30838361489b565b6000670de0b6b3a76400006150e3836150ea565b0292915050565b670de0b6b3a7640000900490565b6000806002830661511157670de0b6b3a7640000615113565b835b90506002830492505b8215614a485761512c8485614ca6565b93506002830615615144576151418185614ca6565b90505b60028304925061511c565b600082818061516687670de0b6b3a764000061503c565b9092509050670de0b6b3a764000080600060015b88841061521e576000670de0b6b3a7640000820290506000806151ae8a6151a985670de0b6b3a7640000614999565b61503c565b915091506151c087611fcd848c614ca6565b96506151cc8784614b93565b9650866151db5750505061521e565b87156151e5579315935b80156151ef579315935b8415615206576151ff8688614999565b9550615213565b61521086886149fb565b95505b50505060010161517a565b50909998505050505050505050565b614b8f82308361489b565b30600090815260208190526040902054811115615293576040805162461bcd60e51b815260206004820152601460248201527311549497d25394d551919250d251539517d0905360621b604482015290519081900360640190fd5b306000908152602081905260409020546152ad9082614999565b306000908152602081905260409020556002546152ca9082614999565b60025560408051828152905160009130916000805160206155a08339815191529181900360200190a350565b6060824710156153375760405162461bcd60e51b81526004018080602001828103825260268152602001806155316026913960400191505060405180910390fd5b6153438585858561534c565b95945050505050565b6060615357856154f7565b6153a8576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106153e75780518252601f1990920191602091820191016153c8565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114615449576040519150601f19603f3d011682016040523d82523d6000602084013e61544e565b606091505b50915091508115615462579150614ea49050565b8051156154725780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156154bc5781810151838201526020016154a4565b50505050905090810190601f1680156154e95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590614ea457505015159291505056fe416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4552525f4e4f545f434f4e54524f4c4c45520000000000000000000000000000416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9254552525f49535f46494e414c495a454400000000000000000000000000000000a26469706673582212202d752baba28f5b3ba7bc1e75344a2156fc1170cf0b684a68997c65e202f9e73e64736f6c634300060c0033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101285760003560e01c806306ec16f81461012d5780630846396514610155578063131d6a12146101d257806336ffb167146102f557806338f0d24514610319578063412736571461035b5780636817031b146103815780636a36e3a2146103a7578063703a9ec9146103d5578063725c9c49146103dd5780637adbf973146103e55780638a53ea771461040b5780638b0e8e67146104395780638d928af81461045f5780638f49f44d14610467578063911fb0351461049357806391cefde41461049b5780639a86139b146104a3578063a6c245c4146104bd578063b18b78dd146105e0578063c6ce34fb146105e8578063ce2958ed1461060e578063db7ca46b14610634578063e85455d71461065a575b600080fd5b6101536004803603602081101561014357600080fd5b50356001600160a01b0316610680565b005b61015d61081d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019757818101518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610153600480360360408110156101e857600080fd5b810190602081018135600160201b81111561020257600080fd5b82018360208201111561021457600080fd5b803590602001918460208302840111600160201b8311171561023557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561028457600080fd5b82018360208201111561029657600080fd5b803590602001918460208302840111600160201b831117156102b757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108ab945050505050565b6102fd61098e565b604080516001600160a01b039092168252519081900360200190f35b6103476004803603604081101561032f57600080fd5b506001600160a01b038135811691602001351661099d565b604080519115158252519081900360200190f35b6101536004803603602081101561037157600080fd5b50356001600160a01b03166109cb565b6101536004803603602081101561039757600080fd5b50356001600160a01b0316610a72565b610153600480360360408110156103bd57600080fd5b506001600160a01b0381358116916020013516610b0e565b6102fd610c65565b6102fd610c74565b610153600480360360208110156103fb57600080fd5b50356001600160a01b0316610c83565b6101536004803603604081101561042157600080fd5b506001600160a01b0381358116916020013516610d2a565b6101536004803603602081101561044f57600080fd5b50356001600160a01b0316610e8b565b6102fd610f27565b6103476004803603604081101561047d57600080fd5b50803590602001356001600160a01b0316610f36565b6102fd610f49565b6102fd610f58565b6104ab611017565b60408051918252519081900360200190f35b610153600480360360408110156104d357600080fd5b810190602081018135600160201b8111156104ed57600080fd5b8201836020820111156104ff57600080fd5b803590602001918460208302840111600160201b8311171561052057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561056f57600080fd5b82018360208201111561058157600080fd5b803590602001918460208302840111600160201b831117156105a257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611024945050505050565b6102fd611107565b610153600480360360208110156105fe57600080fd5b50356001600160a01b0316611116565b6101536004803603602081101561062457600080fd5b50356001600160a01b03166111bd565b6103476004803603602081101561064a57600080fd5b50356001600160a01b0316611259565b6103476004803603602081101561067057600080fd5b50356001600160a01b031661126a565b6008546001600160a01b031633146106cf576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b50516008546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293506000929185169163a9059cbb9160448082019260209290919082900301818787803b1580156107a557600080fd5b505af11580156107b9573d6000803e3d6000fd5b505050506040513d60208110156107cf57600080fd5b5051905080610818576040805162461bcd60e51b815260206004820152601060248201526f11549497d15490cc8c17d1905253115160821b604482015290519081900360640190fd5b505050565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108a35780601f10610878576101008083540402835291602001916108a3565b820191906000526020600020905b81548152906001019060200180831161088657829003601f168201915b505050505081565b6008546001600160a01b031633146108fa576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b805182511461094a576040805162461bcd60e51b815260206004820152601760248201527608aa4a4bea69ea4a8bea89e968a9cbe9a92a69a82a8869604b1b604482015290519081900360640190fd5b60005b82518110156108185761098683828151811061096557fe5b602002602001015183838151811061097957fe5b6020026020010151611288565b60010161094d565b6008546001600160a01b031690565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b6008546001600160a01b03163314610a1a576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6040516001600160a01b0382169033907ff815765bd6d6c517d28ff37f93b0a22f1aaee69b50d788b6266f2d13f20c6d0990600090a3600980546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314610ac1576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b600d80546001600160a01b0319166001600160a01b0383169081179091556040513391907fb4dea88882442451a462d3bdfdca2f8ef2b3516e079b0d5aaff6460ccdb706f490600090a350565b6008546001600160a01b03163314610b5d576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6001600160a01b038216610bab576040805162461bcd60e51b815260206004820152601060248201526f5a45524f20455446204144445245535360801b604482015290519081900360640190fd5b6001600160a01b038116610bf5576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b604482015290519081900360640190fd5b6001600160a01b038083166000818152600560209081526040808320948616808452948252808320805460ff191690558051938452908301939093528183015290517f68c33efced6f26119f0dd6351ae1fb557d5329dfac87e377d4f9d1a1d77d8acb9181900360600190a15050565b600e546001600160a01b031690565b6009546001600160a01b031690565b6008546001600160a01b03163314610cd2576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6040516001600160a01b0382169033907f7301a3fa5e149ffdc294fe3b3ac0abb0ec25be499c812f4daa2edacaa85e44cd90600090a3600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b03163314610d79576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6001600160a01b038216610dc7576040805162461bcd60e51b815260206004820152601060248201526f5a45524f20455446204144445245535360801b604482015290519081900360640190fd5b6001600160a01b038116610e11576040805162461bcd60e51b815260206004820152600c60248201526b5a45524f204144445245535360a01b604482015290519081900360640190fd5b6001600160a01b03808316600081815260056020908152604080832094861680845294825291829020805460ff191660019081179091558251938452908301939093528181019290925290517f68c33efced6f26119f0dd6351ae1fb557d5329dfac87e377d4f9d1a1d77d8acb9181900360600190a15050565b6008546001600160a01b03163314610eda576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b600e80546001600160a01b0319166001600160a01b0383169081179091556040513391907fbe29361fcb0d6d7a528b06b7e3c978b225c152a431ac559470986926fe26692590600090a350565b600d546001600160a01b031690565b6000610f428383611372565b9392505050565b600c546001600160a01b031690565b600080610f6361139d565b6001600160a01b038116600081815260046020526040808220805460ff1916600117905551929350909133917f8ccec77b0cb63ac2cafd0f5de8cdfadab91ce656d262240ba8a6343bccc5f94591a3604080516392eefe9b60e01b815233600482015290516001600160a01b038316916392eefe9b91602480830192600092919082900301818387803b158015610ff957600080fd5b505af115801561100d573d6000803e3d6000fd5b5092935050505090565b6542524f4e5a4560d01b90565b6008546001600160a01b03163314611073576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b80518251146110c3576040805162461bcd60e51b815260206004820152601760248201527608aa4a4bea69ea4a8bea89e968a9cbe9a92a69a82a8869604b1b604482015290519081900360640190fd5b60005b8251811015610818576110ff8382815181106110de57fe5b60200260200101518383815181106110f257fe5b6020026020010151611487565b6001016110c6565b600b546001600160a01b031690565b6008546001600160a01b03163314611165576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b6040516001600160a01b0382169033907ff586fa6ee1fc42f5b727f3b214ccbd0b6d7e698c45d49ba32f224fbb8670155d90600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b6008546001600160a01b0316331461120c576040805162461bcd60e51b815260206004820152600d60248201526c4552525f4e4f545f424c41425360981b604482015290519081900360640190fd5b600c80546001600160a01b0319166001600160a01b0383169081179091556040513391907fdfa80e1b5701b0f43e2c819edc582ef49b743b1c914e8824cb01ed6156868c0a90600090a350565b6000611264826115e2565b92915050565b6001600160a01b031660009081526004602052604090205460ff1690565b611291816115e2565b15156001146112dd576040805162461bcd60e51b815260206004820152601360248201527222a9292fa727aa2faba424aa22afaa27a5a2a760691b604482015290519081900360640190fd5b60008281526003602090815260408083206001600160a01b03851684528252808320805460ff199081169091556002909252909120805490911690556001805460001901905561132b611600565b604080516001600160a01b038316815290513391849130917ff27ed63b9bdfafba10ef35fe37741d317458bbdb30dddc979bd9df79fc8b5d4f919081900360200190a45050565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6007805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181526000936060939192909183018282801561142b5780601f106114005761010080835404028352916020019161142b565b820191906000526020600020905b81548152906001019060200180831161140e57829003601f168201915b50506006805460018101909155604080516020808201939093528151808203840181529082019091528051908201208551959650948594509250850190506000f59250823b61147957600080fd5b505060068054600101905590565b6001600160a01b0381166114de576040805162461bcd60e51b81526020600482015260196024820152784552525f494e56414c49445f544f4b454e5f4144445245535360381b604482015290519081900360640190fd5b6114e7816115e2565b15611534576040805162461bcd60e51b81526020600482015260186024820152774552525f4841535f4245454e5f41444445445f574849544560401b604482015290519081900360640190fd5b60008281526003602090815260408083206001600160a01b038516845282528083208054600160ff199182168117909255600290935290832080549092161790555460ff1661158b576000805460ff191660011790555b600180548101905561159b611600565b604080516001600160a01b038316815290513391849130917f5ab6a0d7af8e86f78c34acea4f8aff1be027227ce1bc29e03f57f39b788f4b04919081900360200190a45050565b6001600160a01b031660009081526002602052604090205460ff1690565b6001541561161d576000805460ff19166001908117909155611628565b6000805460ff191681555b5056fea2646970667358221220a9f0a275ef6b3dd0f409912ae488579a0c18da988541594e9bb49be176dcbe1f64736f6c634300060c0033",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 6497,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_hasInit",
"offset": 0,
"slot": "0",
"type": "t_bool"
},
{
"astId": 6499,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_whiteTokenCount",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 6503,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_isTokenWhitelisted",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_address,t_bool)"
},
{
"astId": 6509,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_tokenWhitelistedInfo",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))"
},
{
"astId": 8811,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_isLiquidityPool",
"offset": 0,
"slot": "4",
"type": "t_mapping(t_address,t_bool)"
},
{
"astId": 8817,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_isModuleRegistered",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_address,t_mapping(t_address,t_bool))"
},
{
"astId": 8819,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "counters",
"offset": 0,
"slot": "6",
"type": "t_uint256"
},
{
"astId": 8825,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "bytecodes",
"offset": 0,
"slot": "7",
"type": "t_bytes_storage"
},
{
"astId": 9011,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_blabs",
"offset": 0,
"slot": "8",
"type": "t_address"
},
{
"astId": 9013,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_swapRouter",
"offset": 0,
"slot": "9",
"type": "t_address"
},
{
"astId": 9015,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_vault",
"offset": 0,
"slot": "10",
"type": "t_address"
},
{
"astId": 9017,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_oracle",
"offset": 0,
"slot": "11",
"type": "t_address"
},
{
"astId": 9019,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_managerOwner",
"offset": 0,
"slot": "12",
"type": "t_address"
},
{
"astId": 9021,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_vaultAddress",
"offset": 0,
"slot": "13",
"type": "t_address"
},
{
"astId": 9023,
"contract": "contracts/deploy/Factory.sol:Factory",
"label": "_userVaultAddress",
"offset": 0,
"slot": "14",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_bytes_storage": {
"encoding": "bytes",
"label": "bytes",
"numberOfBytes": "32"
},
"t_mapping(t_address,t_bool)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => bool)",
"numberOfBytes": "32",
"value": "t_bool"
},
"t_mapping(t_address,t_mapping(t_address,t_bool))": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => mapping(address => bool))",
"numberOfBytes": "32",
"value": "t_mapping(t_address,t_bool)"
},
"t_mapping(t_uint256,t_mapping(t_address,t_bool))": {
"encoding": "mapping",
"key": "t_uint256",
"label": "mapping(uint256 => mapping(address => bool))",
"numberOfBytes": "32",
"value": "t_mapping(t_address,t_bool)"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}