-
-
Notifications
You must be signed in to change notification settings - Fork 240
/
Unlock.json
4734 lines (4734 loc) · 209 KB
/
Unlock.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"contractName": "Unlock",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "locks",
"outputs": [
{
"name": "deployed",
"type": "bool"
},
{
"name": "totalSales",
"type": "uint256"
},
{
"name": "yieldedDiscountTokens",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalDiscountGranted",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "grossNetworkProduct",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "lockOwner",
"type": "address"
},
{
"indexed": true,
"name": "newLockAddress",
"type": "address"
}
],
"name": "NewLock",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "initialize",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_keyReleaseMechanism",
"type": "uint8"
},
{
"name": "_expirationDuration",
"type": "uint256"
},
{
"name": "_keyPrice",
"type": "uint256"
},
{
"name": "_maxNumberOfKeys",
"type": "uint256"
}
],
"name": "createLock",
"outputs": [
{
"name": "lock",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_purchaser",
"type": "address"
},
{
"name": "_keyPrice",
"type": "uint256"
}
],
"name": "computeAvailableDiscountFor",
"outputs": [
{
"name": "discount",
"type": "uint256"
},
{
"name": "tokens",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_value",
"type": "uint256"
},
{
"name": "_referrer",
"type": "address"
}
],
"name": "recordKeyPurchase",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_discount",
"type": "uint256"
},
{
"name": "_tokens",
"type": "uint256"
}
],
"name": "recordConsumedDiscount",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405260008054600160a060020a03191633179055611b9c806100256000396000f3006080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630cb175e381146100a85780632bc888bf146100e557806336524663146101255780635de9a137146101425780638da5cb5b14610183578063939d9f1f14610198578063a082eb0e146101bc578063c4d66de8146101e3578063d6e9e80314610204578063f2fde38b14610219575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a036004351660243561023a565b6040805192835260208301919091528051918290030190f35b3480156100f157600080fd5b5061010960ff60043516602435604435606435610243565b60408051600160a060020a039092168252519081900360200190f35b34801561013157600080fd5b50610140600435602435610338565b005b34801561014e57600080fd5b50610163600160a060020a03600435166103ea565b604080519315158452602084019290925282820152519081900360600190f35b34801561018f57600080fd5b5061010961040f565b3480156101a457600080fd5b50610140600435600160a060020a036024351661041e565b3480156101c857600080fd5b506101d16104d0565b60408051918252519081900360200190f35b3480156101ef57600080fd5b50610140600160a060020a03600435166104d6565b34801561021057600080fd5b506101d161052d565b34801561022557600080fd5b50610140600160a060020a0360043516610533565b50600091829150565b60008033868686866102536105c7565b600160a060020a03861681526020810185600281111561026f57fe5b60ff16815260200184815260200183815260200182815260200195505050505050604051809103906000f0801580156102ac573d6000803e3d6000fd5b5060408051606081018252600180825260006020808401828152848601838152600160a060020a03881680855260039093528684209551865460ff191690151517865590519385019390935591516002909301929092559151929350909133917f01017ed19df0c7f8acc436147b234b09664a9fb4797b4fa3fb9e599c2eb67be791a395945050505050565b3360009081526003602052604090205460ff1615156103de57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4f6e6c792066726f6d2070726576696f75736c79206465706c6f796564206c6f60448201527f636b730000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60028054830190555050565b60036020526000908152604090208054600182015460029092015460ff909116919083565b600054600160a060020a031681565b3360009081526003602052604090205460ff1615156104c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4f6e6c792066726f6d2070726576696f75736c79206465706c6f796564206c6f60448201527f636b730000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60018054830190555050565b60025481565b60045460ff16156104e657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117815560018181556002919091556004805460ff19169091179055565b60015481565b600054600160a060020a0316331461054a57600080fd5b600160a060020a038116151561055f57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604051611599806105d8833901905600608060405234801561001057600080fd5b5060405160a08061159983398101604090815281516020830151918301516060840151608090940151600080546001805433600160a060020a031991821681178084559382161716600160a060020a038716179092559395929385919060a060020a60ff0219167401000000000000000000000000000000000000000083600281111561009957fe5b021790555060029290925560035560045550506114de806100bb6000396000f3006080604052600436106100f85763ffffffff60e060020a600035041663025e7c2781146100fd578063081812fc14610131578063095ea7b3146101495780630f15023b1461016257806310e569731461017757806311a4c03a1461019e57806323b872dd146101b35780633ccfd60b146101d057806347a51015146101e557806347dc10851461021e57806353b704d0146102335780636352211e1461025357806370a082311461026b57806374b6c1061461028c5780638da5cb5b146102a15780639f98d3cb146102b6578063abdf82ce146102d7578063d44fa14a146102f8578063d8125eb31461038e578063f2fde38b146103b6575b600080fd5b34801561010957600080fd5b506101156004356103d7565b60408051600160a060020a039092168252519081900360200190f35b34801561013d57600080fd5b506101156004356103ff565b610160600160a060020a0360043516602435610410565b005b34801561016e57600080fd5b5061011561057e565b34801561018357600080fd5b5061018c61058d565b60408051918252519081900360200190f35b3480156101aa57600080fd5b5061018c610593565b610160600160a060020a0360043581169060243516604435610599565b3480156101dc57600080fd5b506101606108fb565b3480156101f157600080fd5b506101fa6109ab565b6040518082600281111561020a57fe5b60ff16815260200191505060405180910390f35b34801561022a57600080fd5b5061018c6109bb565b61016060048035600160a060020a031690602480359081019101356109c2565b34801561025f57600080fd5b50610115600435610a03565b34801561027757600080fd5b5061018c600160a060020a0360043516610a6c565b34801561029857600080fd5b5061018c610b00565b3480156102ad57600080fd5b50610115610b06565b3480156102c257600080fd5b50610160600160a060020a0360043516610b15565b3480156102e357600080fd5b5061018c600160a060020a0360043516610bbd565b34801561030457600080fd5b50610319600160a060020a0360043516610c3c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561035357818101518382015260200161033b565b50505050905090810190601f1680156103805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610160600160a060020a03600480358216916024803590911691604435918201910135610d4f565b3480156103c257600080fd5b50610160600160a060020a0360043516610e05565b60068054829081106103e557fe5b600091825260209091200154600160a060020a0316905081565b600061040a82610e99565b92915050565b80600260015460a060020a900460ff16600281111561042b57fe5b14156104a7576040805160e560020a62461bcd02815260206004820152602a60248201527f4f6e6c7920616c6c6f776564206f6e207075626c6963206f722072657374726960448201527f63746564206c6f636b7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b600054600160a060020a03163314806104ea5750600160a060020a038116331480156104ea5750600060015460a060020a900460ff1660028111156104e857fe5b145b15156104f557600080fd5b600160a060020a038316151561050a57600080fd5b600160a060020a03828116600081815260076020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff19169488169485179055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600154600160a060020a031681565b60035481565b60025481565b6006546004546000911061061d576040805160e560020a62461bcd02815260206004820152602360248201527f4d6178696d756d206e756d626572206f66206b65797320616c7265616479207360448201527f6f6c640000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600060015460a060020a900460ff16600281111561063757fe5b1461068c576040805160e560020a62461bcd02815260206004820152601c60248201527f4f6e6c7920616c6c6f776564206f6e207075626c6963206c6f636b7300000000604482015290519081900360640190fd5b600160a060020a038216600090815260056020526040812080548492106106eb576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b83600160a060020a03811633148061071357503361070882610e99565b600160a060020a0316145b1515610769576040805160e560020a62461bcd02815260206004820181905260248201527f4f6e6c79206b6579206f776e6572206f7220617070726f766564206f776e6572604482015290519081900360640190fd5b600160a060020a038616151561077e57600080fd5b600160a060020a03861660009081526005602052604090205493508315156107f957600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388161790555b42841161082857600160a060020a03808816600090815260056020526040808220549289168252902055610855565b600160a060020a038088166000908152600560205260408082205492891682529020429186019190910390555b600160a060020a03878116600090815260056020526040808220928916825290206001918201805461089c9392830192600290821615610100026000190190911604611385565b50600160a060020a0380881660008181526005602090815260409182902042905581518981529151938a16937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350505050505050565b60008054600160a060020a0316331461091357600080fd5b5030316000811161096e576040805160e560020a62461bcd02815260206004820152601060248201527f4e6f7420656e6f7567682066756e647300000000000000000000000000000000604482015290519081900360640190fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f193505050501580156109a7573d6000803e3d6000fd5b5050565b60015460a060020a900460ff1681565b6006545b90565b6109fe83600084848080601f01602080910402602001604051908101604052809392919081815260200183838082843750610ec2945050505050565b505050565b600160a060020a038116600090815260056020526040812080548391908310610a64576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b509192915050565b600160a060020a038116600090815260056020526040812080548391908310610acd576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b600160a060020a03841660009081526005602052604081205411610af2576000610af5565b60015b60ff16949350505050565b60045481565b600054600160a060020a031681565b600054600160a060020a03163314610b2c57600080fd5b600160a060020a038116600090815260056020526040902080548291904210610b9f576040805160e560020a62461bcd02815260206004820152601060248201527f4b6579206973206e6f742076616c696400000000000000000000000000000000604482015290519081900360640190fd5b5050600160a060020a03166000908152600560205260409020429055565b600160a060020a038116600090815260056020526040812080548391908310610c1e576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b505050600160a060020a031660009081526005602052604090205490565b600160a060020a0381166000908152600560205260408120805460609284929111610c9f576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b600160a060020a038416600090815260056020908152604091829020600190810180548451600293821615610100026000190190911692909204601f810184900484028301840190945283825290929091830182828015610d415780601f10610d1657610100808354040283529160200191610d41565b820191906000526020600020905b815481529060010190602001808311610d2457829003601f168201915b505050505092505050919050565b600160a060020a038316600090815260056020526040902080548491904210610dc2576040805160e560020a62461bcd02815260206004820152601060248201527f4b6579206973206e6f742076616c696400000000000000000000000000000000604482015290519081900360640190fd5b610dfd868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843750610ec2945050505050565b505050505050565b600054600160a060020a03163314610e1c57600080fd5b600160a060020a0381161515610e3157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0380821660009081526007602052604081205490911680151561040a57600080fd5b6000806000806000600680549050600454111515610f50576040805160e560020a62461bcd02815260206004820152602360248201527f4d6178696d756d206e756d626572206f66206b65797320616c7265616479207360448201527f6f6c640000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b87600060015460a060020a900460ff166002811115610f6b57fe5b1480610fb157506001805460a060020a900460ff166002811115610f8b57fe5b148015610fb15750600160a060020a038116610fa681610e99565b600160a060020a0316145b151561102d576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c79207075626c6963206c6f636b73206f7220726573747269636564207760448201527f69746820616e20617070726f76656420726563697069656e7400000000000000606482015290519081900360840190fd5b600160a060020a038916151561104257600080fd5b600154600354604080517f0cb175e3000000000000000000000000000000000000000000000000000000008152600160a060020a038d81166004830152602482019390935281519290931698508892630cb175e392604480830193928290030181600087803b1580156110b457600080fd5b505af11580156110c8573d6000803e3d6000fd5b505050506040513d60408110156110de57600080fd5b5080516020909101516003549196509450925082851115611102576000925061110a565b846003540392505b34831115611162576040805160e560020a62461bcd02815260206004820152601260248201527f496e73756666696369656e742066756e64730000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0389166000908152600560205260409020549150428210156111f85760068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038b16908117909155600254600091825260056020526040909120429091019055611219565b600254600160a060020a038a16600090815260056020526040902090830190555b600160a060020a03891660009081526005602090815260409091208851611248926001909201918a019061140a565b5060008511156112bc5785600160a060020a0316633652466386866040518363ffffffff1660e060020a0281526004018083815260200182815260200192505050600060405180830381600087803b1580156112a357600080fd5b505af11580156112b7573d6000803e3d6000fd5b505050505b85600160a060020a031663939d9f1f848a6040518363ffffffff1660e060020a0281526004018083815260200182600160a060020a0316600160a060020a0316815260200192505050600060405180830381600087803b15801561131f57600080fd5b505af1158015611333573d6000803e3d6000fd5b505060408051600160a060020a038d168082529151919350600092507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113be57805485556113fa565b828001600101855582156113fa57600052602060002091601f016020900482015b828111156113fa5782548255916001019190600101906113df565b50611406929150611478565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144b57805160ff19168380011785556113fa565b828001600101855582156113fa579182015b828111156113fa57825182559160200191906001019061145d565b6109bf91905b80821115611406576000815560010161147e56004e6f2073756368206b6579000000000000000000000000000000000000000000a165627a7a723058200b3274f0068f785dda3d9e93e217d0a044726131fb1648f42ecff973a8dd2fed0029a165627a7a72305820a8313821ede155d9b7df1af34dfac0202c912b057a28cb694856e21e8684a3bc0029",
"deployedBytecode": "0x6080604052600436106100a35763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630cb175e381146100a85780632bc888bf146100e557806336524663146101255780635de9a137146101425780638da5cb5b14610183578063939d9f1f14610198578063a082eb0e146101bc578063c4d66de8146101e3578063d6e9e80314610204578063f2fde38b14610219575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a036004351660243561023a565b6040805192835260208301919091528051918290030190f35b3480156100f157600080fd5b5061010960ff60043516602435604435606435610243565b60408051600160a060020a039092168252519081900360200190f35b34801561013157600080fd5b50610140600435602435610338565b005b34801561014e57600080fd5b50610163600160a060020a03600435166103ea565b604080519315158452602084019290925282820152519081900360600190f35b34801561018f57600080fd5b5061010961040f565b3480156101a457600080fd5b50610140600435600160a060020a036024351661041e565b3480156101c857600080fd5b506101d16104d0565b60408051918252519081900360200190f35b3480156101ef57600080fd5b50610140600160a060020a03600435166104d6565b34801561021057600080fd5b506101d161052d565b34801561022557600080fd5b50610140600160a060020a0360043516610533565b50600091829150565b60008033868686866102536105c7565b600160a060020a03861681526020810185600281111561026f57fe5b60ff16815260200184815260200183815260200182815260200195505050505050604051809103906000f0801580156102ac573d6000803e3d6000fd5b5060408051606081018252600180825260006020808401828152848601838152600160a060020a03881680855260039093528684209551865460ff191690151517865590519385019390935591516002909301929092559151929350909133917f01017ed19df0c7f8acc436147b234b09664a9fb4797b4fa3fb9e599c2eb67be791a395945050505050565b3360009081526003602052604090205460ff1615156103de57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4f6e6c792066726f6d2070726576696f75736c79206465706c6f796564206c6f60448201527f636b730000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60028054830190555050565b60036020526000908152604090208054600182015460029092015460ff909116919083565b600054600160a060020a031681565b3360009081526003602052604090205460ff1615156104c457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4f6e6c792066726f6d2070726576696f75736c79206465706c6f796564206c6f60448201527f636b730000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60018054830190555050565b60025481565b60045460ff16156104e657600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117815560018181556002919091556004805460ff19169091179055565b60015481565b600054600160a060020a0316331461054a57600080fd5b600160a060020a038116151561055f57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b604051611599806105d8833901905600608060405234801561001057600080fd5b5060405160a08061159983398101604090815281516020830151918301516060840151608090940151600080546001805433600160a060020a031991821681178084559382161716600160a060020a038716179092559395929385919060a060020a60ff0219167401000000000000000000000000000000000000000083600281111561009957fe5b021790555060029290925560035560045550506114de806100bb6000396000f3006080604052600436106100f85763ffffffff60e060020a600035041663025e7c2781146100fd578063081812fc14610131578063095ea7b3146101495780630f15023b1461016257806310e569731461017757806311a4c03a1461019e57806323b872dd146101b35780633ccfd60b146101d057806347a51015146101e557806347dc10851461021e57806353b704d0146102335780636352211e1461025357806370a082311461026b57806374b6c1061461028c5780638da5cb5b146102a15780639f98d3cb146102b6578063abdf82ce146102d7578063d44fa14a146102f8578063d8125eb31461038e578063f2fde38b146103b6575b600080fd5b34801561010957600080fd5b506101156004356103d7565b60408051600160a060020a039092168252519081900360200190f35b34801561013d57600080fd5b506101156004356103ff565b610160600160a060020a0360043516602435610410565b005b34801561016e57600080fd5b5061011561057e565b34801561018357600080fd5b5061018c61058d565b60408051918252519081900360200190f35b3480156101aa57600080fd5b5061018c610593565b610160600160a060020a0360043581169060243516604435610599565b3480156101dc57600080fd5b506101606108fb565b3480156101f157600080fd5b506101fa6109ab565b6040518082600281111561020a57fe5b60ff16815260200191505060405180910390f35b34801561022a57600080fd5b5061018c6109bb565b61016060048035600160a060020a031690602480359081019101356109c2565b34801561025f57600080fd5b50610115600435610a03565b34801561027757600080fd5b5061018c600160a060020a0360043516610a6c565b34801561029857600080fd5b5061018c610b00565b3480156102ad57600080fd5b50610115610b06565b3480156102c257600080fd5b50610160600160a060020a0360043516610b15565b3480156102e357600080fd5b5061018c600160a060020a0360043516610bbd565b34801561030457600080fd5b50610319600160a060020a0360043516610c3c565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561035357818101518382015260200161033b565b50505050905090810190601f1680156103805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610160600160a060020a03600480358216916024803590911691604435918201910135610d4f565b3480156103c257600080fd5b50610160600160a060020a0360043516610e05565b60068054829081106103e557fe5b600091825260209091200154600160a060020a0316905081565b600061040a82610e99565b92915050565b80600260015460a060020a900460ff16600281111561042b57fe5b14156104a7576040805160e560020a62461bcd02815260206004820152602a60248201527f4f6e6c7920616c6c6f776564206f6e207075626c6963206f722072657374726960448201527f63746564206c6f636b7300000000000000000000000000000000000000000000606482015290519081900360840190fd5b600054600160a060020a03163314806104ea5750600160a060020a038116331480156104ea5750600060015460a060020a900460ff1660028111156104e857fe5b145b15156104f557600080fd5b600160a060020a038316151561050a57600080fd5b600160a060020a03828116600081815260076020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff19169488169485179055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600154600160a060020a031681565b60035481565b60025481565b6006546004546000911061061d576040805160e560020a62461bcd02815260206004820152602360248201527f4d6178696d756d206e756d626572206f66206b65797320616c7265616479207360448201527f6f6c640000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600060015460a060020a900460ff16600281111561063757fe5b1461068c576040805160e560020a62461bcd02815260206004820152601c60248201527f4f6e6c7920616c6c6f776564206f6e207075626c6963206c6f636b7300000000604482015290519081900360640190fd5b600160a060020a038216600090815260056020526040812080548492106106eb576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b83600160a060020a03811633148061071357503361070882610e99565b600160a060020a0316145b1515610769576040805160e560020a62461bcd02815260206004820181905260248201527f4f6e6c79206b6579206f776e6572206f7220617070726f766564206f776e6572604482015290519081900360640190fd5b600160a060020a038616151561077e57600080fd5b600160a060020a03861660009081526005602052604090205493508315156107f957600680546001810182556000919091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388161790555b42841161082857600160a060020a03808816600090815260056020526040808220549289168252902055610855565b600160a060020a038088166000908152600560205260408082205492891682529020429186019190910390555b600160a060020a03878116600090815260056020526040808220928916825290206001918201805461089c9392830192600290821615610100026000190190911604611385565b50600160a060020a0380881660008181526005602090815260409182902042905581518981529151938a16937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350505050505050565b60008054600160a060020a0316331461091357600080fd5b5030316000811161096e576040805160e560020a62461bcd02815260206004820152601060248201527f4e6f7420656e6f7567682066756e647300000000000000000000000000000000604482015290519081900360640190fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f193505050501580156109a7573d6000803e3d6000fd5b5050565b60015460a060020a900460ff1681565b6006545b90565b6109fe83600084848080601f01602080910402602001604051908101604052809392919081815260200183838082843750610ec2945050505050565b505050565b600160a060020a038116600090815260056020526040812080548391908310610a64576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b509192915050565b600160a060020a038116600090815260056020526040812080548391908310610acd576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b600160a060020a03841660009081526005602052604081205411610af2576000610af5565b60015b60ff16949350505050565b60045481565b600054600160a060020a031681565b600054600160a060020a03163314610b2c57600080fd5b600160a060020a038116600090815260056020526040902080548291904210610b9f576040805160e560020a62461bcd02815260206004820152601060248201527f4b6579206973206e6f742076616c696400000000000000000000000000000000604482015290519081900360640190fd5b5050600160a060020a03166000908152600560205260409020429055565b600160a060020a038116600090815260056020526040812080548391908310610c1e576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b505050600160a060020a031660009081526005602052604090205490565b600160a060020a0381166000908152600560205260408120805460609284929111610c9f576040805160e560020a62461bcd02815260206004820152600b6024820152600080516020611493833981519152604482015290519081900360640190fd5b600160a060020a038416600090815260056020908152604091829020600190810180548451600293821615610100026000190190911692909204601f810184900484028301840190945283825290929091830182828015610d415780601f10610d1657610100808354040283529160200191610d41565b820191906000526020600020905b815481529060010190602001808311610d2457829003601f168201915b505050505092505050919050565b600160a060020a038316600090815260056020526040902080548491904210610dc2576040805160e560020a62461bcd02815260206004820152601060248201527f4b6579206973206e6f742076616c696400000000000000000000000000000000604482015290519081900360640190fd5b610dfd868686868080601f01602080910402602001604051908101604052809392919081815260200183838082843750610ec2945050505050565b505050505050565b600054600160a060020a03163314610e1c57600080fd5b600160a060020a0381161515610e3157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0380821660009081526007602052604081205490911680151561040a57600080fd5b6000806000806000600680549050600454111515610f50576040805160e560020a62461bcd02815260206004820152602360248201527f4d6178696d756d206e756d626572206f66206b65797320616c7265616479207360448201527f6f6c640000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b87600060015460a060020a900460ff166002811115610f6b57fe5b1480610fb157506001805460a060020a900460ff166002811115610f8b57fe5b148015610fb15750600160a060020a038116610fa681610e99565b600160a060020a0316145b151561102d576040805160e560020a62461bcd02815260206004820152603960248201527f4f6e6c79207075626c6963206c6f636b73206f7220726573747269636564207760448201527f69746820616e20617070726f76656420726563697069656e7400000000000000606482015290519081900360840190fd5b600160a060020a038916151561104257600080fd5b600154600354604080517f0cb175e3000000000000000000000000000000000000000000000000000000008152600160a060020a038d81166004830152602482019390935281519290931698508892630cb175e392604480830193928290030181600087803b1580156110b457600080fd5b505af11580156110c8573d6000803e3d6000fd5b505050506040513d60408110156110de57600080fd5b5080516020909101516003549196509450925082851115611102576000925061110a565b846003540392505b34831115611162576040805160e560020a62461bcd02815260206004820152601260248201527f496e73756666696369656e742066756e64730000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0389166000908152600560205260409020549150428210156111f85760068054600181019091557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038b16908117909155600254600091825260056020526040909120429091019055611219565b600254600160a060020a038a16600090815260056020526040902090830190555b600160a060020a03891660009081526005602090815260409091208851611248926001909201918a019061140a565b5060008511156112bc5785600160a060020a0316633652466386866040518363ffffffff1660e060020a0281526004018083815260200182815260200192505050600060405180830381600087803b1580156112a357600080fd5b505af11580156112b7573d6000803e3d6000fd5b505050505b85600160a060020a031663939d9f1f848a6040518363ffffffff1660e060020a0281526004018083815260200182600160a060020a0316600160a060020a0316815260200192505050600060405180830381600087803b15801561131f57600080fd5b505af1158015611333573d6000803e3d6000fd5b505060408051600160a060020a038d168082529151919350600092507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3505050505050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113be57805485556113fa565b828001600101855582156113fa57600052602060002091601f016020900482015b828111156113fa5782548255916001019190600101906113df565b50611406929150611478565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144b57805160ff19168380011785556113fa565b828001600101855582156113fa579182015b828111156113fa57825182559160200191906001019061145d565b6109bf91905b80821115611406576000815560010161147e56004e6f2073756368206b6579000000000000000000000000000000000000000000a165627a7a723058200b3274f0068f785dda3d9e93e217d0a044726131fb1648f42ecff973a8dd2fed0029a165627a7a72305820a8313821ede155d9b7df1af34dfac0202c912b057a28cb694856e21e8684a3bc0029",
"sourceMap": "1358:3623:3:-;;;501:5:6;:18;;-1:-1:-1;;;;;;501:18:6;509:10;501:18;;;1358:3623:3;;;;;;",
"deployedSourceMap": "1358:3623:3:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3546:276;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3546:276:3;-1:-1:-1;;;;;3546:276:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2620:641;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2620:641:3;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2620:641:3;;;;;;;;;;;;;;4743:235;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4743:235:3;;;;;;;;;2042:46;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2042:46:3;-1:-1:-1;;;;;2042:46:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;238:20:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;238:20:6;;;;4215:228:3;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4215:228:3;;;-1:-1:-1;;;;;4215:228:3;;;;;1921:32;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1921:32:3;;;;;;;;;;;;;;;;;;;;2310:193;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2310:193:3;-1:-1:-1;;;;;2310:193:3;;;;;1885:31;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1885:31:3;;;;832:174:6;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;832:174:6;-1:-1:-1;;;;;832:174:6;;;;;3546:276:3;-1:-1:-1;3742:13:3;;;;-1:-1:-1;3546:276:3:o;2620:641::-;2797:9;2836:12;2867:10;2885:20;2913:19;2940:9;2957:16;2851:128;;:::i;:::-;-1:-1:-1;;;;;2851:128:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;3039:95:3;;;;;;;;3070:4;3039:95;;;-1:-1:-1;3039:95:3;;;;;;;;;;;;;-1:-1:-1;;;;;3013:23:3;;;;;:5;:23;;;;;;:121;;;;-1:-1:-1;;3013:121:3;;;;;;;;;;;;;;;;;;;;;;;;;;3167:37;;3013:23;;-1:-1:-1;3013:23:3;;3175:10;;3167:37;;;3249:7;2620:641;-1:-1:-1;;;;;2620:641:3:o;4743:235::-;1809:10;1803:17;;;;:5;:17;;;;;:26;;;1795:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4928:20;:33;;;;;;4743:235;;:::o;2042:46::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;238:20:6:-;;;-1:-1:-1;;;;;238:20:6;;:::o;4215:228:3:-;1809:10;1803:17;;;;:5;:17;;;;;:26;;;1795:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4397:19;:29;;;;;;4215:228;;:::o;1921:32::-;;;;:::o;2310:193::-;2383:11;;;;2382:12;2374:21;;;;;;2401:5;:14;;-1:-1:-1;;2401:14:3;-1:-1:-1;;;;;2401:14:3;;;;;;;;;;-1:-1:-1;2421:23:3;;;2450:20;:24;;;;2480:11;:18;;-1:-1:-1;;2480:18:3;;;;;;2310:193::o;1885:31::-;;;;:::o;832:174:6:-;653:5;;-1:-1:-1;;;;;653:5:6;639:10;:19;631:28;;;;;;-1:-1:-1;;;;;908:22:6;;;;900:31;;;;;;963:5;;;942:37;;-1:-1:-1;;;;;942:37:6;;;;963:5;;;942:37;;;985:5;:16;;-1:-1:-1;;985:16:6;-1:-1:-1;;;;;985:16:6;;;;;;;;;;832:174::o;1358:3623:3:-;;;;;;;;;;:::o",
"source": "pragma solidity 0.4.24;\n\n/**\n * @title The Unlock contract\n * @author Julien Genestoux (unlock-protocol.com)\n * This smart contract has 2 main roles:\n * 1. Distribute discounts to discount token holders\n * 2. Grant dicount tokens to users making referrals and/or publishers granting discounts.\n * In order to achieve these 2 elements, it keeps track of several things such as\n * a. Deployed locks addresses and balances of discount tokens granted by each lock.\n * b. The total network product (sum of all key sales, net of discounts)\n * c. Total of discounts granted\n * d. Balances of discount tokens, including \"frozen\" tokens (which have been used to claim\n * discounts and cannot be used/transfered for a given period)\n * e. Growth rate of Network Product\n * f. Growth rate of Discount tokens supply\n * The smart contract has an owner who only can perform the following\n * - Upgrades\n * - Change in golden rules (20% of GDP available in discounts, and supply growth rate is at most\n * 50% of GNP growth rate)\n * NOTE: This smart contract is partially implemented for now until enough Locks are deployed and\n * in the wild.\n * The partial implementation includes the following features:\n * a. Keeping track of deployed locks\n * b. Keeping track of GNP\n */\n\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"./Lock.sol\";\n\n\ncontract Unlock is Ownable {\n\n /**\n * The struct for a lock\n * We use deployed to keep track of deployments.\n * This is required because both totalSales and yieldedDiscountTokens are 0 when initialized,\n * which would be the same values when the lock is not set.\n */\n struct LockBalances {\n bool deployed;\n uint totalSales; // This is in wei\n uint yieldedDiscountTokens;\n }\n\n modifier onlyFromDeployedLock() {\n require(locks[msg.sender].deployed, \"Only from previously deployed locks\");\n _;\n }\n\n uint public grossNetworkProduct;\n\n uint public totalDiscountGranted;\n\n // We keep track of deployed locks to ensure that callers are all deployed locks.\n mapping (address => LockBalances) public locks;\n\n // Events\n event NewLock(\n address indexed lockOwner,\n address indexed newLockAddress\n );\n\n bool internal initialized;\n\n // Use initialize instead of a constructor to support proxies (for upgradeability).\n function initialize(\n address _owner\n )\n public \n {\n require(!initialized);\n owner = _owner;\n grossNetworkProduct = 0;\n totalDiscountGranted = 0;\n initialized = true;\n }\n\n /**\n * @dev Create lock\n * This deploys a lock for a creator. It also keeps track of the deployed lock.\n */\n function createLock(\n Lock.KeyReleaseMechanisms _keyReleaseMechanism,\n uint _expirationDuration,\n uint _keyPrice,\n uint _maxNumberOfKeys\n )\n public\n returns (Lock lock)\n {\n\n // create lock\n Lock newLock = new Lock(\n msg.sender,\n _keyReleaseMechanism,\n _expirationDuration,\n _keyPrice,\n _maxNumberOfKeys\n );\n\n // Assign the new Lock\n locks[address(newLock)] = LockBalances({\n deployed: true,\n totalSales: 0,\n yieldedDiscountTokens: 0\n });\n\n // trigger event\n emit NewLock(msg.sender, address(newLock));\n\n // return the created lock\n return newLock;\n }\n\n /**\n * This function returns the discount available for a user, when purchasing a\n * a key from a lock.\n * This does not modify the state. It returns both the discount and the number of tokens\n * consumed to grant that discount.\n * TODO: actually implement this.\n */\n function computeAvailableDiscountFor(\n address _purchaser, // solhint-disable-line no-unused-vars\n uint _keyPrice // solhint-disable-line no-unused-vars\n )\n public\n pure\n returns (uint discount, uint tokens)\n {\n // TODO: implement me\n return (0, 0);\n }\n\n /**\n * This function keeps track of the added GDP, as well as grants of discount tokens\n * to the referrer, if applicable.\n * The number of discount tokens granted is based on the value of the referal,\n * the current growth rate and the lock's discount token distribution rate\n * This function is invoked by a previously deployed lock only.\n * TODO: actually implement\n */\n function recordKeyPurchase(\n uint _value,\n address _referrer // solhint-disable-line no-unused-vars\n )\n public\n onlyFromDeployedLock()\n {\n // TODO: implement me\n grossNetworkProduct += _value;\n return;\n }\n\n /**\n * This function will keep track of consumed discounts by a given user.\n * It will also grant discount tokens to the creator who is granting the discount based on the\n * amount of discount and compensation rate.\n * This function is invoked by a previously deployed lock only.\n */\n function recordConsumedDiscount(\n uint _discount,\n uint _tokens // solhint-disable-line no-unused-vars\n )\n public\n onlyFromDeployedLock()\n {\n // TODO: implement me\n totalDiscountGranted += _discount;\n return;\n }\n\n}\n",
"sourcePath": "/Users/julien/repos/unlock/smart-contracts/contracts/Unlock.sol",
"ast": {
"absolutePath": "/Users/julien/repos/unlock/smart-contracts/contracts/Unlock.sol",
"exportedSymbols": {
"Unlock": [
1003
]
},
"id": 1004,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 841,
"literals": [
"solidity",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:23:3"
},
{
"absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"id": 842,
"nodeType": "ImportDirective",
"scope": 1004,
"sourceUnit": 1225,
"src": "1271:63:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/Users/julien/repos/unlock/smart-contracts/contracts/Lock.sol",
"file": "./Lock.sol",
"id": 843,
"nodeType": "ImportDirective",
"scope": 1004,
"sourceUnit": 783,
"src": "1335:20:3",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 844,
"name": "Ownable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1224,
"src": "1377:7:3",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Ownable_$1224",
"typeString": "contract Ownable"
}
},
"id": 845,
"nodeType": "InheritanceSpecifier",
"src": "1377:7:3"
}
],
"contractDependencies": [
782,
1224
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 1003,
"linearizedBaseContracts": [
1003,
1224
],
"name": "Unlock",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Unlock.LockBalances",
"id": 852,
"members": [
{
"constant": false,
"id": 847,
"name": "deployed",
"nodeType": "VariableDeclaration",
"scope": 852,
"src": "1664:13:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 846,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1664:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 849,
"name": "totalSales",
"nodeType": "VariableDeclaration",
"scope": 852,
"src": "1683:15:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 848,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1683:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 851,
"name": "yieldedDiscountTokens",
"nodeType": "VariableDeclaration",
"scope": 852,
"src": "1722:26:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 850,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1722:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "LockBalances",
"nodeType": "StructDefinition",
"scope": 1003,
"src": "1638:115:3",
"visibility": "public"
},
{
"body": {
"id": 864,
"nodeType": "Block",
"src": "1789:92:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 855,
"name": "locks",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 873,
"src": "1803:5:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_LockBalances_$852_storage_$",
"typeString": "mapping(address => struct Unlock.LockBalances storage ref)"
}
},
"id": 858,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 856,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1239,
"src": "1809:3:3",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 857,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1809:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1803:17:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_LockBalances_$852_storage",
"typeString": "struct Unlock.LockBalances storage ref"
}
},
"id": 859,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "deployed",
"nodeType": "MemberAccess",
"referencedDeclaration": 847,
"src": "1803:26:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "4f6e6c792066726f6d2070726576696f75736c79206465706c6f796564206c6f636b73",
"id": 860,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1831:37:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_8aef852d2c19fccb5d964b3c5faa62768cbe1dd98a00a135ce13aa41cf11f66b",
"typeString": "literal_string \"Only from previously deployed locks\""
},
"value": "Only from previously deployed locks"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_8aef852d2c19fccb5d964b3c5faa62768cbe1dd98a00a135ce13aa41cf11f66b",
"typeString": "literal_string \"Only from previously deployed locks\""
}
],
"id": 854,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
1242,
1243
],
"referencedDeclaration": 1243,
"src": "1795:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 861,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1795:74:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 862,
"nodeType": "ExpressionStatement",
"src": "1795:74:3"
},
{
"id": 863,
"nodeType": "PlaceholderStatement",
"src": "1875:1:3"
}
]
},
"documentation": null,
"id": 865,
"name": "onlyFromDeployedLock",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 853,
"nodeType": "ParameterList",
"parameters": [],
"src": "1786:2:3"
},
"src": "1757:124:3",
"visibility": "internal"
},
{
"constant": false,
"id": 867,
"name": "grossNetworkProduct",
"nodeType": "VariableDeclaration",
"scope": 1003,
"src": "1885:31:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 866,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1885:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 869,
"name": "totalDiscountGranted",
"nodeType": "VariableDeclaration",
"scope": 1003,
"src": "1921:32:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 868,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1921:4:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 873,
"name": "locks",
"nodeType": "VariableDeclaration",
"scope": 1003,
"src": "2042:46:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_LockBalances_$852_storage_$",
"typeString": "mapping(address => struct Unlock.LockBalances)"
},
"typeName": {
"id": 872,
"keyType": {
"id": 870,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2051:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "2042:33:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_struct$_LockBalances_$852_storage_$",
"typeString": "mapping(address => struct Unlock.LockBalances)"
},
"valueType": {
"contractScope": null,
"id": 871,
"name": "LockBalances",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 852,
"src": "2062:12:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_LockBalances_$852_storage_ptr",
"typeString": "struct Unlock.LockBalances"
}
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 879,
"name": "NewLock",
"nodeType": "EventDefinition",
"parameters": {
"id": 878,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 875,
"indexed": true,
"name": "lockOwner",
"nodeType": "VariableDeclaration",
"scope": 879,
"src": "2124:25:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 874,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2124:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 877,
"indexed": true,
"name": "newLockAddress",
"nodeType": "VariableDeclaration",
"scope": 879,
"src": "2155:30:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 876,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2155:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2118:71:3"
},
"src": "2105:85:3"
},
{
"constant": false,
"id": 881,
"name": "initialized",
"nodeType": "VariableDeclaration",
"scope": 1003,
"src": "2194:25:3",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 880,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2194:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 907,
"nodeType": "Block",
"src": "2368:135:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 888,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "!",
"prefix": true,
"src": "2382:12:3",
"subExpression": {
"argumentTypes": null,
"id": 887,
"name": "initialized",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 881,
"src": "2383:11:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 886,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
1242,
1243
],
"referencedDeclaration": 1242,
"src": "2374:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 889,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2374:21:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 890,
"nodeType": "ExpressionStatement",
"src": "2374:21:3"
},
{
"expression": {
"argumentTypes": null,
"id": 893,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 891,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1172,
"src": "2401:5:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 892,
"name": "_owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 883,
"src": "2409:6:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2401:14:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 894,
"nodeType": "ExpressionStatement",
"src": "2401:14:3"
},
{
"expression": {
"argumentTypes": null,
"id": 897,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 895,
"name": "grossNetworkProduct",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 867,
"src": "2421:19:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 896,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2443:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2421:23:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 898,
"nodeType": "ExpressionStatement",
"src": "2421:23:3"
},
{
"expression": {
"argumentTypes": null,
"id": 901,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 899,
"name": "totalDiscountGranted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 869,
"src": "2450:20:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "30",
"id": 900,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2473:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "2450:24:3",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 902,
"nodeType": "ExpressionStatement",
"src": "2450:24:3"
},
{
"expression": {
"argumentTypes": null,
"id": 905,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 903,
"name": "initialized",
"nodeType": "Identifier",