-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathContract.approval.teal
More file actions
161 lines (155 loc) Β· 4.84 KB
/
Contract.approval.teal
File metadata and controls
161 lines (155 loc) Β· 4.84 KB
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
#pragma version 12
#pragma typetrack false
// algopy.arc4.ARC4Contract.approval_program() -> uint64:
main:
intcblock 1 6 0
bytecblock base64(DIEBQw==)
// tests/artifacts/AVM12/contract.py:4
// class Contract(ARC4Contract, avm_version=12):
txn NumAppArgs
bz main___algopy_default_create@9
txn OnCompletion
!
assert // OnCompletion must be NoOp
txn ApplicationID
assert
pushbytess 0xbe56499c 0xac8aab42 // method "test_falcon_verify()void", method "test_reject_version()void"
txna ApplicationArgs 0
match test_falcon_verify test_reject_version
err
main___algopy_default_create@9:
txn OnCompletion
!
txn ApplicationID
!
&&
assert // OnCompletion must be NoOp && can only call when creating
intc_0 // 1
return
// tests.artifacts.AVM12.contract.Contract.test_falcon_verify[routing]() -> void:
test_falcon_verify:
// tests/artifacts/AVM12/contract.py:7
// assert not op.falcon_verify(b"", b"", op.bzero(1793))
pushint 1793 // 1793
bzero
pushbytes 0x
dup
uncover 2
falcon_verify
!
// tests/artifacts/AVM12/contract.py:5
// @arc4.abimethod
return
// tests.artifacts.AVM12.contract.Contract.test_reject_version[routing]() -> void:
test_reject_version:
// tests/artifacts/AVM12/contract.py:11
// app_v0_txn = arc4.arc4_create(ContractV0)
itxn_begin
bytec_0 // base64(DIEBQw==)
itxn_field ClearStateProgramPages
pushbytes base64(DDEbQQAagASg6BhyNhoAjgEAAQAxGYEEEjEYEERCAAsxGRQxGBQQRIEBQzFEgQESRIEBQw==)
itxn_field ApprovalProgramPages
intc_1 // appl
itxn_field TypeEnum
intc_2 // 0
itxn_field Fee
itxn_submit
itxn CreatedApplicationID
// tests/artifacts/AVM12/contract.py:13
// assert app.version == 0, "should be version 0"
dup
app_params_get AppVersion
assert // application exists
!
assert // should be version 0
// tests/artifacts/AVM12/contract.py:15-17
// arc4.arc4_update(
// ContractV0.update, app_id=app, reject_version=1, compiled=compile_contract(ContractV1)
// )
itxn_begin
// tests/artifacts/AVM12/contract.py:16
// ContractV0.update, app_id=app, reject_version=1, compiled=compile_contract(ContractV1)
bytec_0 // base64(DIEBQw==)
itxn_field ClearStateProgramPages
pushbytes base64(DDEbQQAagAQkN408NhoAjgEAAQAxGYEFEjEYEERCAAsxGRQxGBQQRIEBQzFEgQISRIEBQw==)
itxn_field ApprovalProgramPages
// tests/artifacts/AVM12/contract.py:15-17
// arc4.arc4_update(
// ContractV0.update, app_id=app, reject_version=1, compiled=compile_contract(ContractV1)
// )
pushint 4 // UpdateApplication
itxn_field OnCompletion
// tests/artifacts/AVM12/contract.py:16
// ContractV0.update, app_id=app, reject_version=1, compiled=compile_contract(ContractV1)
intc_0 // 1
itxn_field RejectVersion
dup
itxn_field ApplicationID
// tests/artifacts/AVM12/contract.py:15-17
// arc4.arc4_update(
// ContractV0.update, app_id=app, reject_version=1, compiled=compile_contract(ContractV1)
// )
pushbytes 0xa0e81872 // method "update()void"
itxn_field ApplicationArgs
intc_1 // appl
itxn_field TypeEnum
intc_2 // 0
itxn_field Fee
itxn_submit
// tests/artifacts/AVM12/contract.py:18
// assert app.version == 1, "should be version 1"
dup
app_params_get AppVersion
assert // application exists
intc_0 // 1
==
assert // should be version 1
// tests/artifacts/AVM12/contract.py:20-29
// itxn.ApplicationCall(
// app_args=(
// arc4.arc4_signature(
// ContractV1.delete,
// ),
// ),
// on_completion=OnCompleteAction.DeleteApplication,
// app_id=app,
// reject_version=2,
// ).submit()
itxn_begin
// tests/artifacts/AVM12/contract.py:28
// reject_version=2,
pushint 2 // 2
itxn_field RejectVersion
itxn_field ApplicationID
// tests/artifacts/AVM12/contract.py:26
// on_completion=OnCompleteAction.DeleteApplication,
pushint 5 // DeleteApplication
itxn_field OnCompletion
// tests/artifacts/AVM12/contract.py:22-24
// arc4.arc4_signature(
// ContractV1.delete,
// ),
pushbytes 0x24378d3c // method "delete()void"
itxn_field ApplicationArgs
// tests/artifacts/AVM12/contract.py:20
// itxn.ApplicationCall(
intc_1 // appl
itxn_field TypeEnum
intc_2 // 0
itxn_field Fee
// tests/artifacts/AVM12/contract.py:20-29
// itxn.ApplicationCall(
// app_args=(
// arc4.arc4_signature(
// ContractV1.delete,
// ),
// ),
// on_completion=OnCompleteAction.DeleteApplication,
// app_id=app,
// reject_version=2,
// ).submit()
itxn_submit
// tests/artifacts/AVM12/contract.py:9
// @arc4.abimethod
intc_0 // 1
return