BCD

Tezos Contract Explorer
Search Networks Deploy
  • Home
  • /
  • Ghostnet
  • /
  • KT1Ce3e...QKzK
operations (5)Storage Code Interact Tokens Fork Views Statistics Details
Latest
​x
60
 
1
{ parameter (or (or (address %get_inventory_of) (unit %get_my_inventory)) (unit %mint)) ;
2
  storage (big_map address (set (pair (string %name) (int %props)))) ;
3
  code { LAMBDA
4
           (pair address (big_map address (set (pair string int))))
5
           (list operation)
6
           { UNPAIR ;
7
             PUSH address "KT1KvDaiC7sn6sdYyWncaYFUoivwHoK1pJM7" ;
8
             CONTRACT (or (nat %viewNat)
9
                          (or (int %viewInt)
10
                              (or (string %viewString)
11
                                  (or (address %viewAddress)
12
                                      (set %viewInventory (pair (string %name)
13
                                                               (int %props))))))) ;
14
             IF_NONE { PUSH string "Contract not found!!!" ; FAILWITH } {} ;
15
             PUSH mutez 0 ;
16
             DIG 3 ;
17
             DIG 3 ;
18
             GET ;
19
             IF_NONE { EMPTY_SET (pair string int) } {} ;
20
             RIGHT address ;
21
             RIGHT string ;
22
             RIGHT int ;
23
             RIGHT nat ;
24
             TRANSFER_TOKENS ;
25
             NIL operation ;
26
             SWAP ;
27
             CONS } ;
28
         SWAP ;
29
         UNPAIR ;
30
         IF_LEFT
31
           { IF_LEFT
32
               { DUP 2 ; DUG 2 ; PAIR ; DIG 2 ; SWAP ; EXEC }
33
               { DROP ; DUP ; SENDER ; PAIR ; DIG 2 ; SWAP ; EXEC } }
34
           { DIG 2 ;
35
             DROP 2 ;
36
             PUSH timestamp 1661472000 ;
37
             NOW ;
38
             SUB ;
39
             SENDER ;
40
             DUP 3 ;
41
             DIG 3 ;
42
             DUP 3 ;
43
             GET ;
44
             IF_NONE { EMPTY_SET (pair string int) } {} ;
45
             DIG 3 ;
46
             PUSH string "some id" ;
47
             PAIR ;
48
             PUSH bool True ;
49
             SWAP ;
50
             UPDATE ;
51
             SOME ;
52
             DIG 2 ;
53
             UPDATE ;
54
             NIL operation } ;
55
         PAIR } ;
56
  view "view_inventory_of" address (set (pair (string %name) (int %props)))
57
        { UNPAIR ; GET ; IF_NONE { EMPTY_SET (pair string int) } {} } ;
58
  view "view_my_inventory" address (set (pair (string %name) (int %props)))
59
        { CDR ; SENDER ; GET ; IF_NONE { EMPTY_SET (pair string int) } {} } ;
60
  view "view_test" unit int { DROP ; PUSH int 34 } }