-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconsumer.tz
59 lines (58 loc) · 1.05 KB
/
consumer.tz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# @hicetnunc2000
parameter (or (pair %requestData (string %link) (pair (nat %mult) (string %path))) (nat %ungrundResponse));
storage (pair (address %adm) (pair (address %oracle) (nat %result)));
code
{
DUP;
CDR;
SWAP;
CAR;
IF_LEFT
{
SWAP;
DUP;
DUG 2;
CAR;
SENDER;
COMPARE;
EQ;
IF
{}
{
PUSH string "WrongCondition: sp.sender == self.data.adm";
FAILWITH;
};
NIL operation;
DIG 2;
DUP;
DUG 3;
CDR;
CAR;
CONTRACT %requestsQueue (pair (string %link) (pair (nat %mult) (string %path)));
IF_SOME
{}
{
PUSH int 68;
FAILWITH;
};
AMOUNT;
DIG 3;
TRANSFER_TOKENS;
CONS;
}
{
SWAP;
DUP;
CAR;
SWAP;
CDR;
CAR;
DIG 2;
SWAP;
PAIR;
SWAP;
PAIR;
NIL operation;
};
PAIR;
};