BCD

Tezos Contract Explorer
Search Networks Deploy
  • Home
  • /
  • Mainnet
  • /
  • Token Bridge Helper: tzPEPE
operations (1.58K)Storage Code Interact Tokens Metadata Fork Statistics Details
Latest
​x
237
 
1
parameter (or
2
            (pair %withdraw (address %receiver)
3
                            (ticket %ticket (pair nat (option bytes))))
4
            (or (ticket %unwrap (pair nat (option bytes)))
5
                (or (ticket %default (pair nat (option bytes)))
6
                    (pair %deposit (address %rollup)
7
                                   (pair (bytes %receiver) (nat %amount))))));
8
storage (pair (or %token (address %fa12) (pair %fa2 address nat))
9
              (pair (address %ticketer)
10
                    (pair (bytes %erc_proxy)
11
                          (pair
12
                            (option %context (pair (bytes %receiver) (address %rollup)))
13
                            (big_map %metadata string bytes)))));
14
code { PUSH string "INVALID_FA12" ;
15
       PUSH string "INVALID_FA2" ;
16
       LAMBDA
17
         unit
18
         unit
19
         { PUSH mutez 0 ;
20
           AMOUNT ;
21
           COMPARE ;
22
           GT ;
23
           IF { DROP ; PUSH string "XTZ_DEPOSIT_DISALLOWED" ; FAILWITH } {} } ;
24
       LAMBDA
25
         (pair address (pair address (ticket (pair nat (option bytes)))))
26
         operation
27
         { UNPAIR ;
28
           CONTRACT %withdraw (pair (address %receiver)
29
                                    (ticket %ticket (pair nat (option bytes)))) ;
30
           IF_NONE { PUSH string "ROUTER_ENTRYPOINT_NOT_FOUND" ; FAILWITH } {} ;
31
           PUSH mutez 0 ;
32
           DIG 2 ;
33
           TRANSFER_TOKENS } ;
34
       DIG 4 ;
35
       UNPAIR ;
36
       IF_LEFT
37
         { DIG 3 ;
38
           DIG 4 ;
39
           DIG 5 ;
40
           DROP 3 ;
41
           UNPAIR ;
42
           SWAP ;
43
           READ_TICKET ;
44
           CAR ;
45
           SWAP ;
46
           DIG 2 ;
47
           PAIR ;
48
           SWAP ;
49
           PAIR ;
50
           DIG 2 ;
51
           SWAP ;
52
           EXEC ;
53
           SWAP ;
54
           NIL operation ;
55
           DIG 2 ;
56
           CONS ;
57
           PAIR }
58
         { IF_LEFT
59
             { DIG 4 ;
60
               DIG 5 ;
61
               DROP 2 ;
62
               UNIT ;
63
               DIG 4 ;
64
               SWAP ;
65
               EXEC ;
66
               DROP ;
67
               SENDER ;
68
               PAIR ;
69
               DUP 2 ;
70
               GET 3 ;
71
               PAIR ;
72
               DIG 2 ;
73
               SWAP ;
74
               EXEC ;
75
               SWAP ;
76
               NIL operation ;
77
               DIG 2 ;
78
               CONS ;
79
               PAIR }
80
             { DIG 2 ;
81
               DROP ;
82
               IF_LEFT
83
                 { DIG 3 ;
84
                   DIG 4 ;
85
                   DROP 2 ;
86
                   UNIT ;
87
                   DIG 3 ;
88
                   SWAP ;
89
                   EXEC ;
90
                   DROP ;
91
                   SENDER ;
92
                   DUP 3 ;
93
                   GET 3 ;
94
                   COMPARE ;
95
                   NEQ ;
96
                   IF { PUSH string "UNEXPECTED_SENDER" ; FAILWITH } {} ;
97
                   DUP 2 ;
98
                   GET 7 ;
99
                   IF_NONE
100
                     { DROP 2 ; PUSH string "ROUTING_DATA_IS_NOT_SET" ; FAILWITH }
101
                     { UNPAIR ;
102
                       DUP 4 ;
103
                       GET 5 ;
104
                       SWAP ;
105
                       CONCAT ;
106
                       PUSH nat 40 ;
107
                       DUP 2 ;
108
                       SIZE ;
109
                       COMPARE ;
110
                       NEQ ;
111
                       IF { PUSH string "WRONG_ROUTING_INFO_LENGTH" ; FAILWITH } {} ;
112
                       DIG 2 ;
113
                       SWAP ;
114
                       PAIR ;
115
                       LEFT bytes ;
116
                       LEFT bytes ;
117
                       SWAP ;
118
                       CONTRACT (or
119
                                  (or
120
                                    (pair %deposit (bytes %routing_info)
121
                                                   (ticket %ticket (pair nat
122
                                                                        (option bytes))))
123
                                    (bytes %b))
124
                                  (bytes %c)) ;
125
                       IF_NONE
126
                         { PUSH string "ROLLUP_DEPOSIT_NOT_FOUND" ; FAILWITH }
127
                         {} ;
128
                       PUSH mutez 0 ;
129
                       DIG 2 ;
130
                       TRANSFER_TOKENS ;
131
                       SWAP ;
132
                       NONE (pair bytes address) ;
133
                       UPDATE 7 ;
134
                       NIL operation ;
135
                       DIG 2 ;
136
                       CONS ;
137
                       PAIR } }
138
                 { UNPAIR 3 ;
139
                   UNIT ;
140
                   DIG 5 ;
141
                   SWAP ;
142
                   EXEC ;
143
                   DROP ;
144
                   DUP 4 ;
145
                   CAR ;
146
                   DUP 5 ;
147
                   GET 3 ;
148
                   SENDER ;
149
                   SELF_ADDRESS ;
150
                   DUP 4 ;
151
                   IF_LEFT
152
                     { CONTRACT %transfer (pair (address %from)
153
                                                (pair (address %to) (nat %value))) ;
154
                       IF_NONE { DUP 10 ; FAILWITH } {} ;
155
                       PUSH mutez 0 ;
156
                       DUP 9 ;
157
                       DIG 3 ;
158
                       DIG 4 ;
159
                       PAIR 3 ;
160
                       TRANSFER_TOKENS }
161
                     { UNPAIR ;
162
                       CONTRACT %transfer (list (pair (address %from_)
163
                                                     (list %txs (pair (address %to_)
164
                                                                     (pair
165
                                                                       (nat %token_id)
166
                                                                       (nat %amount)))))) ;
167
                       IF_NONE { DUP 10 ; FAILWITH } {} ;
168
                       PUSH mutez 0 ;
169
                       NIL (pair address (list (pair address (pair nat nat)))) ;
170
                       NIL (pair address (pair nat nat)) ;
171
                       DUP 12 ;
172
                       DIG 5 ;
173
                       DIG 6 ;
174
                       PAIR 3 ;
175
                       CONS ;
176
                       DIG 4 ;
177
                       PAIR ;
178
                       CONS ;
179
                       TRANSFER_TOKENS } ;
180
                   DUP 2 ;
181
                   CONTRACT %deposit nat ;
182
                   IF_NONE { PUSH string "TKTR_DEPOSIT_NOT_FOUND" ; FAILWITH } {} ;
183
                   PUSH mutez 0 ;
184
                   DUP 8 ;
185
                   TRANSFER_TOKENS ;
186
                   DIG 3 ;
187
                   IF_LEFT
188
                     { DIG 8 ;
189
                       DROP ;
190
                       CONTRACT %approve (pair (address %spender) (nat %value)) ;
191
                       IF_NONE { DIG 7 ; FAILWITH } { DIG 8 ; DROP } ;
192
                       PUSH mutez 0 ;
193
                       DIG 7 ;
194
                       DIG 5 ;
195
                       PAIR ;
196
                       TRANSFER_TOKENS }
197
                     { DIG 6 ;
198
                       DIG 9 ;
199
                       DROP 2 ;
200
                       UNPAIR ;
201
                       SELF_ADDRESS ;
202
                       NIL (or (pair address (pair address nat))
203
                               (pair address (pair address nat))) ;
204
                       DIG 3 ;
205
                       DIG 6 ;
206
                       DIG 3 ;
207
                       PAIR 3 ;
208
                       LEFT (pair address (pair address nat)) ;
209
                       CONS ;
210
                       SWAP ;
211
                       CONTRACT %update_operators (list (or
212
                                                         (pair %add_operator
213
                                                           (address %owner)
214
                                                           (pair (address %operator)
215
                                                                 (nat %token_id)))
216
                                                         (pair %remove_operator
217
                                                           (address %owner)
218
                                                           (pair (address %operator)
219
                                                                 (nat %token_id))))) ;
220
                       IF_NONE { DIG 6 ; FAILWITH } { DIG 7 ; DROP } ;
221
                       PUSH mutez 0 ;
222
                       DIG 2 ;
223
                       TRANSFER_TOKENS } ;
224
                   DIG 5 ;
225
                   DIG 4 ;
226
                   DIG 5 ;
227
                   PAIR ;
228
                   SOME ;
229
                   UPDATE 7 ;
230
                   NIL operation ;
231
                   DIG 3 ;
232
                   CONS ;
233
                   DIG 2 ;
234
                   CONS ;
235
                   DIG 2 ;
236
                   CONS ;
237
                   PAIR } } } }