BCD

Tezos Contract Explorer
Search Networks Deploy
  • Home
  • /
  • Ghostnet
  • /
  • Tezos Domains Affiliate Buy & Renew
operations (67)Storage Code Interact Tokens Metadata Fork Events Statistics Details
Latest
​x
77
 
1
parameter (or (pair %renew (bytes %label) (nat %duration) (address %affiliate))
2
              (pair %buy (bytes %label) (nat %duration) (address %owner)
3
                         (option %address address)
4
                         (map %data string bytes)
5
                         (nat %nonce)
6
                         (address %affiliate)));
7
storage (pair (address %buy_addr) (address %renew_addr) (big_map %metadata string bytes));
8
code { LAMBDA
9
         (pair string address)
10
         operation
11
         { UNPAIR ;
12
           SWAP ;
13
           AMOUNT ;
14
           DIG 2 ;
15
           PAIR 3 ;
16
           EMIT %affiliate_income (pair (string %kind) (mutez %value)
17
                                        (address %affiliate)) } ;
18
       SWAP ;
19
       UNPAIR ;
20
       IF_LEFT
21
         { DUP 2 ;
22
           GET 3 ;
23
           CONTRACT %renew (pair (bytes %label) (nat %duration)) ;
24
           IF_NONE { PUSH string "bad address for get_entrypoint" ; FAILWITH } {} ;
25
           DIG 2 ;
26
           NIL operation ;
27
           DIG 2 ;
28
           AMOUNT ;
29
           DUP 5 ;
30
           GET 3 ;
31
           DUP 6 ;
32
           CAR ;
33
           PAIR ;
34
           TRANSFER_TOKENS ;
35
           CONS ;
36
           DIG 2 ;
37
           GET 4 ;
38
           PUSH string "renew" ;
39
           PAIR ;
40
           DIG 3 ;
41
           SWAP ;
42
           EXEC }
43
         { DUP 2 ;
44
           CAR ;
45
           CONTRACT %buy (pair (bytes %label) (nat %duration) (address %owner)
46
                               (option %address address)
47
                               (map %data string bytes)
48
                               (nat %nonce)) ;
49
           IF_NONE { PUSH string "bad address for get_entrypoint" ; FAILWITH } {} ;
50
           DIG 2 ;
51
           NIL operation ;
52
           DIG 2 ;
53
           AMOUNT ;
54
           DUP 5 ;
55
           GET 11 ;
56
           DUP 6 ;
57
           GET 9 ;
58
           DUP 7 ;
59
           GET 7 ;
60
           DUP 8 ;
61
           GET 5 ;
62
           DUP 9 ;
63
           GET 3 ;
64
           DUP 10 ;
65
           CAR ;
66
           PAIR 6 ;
67
           TRANSFER_TOKENS ;
68
           CONS ;
69
           DIG 2 ;
70
           GET 12 ;
71
           PUSH string "buy" ;
72
           PAIR ;
73
           DIG 3 ;
74
           SWAP ;
75
           EXEC } ;
76
       CONS ;
77
       PAIR }