summaryrefslogtreecommitdiff
path: root/test/scripts/e2e_subs/tealprogs/app-abi-method-example.teal
blob: dbc831d7a733cccdd1c03a9a34e63b676512a28c (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
// generated from https://gist.github.com/jasonpaulos/99e4f8a75f2fc2ec9b8073c064530359
#pragma version 5
txn ApplicationID
int 0
==
bnz main_l14
txn OnCompletion
int OptIn
==
txna ApplicationArgs 0
byte 0xcfa68e36
==
&&
bnz main_l13
txn OnCompletion
int CloseOut
==
txna ApplicationArgs 0
byte 0xa9f42b3d
==
&&
bnz main_l12
txn OnCompletion
int DeleteApplication
==
txna ApplicationArgs 0
byte 0x24378d3c
==
&&
bnz main_l11
txn OnCompletion
int NoOp
==
txna ApplicationArgs 0
byte 0xfe6bdf69
==
&&
bnz main_l10
txn OnCompletion
int NoOp
==
txna ApplicationArgs 0
byte 0xa88c26a5
==
&&
bnz main_l9
txn OnCompletion
int NoOp
==
txna ApplicationArgs 0
byte 0x3e3b3d28
==
&&
bnz main_l8
int 0
return
main_l8:
txna ApplicationArgs 1
callsub sub5
int 1
return
main_l9:
callsub sub4
int 1
return
main_l10:
txna ApplicationArgs 1
txna ApplicationArgs 2
callsub sub3
int 1
return
main_l11:
callsub sub2
int 1
return
main_l12:
callsub sub1
int 1
return
main_l13:
txna ApplicationArgs 1
callsub sub0
int 1
return
main_l14:
int 1
return
sub0: // optIn
store 0
int 0
byte "name"
load 0
extract 2 0
app_local_put
byte "hello "
int 0
byte "name"
app_local_get
concat
store 1
byte 0x151f7c75
load 1
len
itob
extract 6 2
concat
load 1
concat
log
retsub
sub1: // closeOut
byte "goodbye "
int 0
byte "name"
app_local_get
concat
store 2
byte 0x151f7c75
load 2
len
itob
extract 6 2
concat
load 2
concat
log
retsub
sub2: // deleteApp
txn Sender
global CreatorAddress
==
assert
retsub
sub3: // add
store 4
store 3
byte 0x151f7c75
load 3
btoi
load 4
btoi
+
itob
concat
log
retsub
sub4: // empty
byte "random inconsequential log"
log
retsub
sub5: // payment
store 5
txn GroupIndex
int 1
-
gtxns TypeEnum
int pay
==
assert
byte 0x151f7c75
txn GroupIndex
int 1
-
gtxns Amount
load 5
btoi
==
bnz sub5_l2
byte 0x00
b sub5_l3
sub5_l2:
byte 0x80
sub5_l3:
concat
log
retsub