BCD

Tezos Contract Explorer
Search Networks Deploy
  • Home
  • /
  • Mainnet
  • /
  • KT198mB...oazY
operations (53)Storage Code Interact Tokens Fork Statistics Details
Latest
​x
204
 
1
parameter (or
2
            (or (or (unit %clear_processors) (unit %default))
3
                (or (address %propose_administrator) (address %remove_administrator)))
4
            (or
5
              (or (unit %set_administrator)
6
                  (pair %set_manager (address %address) (key %pub_key)))
7
              (or (string %set_monitoring_peer_id)
8
                  (or
9
                    (map %set_processors string
10
                                         (pair (address %address)
11
                                               (pair (bytes %pub_key) (bool %isLeader))))
12
                    (pair %set_script (string %script) (string %hash))))));
13
storage (pair (big_map %administrators address int)
14
              (pair (string %hash)
15
                    (pair (address %manager_address)
16
                          (pair (key %manager_pub_key)
17
                                (pair (string %monitoring_peer_id)
18
                                      (pair
19
                                        (map %processors string
20
                                                         (pair (address %address)
21
                                                               (pair (bytes %pub_key)
22
                                                                     (bool %isLeader))))
23
                                        (string %script)))))));
24
code { LAMBDA
25
         (pair unit
26
               (pair (big_map address int)
27
                     (pair string
28
                           (pair address
29
                                 (pair key
30
                                       (pair string
31
                                             (pair
32
                                               (map string
33
                                                    (pair address (pair bytes bool)))
34
                                               string)))))))
35
         (pair unit
36
               (pair (big_map address int)
37
                     (pair string
38
                           (pair address
39
                                 (pair key
40
                                       (pair string
41
                                             (pair
42
                                               (map string
43
                                                    (pair address (pair bytes bool)))
44
                                               string)))))))
45
         { CDR ;
46
           DUP ;
47
           CAR ;
48
           SENDER ;
49
           MEM ;
50
           IF {} { PUSH string "Unauthorized" ; FAILWITH } ;
51
           PUSH int 1 ;
52
           DUP 2 ;
53
           CAR ;
54
           SENDER ;
55
           GET ;
56
           IF_NONE { PUSH int 19 ; FAILWITH } {} ;
57
           COMPARE ;
58
           EQ ;
59
           IF {} { PUSH string "Unauthorized. Proposal is still pending." ; FAILWITH } ;
60
           UNIT ;
61
           PAIR } ;
62
       SWAP ;
63
       UNPAIR ;
64
       IF_LEFT
65
         { IF_LEFT
66
             { IF_LEFT
67
                 { DROP ;
68
                   UNIT ;
69
                   PAIR ;
70
                   EXEC ;
71
                   CDR ;
72
                   EMPTY_MAP string (pair address (pair bytes bool)) ;
73
                   UPDATE 11 ;
74
                   NIL operation }
75
                 { DROP ;
76
                   SWAP ;
77
                   DROP ;
78
                   NIL operation ;
79
                   SENDER ;
80
                   CONTRACT unit ;
81
                   IF_NONE { PUSH int 90 ; FAILWITH } {} ;
82
                   AMOUNT ;
83
                   UNIT ;
84
                   TRANSFER_TOKENS ;
85
                   CONS } }
86
             { IF_LEFT
87
                 { PUSH mutez 0 ;
88
                   AMOUNT ;
89
                   COMPARE ;
90
                   EQ ;
91
                   IF {} { PUSH string "No tez accepted" ; FAILWITH } ;
92
                   DIG 2 ;
93
                   UNIT ;
94
                   SWAP ;
95
                   DIG 3 ;
96
                   DIG 2 ;
97
                   PAIR ;
98
                   EXEC ;
99
                   CDR ;
100
                   DUP ;
101
                   CAR ;
102
                   PUSH (option int) (Some 0) ;
103
                   DIG 3 ;
104
                   UPDATE ;
105
                   UPDATE 1 }
106
                 { PUSH mutez 0 ;
107
                   AMOUNT ;
108
                   COMPARE ;
109
                   EQ ;
110
                   IF {} { PUSH string "No tez accepted" ; FAILWITH } ;
111
                   DIG 2 ;
112
                   UNIT ;
113
                   SWAP ;
114
                   DIG 3 ;
115
                   DIG 2 ;
116
                   PAIR ;
117
                   EXEC ;
118
                   CDR ;
119
                   DUP ;
120
                   CAR ;
121
                   NONE int ;
122
                   DIG 3 ;
123
                   UPDATE ;
124
                   UPDATE 1 } ;
125
               NIL operation } }
126
         { IF_LEFT
127
             { DIG 2 ;
128
               DROP ;
129
               IF_LEFT
130
                 { DROP ;
131
                   PUSH mutez 0 ;
132
                   AMOUNT ;
133
                   COMPARE ;
134
                   EQ ;
135
                   IF {} { PUSH string "No tez accepted" ; FAILWITH } ;
136
                   DUP ;
137
                   CAR ;
138
                   SENDER ;
139
                   MEM ;
140
                   IF {} { PUSH string "Unauthorized" ; FAILWITH } ;
141
                   PUSH int 0 ;
142
                   DUP 2 ;
143
                   CAR ;
144
                   SENDER ;
145
                   GET ;
146
                   IF_NONE { PUSH int 42 ; FAILWITH } {} ;
147
                   COMPARE ;
148
                   EQ ;
149
                   IF {} { PUSH string "Not a proposed administrator" ; FAILWITH } ;
150
                   DUP ;
151
                   CAR ;
152
                   PUSH (option int) (Some 1) ;
153
                   SENDER ;
154
                   UPDATE ;
155
                   UPDATE 1 }
156
                 { PUSH bool False ;
157
                   DUP 3 ;
158
                   GET 11 ;
159
                   ITER { CDR ; CAR ; SENDER ; COMPARE ; EQ ; IF { DROP ; PUSH bool True } {} } ;
160
                   IF {} { PUSH string "Not found." ; FAILWITH } ;
161
                   SWAP ;
162
                   DUP 2 ;
163
                   CAR ;
164
                   UPDATE 5 ;
165
                   SWAP ;
166
                   CDR ;
167
                   UPDATE 7 } }
168
             { IF_LEFT
169
                 { DIG 2 ; UNIT ; SWAP ; DIG 3 ; DIG 2 ; PAIR ; EXEC ; CDR ; SWAP ; UPDATE 9 }
170
                 { IF_LEFT
171
                     { DIG 2 ;
172
                       UNIT ;
173
                       SWAP ;
174
                       DIG 3 ;
175
                       DIG 2 ;
176
                       PAIR ;
177
                       EXEC ;
178
                       CDR ;
179
                       SWAP ;
180
                       UPDATE 11 ;
181
                       PUSH int 0 ;
182
                       DUP 2 ;
183
                       GET 11 ;
184
                       ITER { CDR ; GET 4 ; IF { PUSH int 1 ; ADD } {} } ;
185
                       PUSH int 1 ;
186
                       COMPARE ;
187
                       EQ ;
188
                       IF {} { PUSH string "Invalid processors map." ; FAILWITH } }
189
                     { DIG 2 ;
190
                       UNIT ;
191
                       SWAP ;
192
                       DIG 3 ;
193
                       DIG 2 ;
194
                       PAIR ;
195
                       EXEC ;
196
                       CDR ;
197
                       DUP 2 ;
198
                       CAR ;
199
                       UPDATE 12 ;
200
                       SWAP ;
201
                       CDR ;
202
                       UPDATE 3 } } } ;
203
           NIL operation } ;
204
       PAIR }