-
Notifications
You must be signed in to change notification settings - Fork 9
/
nominator-pool-code.fif
2085 lines (2085 loc) · 144 KB
/
nominator-pool-code.fif
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
"Asm.fif" include
// automatically generated from `stdlib.fc` `nonstdlib.fc` `storage.fc` `utils.fc` `message_utils.fc` `proxy_utils.fc` `config_utils.fc` `economic.fc` `text_utils.fc` `validator_requests.fc` `nominator_requests.fc` `elector_response.fc` `config_response.fc` `nominator_pool_code.fc` `get_methods.fc`
PROGRAM{
DECLPROC load_data
DECLPROC save_data
DECLPROC make_pseudo_address
DECLPROC get_nominator_data
DECLPROC ~set_nominator_data
DECLPROC get_active_balance_by_address_slice
DECLPROC ~register_request
DECLPROC new_query_id
DECLPROC send_message
DECLPROC send_receipt_message
DECLPROC deploy_new_proxy
DECLPROC load_proxy_code
DECLPROC send_message_through_new
DECLPROC ~send_message_through_filtered
DECLPROC is_unused
DECLPROC ~send_message_through_unused
DECLPROC is_matured
DECLPROC ~send_message_through_matured
DECLPROC always_true
DECLPROC send_through_any_proxy
DECLPROC ~update_proxy
DECLPROC ~occupy_proxy
DECLPROC ~release_proxy
DECLPROC is_proxy
DECLPROC get_current_vset
DECLPROC get_validator_descr
DECLPROC unpack_validator_descr
DECLPROC elector_address
DECLPROC config_address
DECLPROC stake_lock_durations
DECLPROC max_recommended_punishment_for_validator_misbehaviour
DECLPROC ~collect_matured
DECLPROC calc_nominator_profit_share
DECLPROC update_reward_on_stake_return
DECLPROC ~parse_text_command
DECLPROC encode_number_to_text
DECLPROC store_grams_string
DECLPROC send_text_stake_accept_message
DECLPROC send_text_lock_accept_message
DECLPROC send_text_withdraw_message
DECLPROC send_text_withdrawal_not_ready_message
DECLPROC ensure_standart_fee
DECLPROC send_new_stake
DECLPROC recover_stake
DECLPROC check_and_vote_for_complaint
DECLPROC vote_for_config
DECLPROC validator_withdraw
DECLPROC process_validator_request
DECLPROC add_stake
DECLPROC lock_stake
DECLPROC withdraw_locked
DECLPROC process_nominator_request
DECLPROC process_elector_response
DECLPROC process_config_response
DECLPROC recv_external
DECLPROC recv_internal
81689 DECLMETHOD get_pool_data
95168 DECLMETHOD get_nominator
load_data PROC:<{
//
c4 PUSH // _1
CTOS // ds
LDMSGADDR // _3 ds
LDGRAMS // _3 _5 ds
LDGRAMS // _3 _5 _7 ds
56 LDI // _3 _5 _7 _9 ds
56 LDI // _3 _5 _7 _9 _12 ds
16 LDU // _3 _5 _7 _9 _12 _15 ds
16 LDU // _3 _5 _7 _9 _12 _15 _18 ds
LDDICT // _3 _5 _7 _9 _12 _15 _18 _21 ds
LDDICT // _3 _5 _7 _9 _12 _15 _18 _21 _23 ds
LDDICT // _3 _5 _7 _9 _12 _15 _18 _21 _23 _25 ds
LDDICT // _3 _5 _7 _9 _12 _15 _18 _21 _23 _25 _50 _49
DROP // _3 _5 _7 _9 _12 _15 _18 _21 _23 _25 _27
}>
save_data PROC:<{
// validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators requests transfers proxies
NEWC // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators requests transfers proxies _12
s0 s11 XCHG2 // proxies total_active total_locked reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators requests transfers _12 validator
STSLICER // proxies total_active total_locked reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators requests transfers _13
s0 s9 XCHG2 // proxies transfers total_locked reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators requests _13 total_active
STGRAMS // proxies transfers total_locked reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators requests _14
s0 s7 XCHG2 // proxies transfers requests reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators _14 total_locked
STGRAMS // proxies transfers requests reward_per_gram undistributed_reward validator_reward_share validator_cover_ability nominators _15
s1 s5 XCHG // proxies transfers requests nominators undistributed_reward validator_reward_share validator_cover_ability reward_per_gram _15
56 STI // proxies transfers requests nominators undistributed_reward validator_reward_share validator_cover_ability _17
s1 s3 XCHG // proxies transfers requests nominators validator_cover_ability validator_reward_share undistributed_reward _17
56 STI // proxies transfers requests nominators validator_cover_ability validator_reward_share _19
16 STU // proxies transfers requests nominators validator_cover_ability _21
16 STU // proxies transfers requests nominators _23
STDICT // proxies transfers requests _24
STDICT // proxies transfers _25
STDICT // proxies _26
STDICT // _27
ENDC // st
c4 POP
}>
make_pseudo_address PROC:<{
// wc addr_hash
ADD // _2
}>
get_nominator_data PROC:<{
// nominators workchain address_hash reward_per_gram
-ROT // nominators reward_per_gram workchain address_hash
make_pseudo_address INLINECALLDICT // nominators reward_per_gram key
ROT
8 PUSHPOW2 // reward_per_gram key nominators _8=256
DICTUGET
NULLSWAPIFNOT // reward_per_gram nominator found
NOT // reward_per_gram nominator _10
IFJMP:<{ // reward_per_gram nominator
DROP // reward_per_gram
0 PUSHINT // reward_per_gram _11=0
s0 s1 s0 PUXCPU // _11=0 _12=0 reward_per_gram _13=0
}> // reward_per_gram nominator
NIP // nominator
LDGRAMS // _14 nominator
LDGRAMS // _14 _16 nominator
48 LDI // _14 _16 _18 nominator
32 LDU // _14 _16 _18 _33 _32
DROP // _14 _16 _18 _21
}>
~set_nominator_data PROC:<{
// nominators workchain address_hash active locked paid_reward_per_gram last_stake_utime
s5 s4 XCHG2 // nominators paid_reward_per_gram last_stake_utime active locked workchain address_hash
make_pseudo_address INLINECALLDICT // nominators paid_reward_per_gram last_stake_utime active locked key
s2 s1 PUSH2 // nominators paid_reward_per_gram last_stake_utime active locked key active locked
ADD // nominators paid_reward_per_gram last_stake_utime active locked key _9
0 GTINT // nominators paid_reward_per_gram last_stake_utime active locked key _11
IF:<{ // nominators paid_reward_per_gram last_stake_utime active locked key
NEWC // nominators paid_reward_per_gram last_stake_utime active locked key _13
s0 s3 XCHG2 // nominators paid_reward_per_gram last_stake_utime key locked _13 active
STGRAMS // nominators paid_reward_per_gram last_stake_utime key locked _14
SWAP // nominators paid_reward_per_gram last_stake_utime key _14 locked
STGRAMS // nominators paid_reward_per_gram last_stake_utime key _15
s1 s3 XCHG // nominators key last_stake_utime paid_reward_per_gram _15
48 STI // nominators key last_stake_utime _17
32 STU // nominators key _19
s0 s2 XCHG
8 PUSHPOW2 // _19 key nominators _20=256
DICTUSETB // nominators
}>ELSE<{ // nominators paid_reward_per_gram last_stake_utime active locked key
s0 s4 XCHG
4 BLKDROP // nominators key
SWAP
8 PUSHPOW2 // key nominators _23=256
DICTUDEL // _25 _26
DROP // nominators
}>
}>
get_active_balance_by_address_slice PROC:<{
// nominators addr
REWRITESTDADDR // nominators wc addr_hash
0 PUSHINT // nominators wc addr_hash _9=0
get_nominator_data CALLDICT // _13 _14 _15 _16
3 BLKDROP // active_balance
}>
~register_request PROC:<{
// requests query_id request_data
s0 s2 XCHG
64 PUSHINT // request_data query_id requests _3=64
DICTUSETREF // _4
}>
new_query_id PROC:<{
//
NOW // _0
LTIME // _0 _1
32 PUSHPOW2 // _0 _1 _2=4294967296
MOD // _0 _3
ADD // _4
}>
send_message PROCREF:<{
// addr grams body mode
1 PUSHINT // addr grams body mode _5=1
24 PUSHINT // addr grams body mode _5=1 _6=24
NEWC // addr grams body mode _5=1 _6=24 _7
6 STU // addr grams body mode _5=1 _9
s0 s5 XCHG2 // _5=1 grams body mode _9 addr
STSLICER // _5=1 grams body mode _10
s0 s3 XCHG2 // _5=1 mode body _10 grams
STGRAMS // _5=1 mode body _11
s1 s3 XCHG // body mode _5=1 _11
107 STU // body mode _25
s1 s2 XCHG // mode body _25
STREF // mode msg
ENDC // mode _27
SWAP // _27 mode
SENDRAWMSG
}>
send_receipt_message PROCREF:<{
// addr ans_tag query_id body grams mode
0 PUSHINT // addr ans_tag query_id body grams mode _7=0
24 PUSHINT // addr ans_tag query_id body grams mode _7=0 _8=24
NEWC // addr ans_tag query_id body grams mode _7=0 _8=24 _9
6 STU // addr ans_tag query_id body grams mode _7=0 _11
s0 s7 XCHG2 // _7=0 ans_tag query_id body grams mode _11 addr
STSLICER // _7=0 ans_tag query_id body grams mode _12
ROT // _7=0 ans_tag query_id body mode _12 grams
STGRAMS // _7=0 ans_tag query_id body mode _13
s1 s5 XCHG // mode ans_tag query_id body _7=0 _13
107 STU // mode ans_tag query_id body _27
s1 s3 XCHG // mode body query_id ans_tag _27
32 STU // mode body query_id _29
64 STU // mode body msg
OVER // mode body msg body
-1 GTINT // mode body msg _33
IF:<{ // mode body msg
32 STU // mode msg
}>ELSE<{
NIP // mode msg
}>
ENDC // mode _37
SWAP // _37 mode
SENDRAWMSG
}>
deploy_new_proxy PROC:<{
//
MYADDR // me
load_proxy_code CALLDICT // me code
LTIME // me code _5
NEWC // me code _5 _6
64 STU // me code _8
ROT // code _8 me
STSLICER // code _9
ENDC // code data
3 PUSHINT // code data _12=3
NEWC // code data _12=3 _13
4 STU // code data _15
s1 s2 XCHG // data code _15
STREF // data _16
STREF // _17
ENDC // state_init
DUP // state_init state_init
HASHCU // state_init addr_hash
1279 PUSHINT // state_init addr_hash _22=1279
NEWC // state_init addr_hash _22=1279 _23
11 STU // state_init addr_hash _29
256 STU // state_init addr
6 PUSHINT // state_init addr _37
24 PUSHINT // state_init addr _37 _38=24
NEWC // state_init addr _37 _38=24 _39
6 STU // state_init addr _37 _41
s2 s(-1) PUXC // state_init addr _37 addr _41
STB // state_init addr _37 _42
1000000000 PUSHINT // state_init addr _37 _42 _43=1000000000
STGRAMS // state_init addr _37 _44
108 STU // state_init addr _60
s1 s2 XCHG // addr state_init _60
STREF // addr msg
ENDC // addr _62
1 PUSHINT // addr _62 _63=1
SENDRAWMSG
}>
send_message_through_new PROC:<{
// proxies addr grams body
s3 POP // body addr grams
deploy_new_proxy CALLDICT // body addr grams proxy
1 PUSHINT // body addr grams proxy _7=1
24 PUSHINT // body addr grams proxy _7=1 _8=24
NEWC // body addr grams proxy _7=1 _8=24 _9
6 STU // body addr grams proxy _7=1 _11
s2 s(-1) PUXC // body addr grams proxy _7=1 proxy _11
STB // body addr grams proxy _7=1 _12
s0 s3 XCHG2 // body addr _7=1 proxy _12 grams
STGRAMS // body addr _7=1 proxy _13
s1 s2 XCHG // body addr proxy _7=1 _13
107 STU // body addr proxy _27
ROT // body proxy _27 addr
STSLICER // body proxy _28
s1 s2 XCHG // proxy body _28
STREF // proxy msg
ENDC // proxy _30
1 PUSHINT // proxy _30 _31=1
SENDRAWMSG
NOW // proxy _33
SWAP
NEWC // _33 proxy _34
STB // _33 _35
32 STU // _37
ENDC // _38
}>
~send_message_through_filtered PROC:<{
// proxies addr grams body filter
s4 PUSH // proxies addr grams body filter proxies
CTOS // proxies addr grams body filter cs
s0 s0 PUSH2 // proxies addr grams body filter cs proxy cs
SBITS // proxies addr grams body filter cs proxy len
0 PUSHINT // proxies addr grams body filter cs proxy len need_new_proxy=0
OVER // proxies addr grams body filter cs proxy len need_new_proxy=0 len
NOT // proxies addr grams body filter cs proxy len need_new_proxy=0 _12
IF:<{ // proxies addr grams body filter cs proxy len need_new_proxy=0
s2 s4 XCHG
4 BLKDROP // proxies addr grams body proxy
-1 PUSHINT // proxies addr grams body proxy need_new_proxy=-1
}>ELSE<{ // proxies addr grams body filter cs proxy len need_new_proxy=0
SWAP
299 PUSHINT // proxies addr grams body filter cs proxy need_new_proxy=0 len _16
EQUAL // proxies addr grams body filter cs proxy need_new_proxy=0 _17
IF:<{ // proxies addr grams body filter cs proxy need_new_proxy=0
s0 s2 XCHG
267 PUSHINT // proxies addr grams body filter need_new_proxy=0 proxy cs _20=267
LDSLICEX // proxies addr grams body filter need_new_proxy=0 proxy _82 _81
NIP // proxies addr grams body filter need_new_proxy=0 proxy cs
32 LDU // proxies addr grams body filter need_new_proxy=0 proxy _84 _83
DROP // proxies addr grams body filter need_new_proxy=0 proxy occupation_time
s0 s3 XCHG2 // proxies addr grams body proxy need_new_proxy=0 occupation_time filter
1 1 CALLXARGS // proxies addr grams body proxy need_new_proxy=0 _26
NOT // proxies addr grams body proxy need_new_proxy=0 _27
IF:<{ // proxies addr grams body proxy need_new_proxy=0
DROP // proxies addr grams body proxy
-1 PUSHINT // proxies addr grams body proxy need_new_proxy=-1
}> // proxies addr grams body proxy need_new_proxy
}>ELSE<{ // proxies addr grams body filter cs proxy need_new_proxy=0
s0 s2 XCHG
267 PUSHINT // proxies addr grams body filter need_new_proxy=0 proxy cs _31=267
LDSLICEX // proxies addr grams body filter need_new_proxy=0 proxy _86 _85
NIP // proxies addr grams body filter need_new_proxy=0 proxy cs
32 LDU // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 cs
267 PUSHINT // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 cs _39=267
LDSLICEX // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 _90 _89
NIP // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 cs
32 LDU // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 _92 _91
DROP // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 occupation_time2
s1 s4 PUSH2 // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 occupation_time2 occupation_time1 filter
1 1 CALLXARGS // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 occupation_time2 _46
s1 s5 XCPU // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 _46 occupation_time2 filter
1 1 CALLXARGS // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 _46 _47
OR // proxies addr grams body filter need_new_proxy=0 proxy occupation_time1 _48
779 THROWIFNOT
s0 s3 XCHG2 // proxies addr grams body proxy need_new_proxy=0 occupation_time1 filter
1 1 CALLXARGS // proxies addr grams body proxy need_new_proxy=0 _51
IF:<{ // proxies addr grams body proxy need_new_proxy=0
}>ELSE<{ // proxies addr grams body proxy need_new_proxy=0
}>
}>
}>
IFJMP:<{ // proxies addr grams body proxy
DROP // proxies addr grams body
send_message_through_new CALLDICT // _53
}> // proxies addr grams body proxy
1 PUSHINT // proxies addr grams body proxy _55=1
24 PUSHINT // proxies addr grams body proxy _55=1 _56=24
NEWC // proxies addr grams body proxy _55=1 _56=24 _57
6 STU // proxies addr grams body proxy _55=1 _59
ROT // proxies addr grams body _55=1 _59 proxy
STSLICER // proxies addr grams body _55=1 _60
s0 s3 XCHG2 // proxies addr _55=1 body _60 grams
STGRAMS // proxies addr _55=1 body _61
s1 s2 XCHG // proxies addr body _55=1 _61
107 STU // proxies addr body _75
ROT // proxies body _75 addr
STSLICER // proxies body _76
STREF // proxies msg
ENDC // proxies _78
1 PUSHINT // proxies _78 _79=1
SENDRAWMSG
}>
is_unused PROC:<{
// occupation_time
NOT // _1
}>
~send_message_through_unused PROC:<{
// proxies addr grams body
CONT:<{
is_unused CALLDICT
}> // proxies addr grams body _4
~send_message_through_filtered CALLDICT // _5
}>
is_matured PROC:<{
// occupation_time
15 PUSHINT // occupation_time _2=15
CONFIGOPTPARAM // occupation_time _3
CTOS // occupation_time cfg
32 LDU // occupation_time validators_elected_for cfg
64 PUSHINT // occupation_time validators_elected_for cfg _10=64
SDSKIPFIRST // occupation_time validators_elected_for cfg
32 LDU // occupation_time validators_elected_for _23 _22
DROP // occupation_time validators_elected_for stake_held_for
NOW // occupation_time validators_elected_for stake_held_for _16
2SWAP // stake_held_for _16 occupation_time validators_elected_for
ADD // stake_held_for _16 _17
ROT // _16 _17 stake_held_for
ADD // _16 _18
GREATER // _19
}>
~send_message_through_matured PROC:<{
// proxies addr grams body
CONT:<{
is_matured CALLDICT
}> // proxies addr grams body _4
~send_message_through_filtered CALLDICT // _5
}>
always_true PROC:<{
// _0
DROP //
-1 PUSHINT // _1=-1
}>
send_through_any_proxy PROC:<{
// proxies addr grams body
CONT:<{
always_true CALLDICT
}> // proxies addr grams body _4
~send_message_through_filtered CALLDICT // _5
DROP //
}>
~update_proxy PROC:<{
// proxies used_proxy new_state
s0 s2 XCHG // new_state used_proxy proxies
CTOS // new_state used_proxy cs
NEWC // new_state used_proxy cs new_pr
0 PUSHINT // new_state used_proxy cs new_pr found?=0
WHILE:<{
DUP // new_state used_proxy cs new_pr found? found?
NOT // new_state used_proxy cs new_pr found? _9
s3 PUSH // new_state used_proxy cs new_pr found? _9 cs
SBITS // new_state used_proxy cs new_pr found? _9 _10
AND // new_state used_proxy cs new_pr found? _11
}>DO<{ // new_state used_proxy cs new_pr found?
s0 s2 XCHG
267 PUSHINT // new_state used_proxy found? new_pr cs _14=267
LDSLICEX // new_state used_proxy found? new_pr pr cs
s2 s1 XCPU // new_state used_proxy found? cs pr new_pr pr
STSLICER // new_state used_proxy found? cs pr new_pr
s1 s4 XCPU // new_state used_proxy found? cs new_pr pr used_proxy
SDEQ // new_state used_proxy found? cs new_pr _17
IF:<{ // new_state used_proxy found? cs new_pr
s4 s(-1) PUXC // new_state used_proxy found? cs new_state new_pr
32 STU // new_state used_proxy found? cs new_pr
}>ELSE<{ // new_state used_proxy found? cs new_pr
SWAP // new_state used_proxy found? new_pr cs
32 LDSLICE // new_state used_proxy found? new_pr _20 cs
-ROT // new_state used_proxy found? cs new_pr _20
STSLICER // new_state used_proxy found? cs new_pr
}>
ROT // new_state used_proxy cs new_pr found?
}> // new_state used_proxy cs new_pr found?
s1 s4 XCHG
4 BLKDROP // new_pr
ENDC // _24
}>
~occupy_proxy PROC:<{
// proxies used_proxy
NOW // proxies used_proxy _2
~update_proxy CALLDICT // _3
}>
~release_proxy PROC:<{
// proxies used_proxy
0 PUSHINT // proxies used_proxy _2=0
~update_proxy CALLDICT // _3
}>
is_proxy PROC:<{
// proxies sender
SWAP // sender proxies
CTOS // sender cs
0 PUSHINT // sender cs found?=0
WHILE:<{
DUP // sender cs found? found?
NOT // sender cs found? _6
s2 PUSH // sender cs found? _6 cs
SBITS // sender cs found? _6 _7
AND // sender cs found? _8
}>DO<{ // sender cs found?
SWAP
267 PUSHINT // sender found? cs _11=267
LDSLICEX // sender found? pr cs
s1 s3 XCPU // sender found? cs pr sender
SDEQ // sender found? cs _13
IF:<{ // sender found? cs
-1 PUSHINT
s2 POP // sender found?=-1 cs
}> // sender found? cs
32 PUSHINT // sender found? cs _16=32
SDSKIPFIRST // sender found? cs
SWAP // sender cs found?
}> // sender cs found?
2 1 BLKDROP2 // found?
}>
get_current_vset PROCREF:<{
//
34 PUSHINT // _1=34
CONFIGOPTPARAM // vset
DUP // vset vset
CTOS // vset cs
8 LDU // vset _6 cs
SWAP // vset cs _6
18 EQINT // vset cs _10
40 THROWIFNOT
96 PUSHINT // vset cs _19
SDSKIPFIRST // vset cs
64 LDU // vset _23 cs
LDDICT // vset total_weight dict cs
ENDS
}>
get_validator_descr PROCREF:<{
// idx
get_current_vset INLINECALLDICT // idx _9 _10 _11
s2 POP // idx dict total_weight
-ROT
16 PUSHINT // total_weight idx dict _7=16
DICTUGET
NULLSWAPIFNOT // total_weight _12 _13
DROP // total_weight value
SWAP // value total_weight
}>
unpack_validator_descr PROC:<{
// cs
8 LDU // _2 cs
32 PUSHINT // _2 cs _5=32
NOT // _2 cs _6
s1 s2 XCHG // cs _2 _6
AND // cs _7
83 EQINT // cs _9
41 THROWIFNOT
32 LDU // _12 cs
SWAP
2390828938 PUSHINT // cs _12 _15=2390828938
EQUAL // cs _16
41 THROWIFNOT
256 LDU // _18 cs
64 LDU // _18 _31 _30
DROP // _18 _21
}>
elector_address PROC:<{
//
1 PUSHINT // _1=1
CONFIGOPTPARAM // _2
CTOS // _3
256 PLDU // elector
8 PUSHPOW2DEC // elector _6=255
4 PUSHINT // elector _6=255 _7=4
NEWC // elector _6=255 _7=4 _8
3 STU // elector _6=255 _10
8 STU // elector _12
256 STU // _14
ENDC // _15
CTOS // _16
}>
config_address PROC:<{
//
0 PUSHINT // _1=0
CONFIGOPTPARAM // _2
CTOS // _3
256 PLDU // config
8 PUSHPOW2DEC // config _6=255
4 PUSHINT // config _6=255 _7=4
NEWC // config _6=255 _7=4 _8
3 STU // config _6=255 _10
8 STU // config _12
256 STU // _14
ENDC // _15
CTOS // _16
}>
stake_lock_durations PROC:<{
//
15 PUSHINT // _1=15
CONFIGOPTPARAM // _2
CTOS // validation_params
32 LDU // validators_elected_for validation_params
64 LDSLICE // validators_elected_for _29 _28
NIP // validators_elected_for validation_params
32 LDU // validators_elected_for _31 _30
DROP // validators_elected_for stake_held_for
34 PUSHINT // validators_elected_for stake_held_for _16=34
CONFIGOPTPARAM // validators_elected_for stake_held_for _17
CTOS // validators_elected_for stake_held_for set_params
8 LDSLICE // validators_elected_for stake_held_for _33 _32
NIP // validators_elected_for stake_held_for set_params
32 LDU // validators_elected_for stake_held_for _35 _34
DROP // validators_elected_for stake_held_for utime_since
}>
max_recommended_punishment_for_validator_misbehaviour PROC:<{
// stake
40 PUSHINT // stake _2=40
CONFIGOPTPARAM // stake _3
CTOS // stake recommendation
8 LDU // stake _57 _56
NIP // stake recommendation
LDGRAMS // stake _16 recommendation
32 LDU // stake _16 _18 recommendation
16 LDU // stake _16 _18 _21 recommendation
16 LDU // stake _16 _18 _21 _24 recommendation
16 LDU // stake _16 _18 _21 _24 _67 _66
NIP // stake _16 _18 _21 _24 recommendation
16 LDU // stake _16 _18 _21 _24 _30 recommendation
16 LDU // stake _16 _18 _21 _24 _30 _71 _70
DROP // stake flat_fine prop_fine severity_flat_mult severity_prop_mult long_flat_mult long_prop_mult
s5 s3 XCHG2 // stake long_flat_mult prop_fine long_prop_mult severity_prop_mult flat_fine severity_flat_mult
MUL // stake long_flat_mult prop_fine long_prop_mult severity_prop_mult _37
8 RSHIFT# // stake long_flat_mult prop_fine long_prop_mult severity_prop_mult _39
s0 s4 XCHG2 // stake severity_prop_mult prop_fine long_prop_mult _39 long_flat_mult
MUL // stake severity_prop_mult prop_fine long_prop_mult _40
8 RSHIFT# // stake severity_prop_mult prop_fine long_prop_mult suggested_fine
s2 s3 XCHG2 // stake suggested_fine long_prop_mult prop_fine severity_prop_mult
MUL // stake suggested_fine long_prop_mult _44
8 RSHIFT# // stake suggested_fine long_prop_mult _46
SWAP // stake suggested_fine _46 long_prop_mult
MUL // stake suggested_fine _47
8 RSHIFT# // stake suggested_fine suggested_fine_part
s2 s(-1) PUXC
32 PUSHPOW2 // stake suggested_fine stake suggested_fine_part _52
MULDIV // stake suggested_fine _53
ADD // stake _54
MIN // _55
}>
~collect_matured PROC:<{
// transfers
stake_lock_durations CALLDICT // transfers _21 _22 _23
1 2 BLKDROP2
0 PUSHINT
s0 s2 XCHG // transfers matured=0 prev_set_utime_since stake_held_for
ADD // transfers matured=0 threshold
UNTIL:<{
s2 PUSH
32 PUSHINT // transfers matured threshold transfers _13=32
DICTUREMMIN
NULLSWAPIFNOT2 // transfers matured threshold transfers' transfer i f
s1 s4 XCPU // transfers matured threshold transfers' transfer f i threshold
LESS // transfers matured threshold transfers' transfer f _15
AND // transfers matured threshold transfers' transfer f
DUP // transfers matured threshold transfers' transfer f f
IF:<{ // transfers matured threshold transfers' transfer f
s5 POP // f matured threshold transfers' transfer
LDGRAMS // f matured threshold transfers' _29 _28
DROP // f matured threshold transfers' _17
s1 s3 XCHG // f transfers' threshold matured _17
ADD // f transfers threshold matured
s0 s1 s3 XCHG3 // transfers matured threshold f
}>ELSE<{
2 1 BLKDROP2 // transfers matured threshold f
}>
NOT // transfers matured threshold _20
}> // transfers matured threshold
DROP // transfers matured
}>
calc_nominator_profit_share PROC:<{
// active paid_reward_per_gram reward_per_gram
SWAP // active reward_per_gram paid_reward_per_gram
SUB // active _3
SWAP // _3 active
MUL // _4
1000000000 PUSHINT // _4 _5=1000000000
DIV // _6
}>
update_reward_on_stake_return PROC:<{
// validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 transfers proxies msg_value used_proxy
OVER // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 transfers proxies msg_value used_proxy msg_value
0 GTINT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 transfers proxies msg_value used_proxy _14
IF:<{ // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 transfers proxies msg_value used_proxy
s0 s3 XCHG // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 used_proxy proxies msg_value transfers
~collect_matured INLINECALLDICT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 used_proxy proxies msg_value transfers matured
s3 s4 XCHG2 // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 matured transfers msg_value proxies used_proxy
~release_proxy CALLDICT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 matured transfers msg_value proxies
s11 PUSH // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 matured transfers msg_value proxies total_active
0 GTINT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 matured transfers msg_value proxies _21
IF:<{ // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 matured transfers msg_value proxies
s0 s3 XCHG // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers msg_value matured
SUB // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit
s11 PUSH // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit validator
REWRITESTDADDR // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash
s6 s1 s0 PUSH3
s13 PUSH // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash nominators val_wc val_hash reward_per_gram
get_nominator_data CALLDICT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime
s6 PUSH // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime profit
0 GTINT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime _33
IF:<{ // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime
s6 s12 PUSH2 // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime profit validator_reward_share
MUL // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime _35
16 RSHIFT# // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime validator_profit
s7 s7 XCPU // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers validator_profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime profit validator_profit
SUB // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers validator_profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime nominators_profit
s4 s7 XCPU // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers validator_profit val_wc val_hash nominators_profit val_locked val_paid_reward_per_gram last_val_stake_utime val_active validator_profit
ADD // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers validator_profit val_wc val_hash nominators_profit val_locked val_paid_reward_per_gram last_val_stake_utime val_active
s1 17 s() XCHG
s0 s7 XCHG // validator last_val_stake_utime total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers val_active val_wc val_hash nominators_profit val_locked val_paid_reward_per_gram total_active validator_profit
ADD // validator last_val_stake_utime total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers val_active val_wc val_hash nominators_profit val_locked val_paid_reward_per_gram total_active
s6 s10 XCHG
s3 s10 XCHG
s0 16 s() XCHG // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators_profit _9 proxies transfers nominators val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime
~set_nominator_data CALLDICT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators_profit _9 proxies transfers nominators
s7 s4 XCPU // validator total_active total_locked reward_per_gram nominators validator_reward_share _7 nominators_profit _9 proxies transfers undistributed_reward nominators_profit
ADD // validator total_active total_locked reward_per_gram nominators validator_reward_share _7 nominators_profit _9 proxies transfers undistributed_reward
s0 s4 XCHG
1000000000 PUSHINT // validator total_active total_locked reward_per_gram nominators validator_reward_share _7 undistributed_reward _9 proxies transfers nominators_profit _45=1000000000
MUL // validator total_active total_locked reward_per_gram nominators validator_reward_share _7 undistributed_reward _9 proxies transfers _46
s10 PUSH // validator total_active total_locked reward_per_gram nominators validator_reward_share _7 undistributed_reward _9 proxies transfers _46 total_active
DIV // validator total_active total_locked reward_per_gram nominators validator_reward_share _7 undistributed_reward _9 proxies transfers _47
s1 s8 XCHG // validator total_active total_locked transfers nominators validator_reward_share _7 undistributed_reward _9 proxies reward_per_gram _47
ADD // validator total_active total_locked transfers nominators validator_reward_share _7 undistributed_reward _9 proxies reward_per_gram
}>ELSE<{ // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked val_paid_reward_per_gram last_val_stake_utime
s3 s1 PUXC
s15 PUSH // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked last_val_stake_utime val_active val_paid_reward_per_gram reward_per_gram
calc_nominator_profit_share INLINECALLDICT // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_active val_locked last_val_stake_utime validator_nomination_profit
s3 s3 XCPU // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash validator_nomination_profit val_locked last_val_stake_utime val_active validator_nomination_profit
ADD // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash validator_nomination_profit val_locked last_val_stake_utime val_active
s0 16 s() XCHG
s3 PUSH // validator val_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash validator_nomination_profit val_locked last_val_stake_utime total_active validator_nomination_profit
ADD // validator val_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash validator_nomination_profit val_locked last_val_stake_utime total_active
s13 s3 XCHG2 // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward validator_nomination_profit
SUB // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward
s5 s15 PUSH2 // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward profit val_active
ADD // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward _54
0 GTINT // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward _56
IF:<{ // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward
s2 s5 XCPU // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash undistributed_reward val_locked total_active profit
ADD // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash undistributed_reward val_locked total_active
s15 s5 XCHG2 // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
ADD // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active
0 PUSHINT // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit=0
}>ELSE<{ // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash total_active val_locked undistributed_reward
s2 s15 XCHG2 // validator undistributed_reward total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_locked total_active val_active
SUB // validator undistributed_reward total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_locked total_active
0 PUSHINT // validator undistributed_reward total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers profit val_wc val_hash val_locked total_active val_active=0
s15 s0 s5 XCHG3 // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
}>
DUP // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit profit
0 LESSINT // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _64
IF:<{ // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
s0 s15 PUSH2 // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit profit val_locked
ADD // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _65
0 GTINT // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _67
IF:<{ // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
s14 s14 XCPU // validator val_locked profit reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active total_locked profit
ADD // validator val_locked profit reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active total_locked
s15 s14 XCHG2 // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_locked profit
ADD // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_locked
0 PUSHINT // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_locked profit=0
}>ELSE<{ // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
s14 s15 XCHG2 // validator profit val_active reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward total_locked val_locked
SUB // validator profit val_active reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward total_locked
0 PUSHINT // validator profit val_active reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward total_locked val_locked=0
s0 s14 XCHG
s14 s15 XCHG2 // validator val_active total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_locked profit
}>
s1 s15 XCHG // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
}> // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
DUP // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit profit
0 LESSINT // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _75
IF:<{ // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit
DUP
1000000000 PUSHINT // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit profit _76=1000000000
MUL // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _77
s6 PUSH // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _77 total_active
DIV // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active profit _78
s1 s14 XCHG // validator val_locked total_locked profit last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active reward_per_gram _78
ADD // validator val_locked total_locked profit last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active reward_per_gram
s2 s13 XCHG2 // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash val_active undistributed_reward profit
ADD // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash val_active undistributed_reward
SWAP // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active
}>ELSE<{
DROP // validator val_locked total_locked reward_per_gram last_val_stake_utime validator_reward_share _7 nominators _9 proxies transfers total_active val_wc val_hash undistributed_reward val_active
}>
s5 s8 XCHG
s3 s4 XCHG
s0 s14 s3 XCHG3
s12 s11 PUXC // validator undistributed_reward total_locked reward_per_gram total_active validator_reward_share _7 transfers _9 proxies nominators val_wc val_hash val_active val_locked reward_per_gram last_val_stake_utime
~set_nominator_data CALLDICT // validator undistributed_reward total_locked reward_per_gram total_active validator_reward_share _7 transfers _9 proxies nominators
s6 s9 XCHG
s3 s7 XCHG
s0 s6 XCHG
s0 s3 XCHG // validator total_active total_locked transfers nominators validator_reward_share _7 undistributed_reward _9 proxies reward_per_gram
}>
s0 s7 XCHG
s3 s6 XCHG // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers
}>ELSE<{
s3 POP
DROP // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 proxies transfers
}>
SWAP // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 transfers proxies
}>ELSE<{
2DROP // validator total_active total_locked reward_per_gram undistributed_reward validator_reward_share _7 nominators _9 transfers proxies
}>
save_data INLINECALLDICT
}>
~parse_text_command PROC:<{
// in_msg
0 PUSHINT // in_msg op=0
SWAP // op=0 in_msg
8 LDU // op=0 first_char in_msg
OVER // op=0 first_char in_msg first_char
108 EQINT // op=0 first_char in_msg _8
IF:<{ // op=0 first_char in_msg
1 2 BLKDROP2 // first_char in_msg
24 LDU // first_char _10 in_msg
SWAP
7299947 PUSHINT // first_char in_msg _10 _13=7299947
EQUAL // first_char in_msg _14
505 THROWIFNOT
201330943 PUSHINT // first_char in_msg op=201330943
-ROT // op=201330943 first_char in_msg
}> // op first_char in_msg
OVER // op first_char in_msg first_char
114 EQINT // op first_char in_msg _18
IF:<{ // op first_char in_msg
1 2 BLKDROP2 // first_char in_msg
48 LDU // first_char _20 in_msg
SWAP
111477746197874 PUSHINT // first_char in_msg _20 _23=111477746197874
EQUAL // first_char in_msg _24
505 THROWIFNOT
3735883980 PUSHINT // first_char in_msg op=3735883980
-ROT // op=3735883980 first_char in_msg
}> // op first_char in_msg
OVER // op first_char in_msg first_char
115 EQINT // op first_char in_msg _28
IF:<{ // op first_char in_msg
1 2 BLKDROP2 // first_char in_msg
32 LDU // first_char _30 in_msg
SWAP
1952541541 PUSHINT // first_char in_msg _30 _33=1952541541
EQUAL // first_char in_msg _34
505 THROWIFNOT
4276994270 PUSHINT // first_char in_msg op=4276994270
-ROT // op=4276994270 first_char in_msg
}> // op first_char in_msg
SWAP // op in_msg first_char
119 EQINT // op in_msg _38
IF:<{ // op in_msg
NIP // in_msg
56 LDU // _40 in_msg
SWAP
29682864265257335 PUSHINT // in_msg _40 _43=29682864265257335
EQUAL // in_msg _44
505 THROWIFNOT
7240620 PUSHINT // in_msg op=7240620
SWAP // op=7240620 in_msg
}> // op in_msg
SWAP // in_msg op
}>
encode_number_to_text PROC:<{
// number
0 PUSHINT // number len=0
DUP // number len=0 value=0
1 PUSHINT // number len=0 value=0 mult=1
UNTIL:<{
s0 s3 XCHG
10 PUSHINT // mult len value number _8=10
DIVMOD // mult len value number res
48 ADDCONST // mult len value number _11
s4 PUSH // mult len value number _11 mult
MUL // mult len value number _12
s1 s2 XCHG // mult len number value _12
ADD // mult len number value
s0 s3 XCHG // value len number mult
8 LSHIFT# // value len number mult
s0 s2 XCHG // value mult number len
INC // value mult number len
OVER // value mult number len number
0 EQINT // value mult number len _19
s4 s3 s0 XCHG3 // number len value mult _19
}> // number len value mult
DROP
1 2 BLKDROP2 // len value
}>
store_grams_string PROC:<{
// msg amount
1000000000 PUSHINT // msg amount _4=1000000000
DIVMOD // msg ceil res
SWAP // msg res ceil
encode_number_to_text CALLDICT // msg res cl cv
SWAP // msg res cv cl
3 LSHIFT# // msg res cv _10
s1 s3 s0 XCHG3 // res cv msg _10
STUX // res msg
46 PUSHINT // res msg _12=46
SWAP // res _12=46 msg
8 STU // res msg
SWAP // msg res
encode_number_to_text CALLDICT // msg rl rv
9 PUSHINT // msg rl rv _18=9
s2 PUSH // msg rl rv _18=9 rl
SUB // msg rl rv _19
REPEAT:<{ // msg rl rv
48 PUSHINT // msg rl rv _20=48
s0 s3 XCHG2 // rv rl _20=48 msg
8 STU // rv rl msg
s0 s2 XCHG // msg rl rv
}>
SWAP // msg rv rl
3 LSHIFT# // msg rv _24
s1 s2 XCHG // rv msg _24
STUX // _25
}>
send_text_stake_accept_message PROC:<{
// addr stake value
597313372290408539492 PUSHINT // addr stake value _4=597313372290408539492
126943687828768 PUSHINT // addr stake value _4=597313372290408539492 _5=126943687828768
0 PUSHINT // addr stake value _4=597313372290408539492 _5=126943687828768 _6=0
DUP // addr stake value _4=597313372290408539492 _5=126943687828768 _6=0 _7=0
24 PUSHINT // addr stake value _4=597313372290408539492 _5=126943687828768 _6=0 _7=0 _8=24
NEWC // addr stake value _4=597313372290408539492 _5=126943687828768 _6=0 _7=0 _8=24 _9
6 STU // addr stake value _4=597313372290408539492 _5=126943687828768 _6=0 _7=0 _11
s0 s7 XCHG2 // _7=0 stake value _4=597313372290408539492 _5=126943687828768 _6=0 _11 addr
STSLICER // _7=0 stake value _4=597313372290408539492 _5=126943687828768 _6=0 _12
s0 s4 XCHG2 // _7=0 stake _6=0 _4=597313372290408539492 _5=126943687828768 _12 value
STGRAMS // _7=0 stake _6=0 _4=597313372290408539492 _5=126943687828768 _13
s1 s5 XCHG // _5=126943687828768 stake _6=0 _4=597313372290408539492 _7=0 _13
107 STU // _5=126943687828768 stake _6=0 _4=597313372290408539492 _27
s1 s2 XCHG // _5=126943687828768 stake _4=597313372290408539492 _6=0 _27
32 STU // _5=126943687828768 stake _4=597313372290408539492 _29
s1 s3 XCHG // _4=597313372290408539492 stake _5=126943687828768 _29
48 STU // _4=597313372290408539492 stake _31
SWAP // _4=597313372290408539492 _31 stake
store_grams_string CALLDICT // _4=597313372290408539492 _32
72 STU // msg
ENDC // _35
0 PUSHINT // _35 _36=0
SENDRAWMSG
}>
send_text_lock_accept_message PROC:<{
// addr locked
9126424919893348 PUSHINT // addr locked _3=9126424919893348
126943687828768 PUSHINT // addr locked _3=9126424919893348 _4=126943687828768
0 PUSHINT // addr locked _3=9126424919893348 _4=126943687828768 _5=0
DUP // addr locked _3=9126424919893348 _4=126943687828768 _5=0 _6=0
24 PUSHINT // addr locked _3=9126424919893348 _4=126943687828768 _5=0 _6=0 _7=24
NEWC // addr locked _3=9126424919893348 _4=126943687828768 _5=0 _6=0 _7=24 _8
6 STU // addr locked _3=9126424919893348 _4=126943687828768 _5=0 _6=0 _10
s0 s6 XCHG2 // _6=0 locked _3=9126424919893348 _4=126943687828768 _5=0 _10 addr
STSLICER // _6=0 locked _3=9126424919893348 _4=126943687828768 _5=0 _11
OVER // _6=0 locked _3=9126424919893348 _4=126943687828768 _5=0 _11 _12=0
STGRAMS // _6=0 locked _3=9126424919893348 _4=126943687828768 _5=0 _13
s1 s5 XCHG // _5=0 locked _3=9126424919893348 _4=126943687828768 _6=0 _13
107 STU // _5=0 locked _3=9126424919893348 _4=126943687828768 _27
s1 s4 XCHG // _4=126943687828768 locked _3=9126424919893348 _5=0 _27
32 STU // _4=126943687828768 locked _3=9126424919893348 _29
s1 s3 XCHG // _3=9126424919893348 locked _4=126943687828768 _29
48 STU // _3=9126424919893348 locked _31
SWAP // _3=9126424919893348 _31 locked
store_grams_string CALLDICT // _3=9126424919893348 _32
56 STU // msg
ENDC // _35
64 PUSHINT // _35 _36=64
SENDRAWMSG
}>
send_text_withdraw_message PROC:<{
// addr value
210982622422653884098403377339833676834051106906582061058449761145002618732 PUSHINT // addr value _3=210982622422653884098403377339833676834051106906582061058449761145002618732
0 PUSHINT // addr value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0
DUP // addr value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _5=0
24 PUSHINT // addr value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _5=0 _6=24
NEWC // addr value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _5=0 _6=24 _7
6 STU // addr value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _5=0 _9
s0 s5 XCHG2 // _5=0 value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _9 addr
STSLICER // _5=0 value _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _10
s0 s3 XCHG2 // _5=0 _4=0 _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _10 value
STGRAMS // _5=0 _4=0 _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _11
s1 s3 XCHG // _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _5=0 _11
107 STU // _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _4=0 _25
32 STU // _3=210982622422653884098403377339833676834051106906582061058449761145002618732 _27
248 STU // msg
ENDC // _30
64 PUSHINT // _30 _31=64
SENDRAWMSG
}>
send_text_withdrawal_not_ready_message PROC:<{
// addr
2461921300960164965008949227431845016418741860 PUSHINT // addr _2=2461921300960164965008949227431845016418741860
824150868838491734735072179807152868346860070936417144702106238939065376 PUSHINT // addr _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376
0 PUSHINT // addr _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0
DUP // addr _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _5=0
24 PUSHINT // addr _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _5=0 _6=24
NEWC // addr _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _5=0 _6=24 _7
6 STU // addr _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _5=0 _9
s0 s5 XCHG2 // _5=0 _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _9 addr
STSLICER // _5=0 _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _10
OVER // _5=0 _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _10 _11=0
STGRAMS // _5=0 _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _4=0 _12
s1 s4 XCHG // _4=0 _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _5=0 _12
107 STU // _4=0 _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _26
s1 s3 XCHG // _3=824150868838491734735072179807152868346860070936417144702106238939065376 _2=2461921300960164965008949227431845016418741860 _4=0 _26
32 STU // _3=824150868838491734735072179807152868346860070936417144702106238939065376 _2=2461921300960164965008949227431845016418741860 _28
s1 s2 XCHG // _2=2461921300960164965008949227431845016418741860 _3=824150868838491734735072179807152868346860070936417144702106238939065376 _28
240 STU // _2=2461921300960164965008949227431845016418741860 _30
152 STU // msg
ENDC // _33
64 PUSHINT // _33 _34=64
SENDRAWMSG
}>
ensure_standart_fee PROC:<{
// msg_value id
312 PUSHINT // msg_value id _10=312
SWAP // msg_value _10=312 id
ADD // msg_value _11
SWAP
1070000000 PUSHINT // _11 msg_value _18
GEQ // _11 _19
THROWANYIFNOT
}>
send_new_stake PROC:<{
// msg_value query_id storage s_addr in_msg
s4 POP // in_msg query_id storage s_addr
s0 s3 XCHG // s_addr query_id storage in_msg
LDGRAMS // s_addr query_id storage amount in_msg
DUP // s_addr query_id storage amount in_msg cs
MYADDR // s_addr query_id storage amount in_msg cs _13
REWRITESTDADDR // s_addr query_id storage amount in_msg cs _127 _128
NIP // s_addr query_id storage amount in_msg cs pool_addr