BCD

Tezos Contract Explorer
Search Networks Deploy
  • Home
  • /
  • Mainnet
  • /
  • QuipuSwap uDEFI
FA2
operations (19.8K)Storage Code Interact Tokens Metadata Fork Views Statistics Details
Latest
​x
520
 
1
parameter (or
2
            (or
3
              (or
4
                (pair %balance_of
5
                  (list %requests (pair (address %owner) (nat %token_id)))
6
                  (contract %callback (list (pair
7
                                            (pair %request (address %owner)
8
                                                           (nat %token_id))
9
                                            (nat %balance)))))
10
                (unit %default))
11
              (or (contract %get_reserves (pair nat nat))
12
                  (list %transfer (pair (address %from_)
13
                                       (list %txs (pair (address %to_) (nat %token_id)
14
                                                       (nat %amount)))))))
15
            (or
16
              (list %update_operators (or
17
                                       (pair %add_operator (address %owner)
18
                                                           (address %operator)
19
                                                           (nat %token_id))
20
                                       (pair %remove_operator (address %owner)
21
                                                              (address %operator)
22
                                                              (nat %token_id))))
23
              (or %use
24
                (or
25
                  (or
26
                    (pair %divestLiquidity (pair (nat %min_tez) (nat %min_tokens))
27
                                           (nat %shares))
28
                    (nat %initializeExchange))
29
                  (or (nat %investLiquidity)
30
                      (pair %tezToTokenPayment (nat %min_out) (address %receiver))))
31
                (or
32
                  (or
33
                    (pair %tokenToTezPayment (pair (nat %amount) (nat %min_out))
34
                                             (address %receiver))
35
                    (pair %veto (nat %value) (address %voter)))
36
                  (or
37
                    (pair %vote (pair (key_hash %candidate) (nat %value))
38
                                (address %voter))
39
                    (address %withdrawProfit))))));
40
storage (pair
41
          (pair
42
            (big_map %dex_lambdas nat
43
                                  (lambda
44
                                    (pair
45
                                      (pair
46
                                        (or
47
                                          (or
48
                                            (or
49
                                              (pair %divestLiquidity
50
                                                (pair (nat %min_tez) (nat %min_tokens))
51
                                                (nat %shares))
52
                                              (nat %initializeExchange))
53
                                            (or (nat %investLiquidity)
54
                                                (pair %tezToTokenPayment (nat %min_out)
55
                                                                         (address %receiver))))
56
                                          (or
57
                                            (or
58
                                              (pair %tokenToTezPayment
59
                                                (pair (nat %amount) (nat %min_out))
60
                                                (address %receiver))
61
                                              (pair %veto (nat %value) (address %voter)))
62
                                            (or
63
                                              (pair %vote
64
                                                (pair (key_hash %candidate) (nat %value))
65
                                                (address %voter))
66
                                              (address %withdrawProfit))))
67
                                        (pair
68
                                          (pair
69
                                            (pair
70
                                              (pair (address %baker_validator)
71
                                                    (option %current_candidate key_hash))
72
                                              (option %current_delegated key_hash)
73
                                              (timestamp %last_update_time))
74
                                            (pair (timestamp %last_veto)
75
                                                  (big_map %ledger address
76
                                                                   (pair
77
                                                                     (pair
78
                                                                       (set %allowances address)
79
                                                                       (nat %balance))
80
                                                                     (nat %frozen_balance))))
81
                                            (timestamp %period_finish)
82
                                            (nat %reward))
83
                                          (pair
84
                                            (pair (nat %reward_paid)
85
                                                  (nat %reward_per_sec))
86
                                            (nat %reward_per_share)
87
                                            (nat %tez_pool))
88
                                          (pair (address %token_address) (nat %token_id))
89
                                          (nat %token_pool)
90
                                          (nat %total_reward))
91
                                        (pair
92
                                          (pair (nat %total_supply) (nat %total_votes))
93
                                          (big_map %user_rewards address
94
                                                                 (pair (nat %reward)
95
                                                                       (nat %reward_paid)))
96
                                          (nat %veto))
97
                                        (pair (big_map %vetos key_hash timestamp)
98
                                              (big_map %voters address
99
                                                               (pair
100
                                                                 (pair
101
                                                                   (option %candidate key_hash)
102
                                                                   (timestamp %last_veto))
103
                                                                 (nat %veto)
104
                                                                 (nat %vote))))
105
                                        (big_map %votes key_hash nat))
106
                                      address)
107
                                    (pair (list operation)
108
                                          (pair
109
                                            (pair
110
                                              (pair
111
                                                (pair (address %baker_validator)
112
                                                      (option %current_candidate key_hash))
113
                                                (option %current_delegated key_hash)
114
                                                (timestamp %last_update_time))
115
                                              (pair (timestamp %last_veto)
116
                                                    (big_map %ledger address
117
                                                                     (pair
118
                                                                       (pair
119
                                                                         (set %allowances address)
120
                                                                         (nat %balance))
121
                                                                       (nat %frozen_balance))))
122
                                              (timestamp %period_finish)
123
                                              (nat %reward))
124
                                            (pair
125
                                              (pair (nat %reward_paid)
126
                                                    (nat %reward_per_sec))
127
                                              (nat %reward_per_share)
128
                                              (nat %tez_pool))
129
                                            (pair (address %token_address)
130
                                                  (nat %token_id))
131
                                            (nat %token_pool)
132
                                            (nat %total_reward))
133
                                          (pair
134
                                            (pair (nat %total_supply) (nat %total_votes))
135
                                            (big_map %user_rewards address
136
                                                                   (pair (nat %reward)
137
                                                                         (nat %reward_paid)))
138
                                            (nat %veto))
139
                                          (pair (big_map %vetos key_hash timestamp)
140
                                                (big_map %voters address
141
                                                                 (pair
142
                                                                   (pair
143
                                                                     (option %candidate key_hash)
144
                                                                     (timestamp %last_veto))
145
                                                                   (nat %veto)
146
                                                                   (nat %vote))))
147
                                          (big_map %votes key_hash nat))))
148
            (big_map %metadata string bytes))
149
          (pair %storage
150
            (pair
151
              (pair
152
                (pair
153
                  (pair (address %baker_validator) (option %current_candidate key_hash))
154
                  (option %current_delegated key_hash)
155
                  (timestamp %last_update_time))
156
                (pair (timestamp %last_veto)
157
                      (big_map %ledger address
158
                                       (pair
159
                                         (pair (set %allowances address) (nat %balance))
160
                                         (nat %frozen_balance))))
161
                (timestamp %period_finish)
162
                (nat %reward))
163
              (pair (pair (nat %reward_paid) (nat %reward_per_sec))
164
                    (nat %reward_per_share)
165
                    (nat %tez_pool))
166
              (pair (address %token_address) (nat %token_id))
167
              (nat %token_pool)
168
              (nat %total_reward))
169
            (pair (pair (nat %total_supply) (nat %total_votes))
170
                  (big_map %user_rewards address (pair (nat %reward) (nat %reward_paid)))
171
                  (nat %veto))
172
            (pair (big_map %vetos key_hash timestamp)
173
                  (big_map %voters address
174
                                   (pair
175
                                     (pair (option %candidate key_hash)
176
                                           (timestamp %last_veto))
177
                                     (nat %veto)
178
                                     (nat %vote))))
179
            (big_map %votes key_hash nat))
180
          (big_map %token_lambdas nat
181
                                  (lambda
182
                                    (pair
183
                                      (pair
184
                                        (or
185
                                          (or
186
                                            (pair %iBalance_of
187
                                              (list %requests (pair (address %owner)
188
                                                                   (nat %token_id)))
189
                                              (contract %callback (list (pair
190
                                                                        (pair %request
191
                                                                          (address %owner)
192
                                                                          (nat %token_id))
193
                                                                        (nat %balance)))))
194
                                            (list %iTransfer (pair (address %from_)
195
                                                                  (list %txs (pair
196
                                                                              (address %to_)
197
                                                                              (nat %token_id)
198
                                                                              (nat %amount))))))
199
                                          (list %iUpdate_operators (or
200
                                                                    (pair %add_operator
201
                                                                      (address %owner)
202
                                                                      (address %operator)
203
                                                                      (nat %token_id))
204
                                                                    (pair %remove_operator
205
                                                                      (address %owner)
206
                                                                      (address %operator)
207
                                                                      (nat %token_id)))))
208
                                        (pair
209
                                          (pair
210
                                            (pair
211
                                              (pair (address %baker_validator)
212
                                                    (option %current_candidate key_hash))
213
                                              (option %current_delegated key_hash)
214
                                              (timestamp %last_update_time))
215
                                            (pair (timestamp %last_veto)
216
                                                  (big_map %ledger address
217
                                                                   (pair
218
                                                                     (pair
219
                                                                       (set %allowances address)
220
                                                                       (nat %balance))
221
                                                                     (nat %frozen_balance))))
222
                                            (timestamp %period_finish)
223
                                            (nat %reward))
224
                                          (pair
225
                                            (pair (nat %reward_paid)
226
                                                  (nat %reward_per_sec))
227
                                            (nat %reward_per_share)
228
                                            (nat %tez_pool))
229
                                          (pair (address %token_address) (nat %token_id))
230
                                          (nat %token_pool)
231
                                          (nat %total_reward))
232
                                        (pair
233
                                          (pair (nat %total_supply) (nat %total_votes))
234
                                          (big_map %user_rewards address
235
                                                                 (pair (nat %reward)
236
                                                                       (nat %reward_paid)))
237
                                          (nat %veto))
238
                                        (pair (big_map %vetos key_hash timestamp)
239
                                              (big_map %voters address
240
                                                               (pair
241
                                                                 (pair
242
                                                                   (option %candidate key_hash)
243
                                                                   (timestamp %last_veto))
244
                                                                 (nat %veto)
245
                                                                 (nat %vote))))
246
                                        (big_map %votes key_hash nat))
247
                                      address)
248
                                    (pair (list operation)
249
                                          (pair
250
                                            (pair
251
                                              (pair
252
                                                (pair (address %baker_validator)
253
                                                      (option %current_candidate key_hash))
254
                                                (option %current_delegated key_hash)
255
                                                (timestamp %last_update_time))
256
                                              (pair (timestamp %last_veto)
257
                                                    (big_map %ledger address
258
                                                                     (pair
259
                                                                       (pair
260
                                                                         (set %allowances address)
261
                                                                         (nat %balance))
262
                                                                       (nat %frozen_balance))))
263
                                              (timestamp %period_finish)
264
                                              (nat %reward))
265
                                            (pair
266
                                              (pair (nat %reward_paid)
267
                                                    (nat %reward_per_sec))
268
                                              (nat %reward_per_share)
269
                                              (nat %tez_pool))
270
                                            (pair (address %token_address)
271
                                                  (nat %token_id))
272
                                            (nat %token_pool)
273
                                            (nat %total_reward))
274
                                          (pair
275
                                            (pair (nat %total_supply) (nat %total_votes))
276
                                            (big_map %user_rewards address
277
                                                                   (pair (nat %reward)
278
                                                                         (nat %reward_paid)))
279
                                            (nat %veto))
280
                                          (pair (big_map %vetos key_hash timestamp)
281
                                                (big_map %voters address
282
                                                                 (pair
283
                                                                   (pair
284
                                                                     (option %candidate key_hash)
285
                                                                     (timestamp %last_veto))
286
                                                                   (nat %veto)
287
                                                                   (nat %vote))))
288
                                          (big_map %votes key_hash nat)))));
289
code { DUP ;
290
       CDR ;
291
       SWAP ;
292
       CAR ;
293
       SELF ;
294
       ADDRESS ;
295
       SWAP ;
296
       IF_LEFT
297
         { IF_LEFT
298
             { IF_LEFT
299
                 { DIG 2 ;
300
                   PUSH nat 2 ;
301
                   PAIR ;
302
                   DUG 2 ;
303
                   LEFT (list (pair address (list (pair address (pair nat nat))))) ;
304
                   LEFT (list (or (pair address (pair address nat))
305
                                 (pair address (pair address nat)))) ;
306
                   DIG 2 ;
307
                   DUP ;
308
                   CDR ;
309
                   SWAP ;
310
                   CAR ;
311
                   SWAP ;
312
                   DUP ;
313
                   DUG 2 ;
314
                   CDR ;
315
                   CDR ;
316
                   SWAP ;
317
                   GET ;
318
                   IF_NONE
319
                     { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH }
320
                     { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ;
321
                   SWAP ;
322
                   DUP ;
323
                   DUG 2 ;
324
                   CDR ;
325
                   CDR ;
326
                   SWAP ;
327
                   DUP ;
328
                   DUG 2 ;
329
                   CDR ;
330
                   PAIR ;
331
                   DIG 2 ;
332
                   CAR ;
333
                   PAIR ;
334
                   SWAP ;
335
                   CAR ;
336
                   PAIR }
337
                 { DROP 2 ;
338
                   DUP ;
339
                   CAR ;
340
                   CAR ;
341
                   PUSH nat 8 ;
342
                   GET ;
343
                   IF_NONE
344
                     { PUSH string "Dex/function-not-set" ; FAILWITH }
345
                     { SELF ;
346
                       ADDRESS ;
347
                       DIG 2 ;
348
                       DUP ;
349
                       DUG 3 ;
350
                       CDR ;
351
                       CAR ;
352
                       PUSH nat 0 ;
353
                       RIGHT (pair (pair nat nat) nat) ;
354
                       LEFT (or nat (pair nat address)) ;
355
                       LEFT (or (or (pair (pair nat nat) address) (pair nat address))
356
                                (or (pair (pair key_hash nat) address) address)) ;
357
                       PAIR ;
358
                       PAIR ;
359
                       EXEC } ;
360
                   SWAP ;
361
                   DUP ;
362
                   DUG 2 ;
363
                   CDR ;
364
                   CDR ;
365
                   SWAP ;
366
                   DUP ;
367
                   DUG 2 ;
368
                   CDR ;
369
                   PAIR ;
370
                   DIG 2 ;
371
                   CAR ;
372
                   PAIR ;
373
                   SWAP ;
374
                   CAR ;
375
                   PAIR } }
376
             { IF_LEFT
377
                 { SWAP ;
378
                   DROP ;
379
                   SWAP ;
380
                   DUP ;
381
                   DUG 2 ;
382
                   NIL operation ;
383
                   DIG 2 ;
384
                   PUSH mutez 0 ;
385
                   DIG 4 ;
386
                   DUP ;
387
                   DUG 5 ;
388
                   CDR ;
389
                   CAR ;
390
                   CAR ;
391
                   CDR ;
392
                   CDR ;
393
                   CDR ;
394
                   CAR ;
395
                   DIG 5 ;
396
                   CDR ;
397
                   CAR ;
398
                   CAR ;
399
                   CDR ;
400
                   CAR ;
401
                   CDR ;
402
                   CDR ;
403
                   PAIR ;
404
                   TRANSFER_TOKENS ;
405
                   CONS ;
406
                   PAIR }
407
                 { DIG 2 ;
408
                   PUSH nat 0 ;
409
                   PAIR ;
410
                   DUG 2 ;
411
                   RIGHT (pair (list (pair address nat))
412
                               (contract (list (pair (pair address nat) nat)))) ;
413
                   LEFT (list (or (pair address (pair address nat))
414
                                 (pair address (pair address nat)))) ;
415
                   DIG 2 ;
416
                   DUP ;
417
                   CDR ;
418
                   SWAP ;
419
                   CAR ;
420
                   SWAP ;
421
                   DUP ;
422
                   DUG 2 ;
423
                   CDR ;
424
                   CDR ;
425
                   SWAP ;
426
                   GET ;
427
                   IF_NONE
428
                     { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH }
429
                     { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ;
430
                   SWAP ;
431
                   DUP ;
432
                   DUG 2 ;
433
                   CDR ;
434
                   CDR ;
435
                   SWAP ;
436
                   DUP ;
437
                   DUG 2 ;
438
                   CDR ;
439
                   PAIR ;
440
                   DIG 2 ;
441
                   CAR ;
442
                   PAIR ;
443
                   SWAP ;
444
                   CAR ;
445
                   PAIR } } }
446
         { IF_LEFT
447
             { DIG 2 ;
448
               PUSH nat 1 ;
449
               PAIR ;
450
               DUG 2 ;
451
               RIGHT (or
452
                       (pair (list (pair address nat))
453
                             (contract (list (pair (pair address nat) nat))))
454
                       (list (pair address (list (pair address (pair nat nat)))))) ;
455
               DIG 2 ;
456
               DUP ;
457
               CDR ;
458
               SWAP ;
459
               CAR ;
460
               SWAP ;
461
               DUP ;
462
               DUG 2 ;
463
               CDR ;
464
               CDR ;
465
               SWAP ;
466
               GET ;
467
               IF_NONE
468
                 { SWAP ; DROP ; SWAP ; DROP ; PUSH string "Dex/function-not-set" ; FAILWITH }
469
                 { DIG 3 ; DIG 2 ; DUP ; DUG 3 ; CDR ; CAR ; DIG 4 ; PAIR ; PAIR ; EXEC } ;
470
               SWAP ;
471
               DUP ;
472
               DUG 2 ;
473
               CDR ;
474
               CDR ;
475
               SWAP ;
476
               DUP ;
477
               DUG 2 ;
478
               CDR ;
479
               PAIR ;
480
               DIG 2 ;
481
               CAR ;
482
               PAIR ;
483
               SWAP ;
484
               CAR ;
485
               PAIR }
486
             { DIG 2 ;
487
               DUP ;
488
               DUG 3 ;
489
               CAR ;
490
               CAR ;
491
               SWAP ;
492
               DUP ;
493
               DUG 2 ;
494
               IF_LEFT
495
                 { IF_LEFT
496
                     { IF_LEFT { DROP ; PUSH nat 5 } { DROP ; PUSH nat 0 } }
497
                     { IF_LEFT { DROP ; PUSH nat 4 } { DROP ; PUSH nat 1 } } }
498
                 { IF_LEFT
499
                     { IF_LEFT { DROP ; PUSH nat 2 } { DROP ; PUSH nat 7 } }
500
                     { IF_LEFT { DROP ; PUSH nat 6 } { DROP ; PUSH nat 3 } } } ;
501
               GET ;
502
               IF_NONE
503
                 { DROP 2 ; PUSH string "Dex/function-not-set" ; FAILWITH }
504
                 { DIG 2 ; DIG 3 ; DUP ; DUG 4 ; CDR ; CAR ; DIG 3 ; PAIR ; PAIR ; EXEC } ;
505
               SWAP ;
506
               DUP ;
507
               DUG 2 ;
508
               CDR ;
509
               CDR ;
510
               SWAP ;
511
               DUP ;
512
               DUG 2 ;
513
               CDR ;
514
               PAIR ;
515
               DIG 2 ;
516
               CAR ;
517
               PAIR ;
518
               SWAP ;
519
               CAR ;
520
               PAIR } } }