BCD

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