From de90e93e07a28f162a3b5fe2174889c05b73d509 Mon Sep 17 00:00:00 2001 From: Hang Su <87964331+ahangsu@users.noreply.github.com> Date: Fri, 2 Dec 2022 20:51:25 -0500 Subject: [PATCH] Frame pointer usage in subroutine (#562) --- CHANGELOG.md | 6 + docker-compose.yml | 4 +- pyteal/ast/abi/tuple.py | 7 + pyteal/ast/frame.py | 23 +- pyteal/ast/frame_test.py | 2 +- pyteal/ast/router.py | 3 + pyteal/ast/subroutine.py | 293 ++- pyteal/ast/subroutine_test.py | 278 ++- pyteal/compiler/compiler.py | 36 +- pyteal/compiler/compiler_test.py | 7 + tests/abi_roundtrip.py | 17 +- tests/integration/abi_roundtrip_test.py | 82 +- tests/integration/graviton_abi_test.py | 33 +- tests/integration/graviton_test.py | 209 +- ...dtrip_().teal => app_roundtrip_()_v6.teal} | 0 .../teal/roundtrip/app_roundtrip_()_v8.teal | 38 + ....teal => app_roundtrip_(bool)[10]_v6.teal} | 0 .../app_roundtrip_(bool)[10]_v8.teal | 185 ++ ...ool).teal => app_roundtrip_(bool)_v6.teal} | 0 .../roundtrip/app_roundtrip_(bool)_v8.teal | 59 + ...64,bool),byte[10],bool[4],uint64)_v6.teal} | 0 ...t64,bool),byte[10],bool[4],uint64)_v8.teal | 847 +++++++ ...teal => app_roundtrip_(bool,byte)_v6.teal} | 0 .../app_roundtrip_(bool,byte)_v8.teal | 85 + ...ndtrip_(bool,byte,address,string)_v6.teal} | 0 ...undtrip_(bool,byte,address,string)_v8.teal | 683 ++++++ ...te),uint8)[2],string,bool[]))[]_2_v6.teal} | 0 ...yte),uint8)[2],string,bool[]))[]_2_v8.teal | 2033 +++++++++++++++++ ...(bool,byte,address,string,uint64)_v6.teal} | 0 ..._(bool,byte,address,string,uint64)_v8.teal | 703 ++++++ ...pp_roundtrip_(bool,uint64,uint32)_v6.teal} | 0 ...app_roundtrip_(bool,uint64,uint32)_v8.teal | 104 + ...yte).teal => app_roundtrip_(byte)_v6.teal} | 0 .../roundtrip/app_roundtrip_(byte)_v8.teal | 62 + ... app_roundtrip_(byte,bool,uint64)_v6.teal} | 0 .../app_roundtrip_(byte,bool,uint64)_v8.teal | 105 + ...],(bool,bool),uint64,address)[]_7_v6.teal} | 0 ...4],(bool,bool),uint64,address)[]_7_v8.teal | 832 +++++++ ...6).teal => app_roundtrip_(uint16)_v6.teal} | 0 .../roundtrip/app_roundtrip_(uint16)_v8.teal | 61 + ...app_roundtrip_(uint16,uint8,byte)_v6.teal} | 0 .../app_roundtrip_(uint16,uint8,byte)_v8.teal | 113 + ...2).teal => app_roundtrip_(uint32)_v6.teal} | 0 .../roundtrip/app_roundtrip_(uint32)_v8.teal | 61 + ...p_roundtrip_(uint32,uint16,uint8)_v6.teal} | 0 ...pp_roundtrip_(uint32,uint16,uint8)_v8.teal | 112 + ...4).teal => app_roundtrip_(uint64)_v6.teal} | 0 .../roundtrip/app_roundtrip_(uint64)_v8.teal | 55 + ..._roundtrip_(uint64,uint32,uint16)_v6.teal} | 0 ...p_roundtrip_(uint64,uint32,uint16)_v8.teal | 106 + ...t8).teal => app_roundtrip_(uint8)_v6.teal} | 0 .../roundtrip/app_roundtrip_(uint8)_v8.teal | 62 + .../app_roundtrip_(uint8,byte,bool).teal | 111 - .../app_roundtrip_(uint8,byte,bool)_v6.teal | 111 + .../app_roundtrip_(uint8,byte,bool)_v8.teal | 111 + ...eal => app_roundtrip_address[]_10_v6.teal} | 0 .../app_roundtrip_address[]_10_v8.teal | 698 ++++++ ...ess.teal => app_roundtrip_address_v6.teal} | 0 .../roundtrip/app_roundtrip_address_v8.teal | 498 ++++ ...[1].teal => app_roundtrip_bool[1]_v6.teal} | 0 .../roundtrip/app_roundtrip_bool[1]_v8.teal | 59 + ...eal => app_roundtrip_bool[3][]_11_v6.teal} | 0 .../app_roundtrip_bool[3][]_11_v8.teal | 293 +++ ...2].teal => app_roundtrip_bool[42]_v6.teal} | 0 .../roundtrip/app_roundtrip_bool[42]_v8.teal | 469 ++++ ..._0.teal => app_roundtrip_bool[]_0_v6.teal} | 0 .../roundtrip/app_roundtrip_bool[]_0_v8.teal | 92 + ..._1.teal => app_roundtrip_bool[]_1_v6.teal} | 0 .../roundtrip/app_roundtrip_bool[]_1_v8.teal | 115 + ...2.teal => app_roundtrip_bool[]_42_v6.teal} | 0 .../roundtrip/app_roundtrip_bool[]_42_v8.teal | 607 +++++ ...p_bool.teal => app_roundtrip_bool_v6.teal} | 0 .../teal/roundtrip/app_roundtrip_bool_v8.teal | 50 + ...6].teal => app_roundtrip_byte[16]_v6.teal} | 0 .../roundtrip/app_roundtrip_byte[16]_v8.teal | 274 +++ ...6.teal => app_roundtrip_byte[]_36_v6.teal} | 0 .../roundtrip/app_roundtrip_byte[]_36_v8.teal | 680 ++++++ ...p_byte.teal => app_roundtrip_byte_v6.teal} | 0 .../teal/roundtrip/app_roundtrip_byte_v8.teal | 55 + ..._0.teal => app_roundtrip_string_0_v6.teal} | 0 .../roundtrip/app_roundtrip_string_0_v8.teal | 92 + ...3.teal => app_roundtrip_string_13_v6.teal} | 0 .../roundtrip/app_roundtrip_string_13_v8.teal | 259 +++ ..._1.teal => app_roundtrip_string_1_v6.teal} | 0 .../roundtrip/app_roundtrip_string_1_v8.teal | 103 + ...nt16.teal => app_roundtrip_uint16_v6.teal} | 0 .../roundtrip/app_roundtrip_uint16_v8.teal | 52 + ...nt32.teal => app_roundtrip_uint32_v6.teal} | 0 .../roundtrip/app_roundtrip_uint32_v8.teal | 52 + ...].teal => app_roundtrip_uint64[1]_v6.teal} | 0 .../roundtrip/app_roundtrip_uint64[1]_v8.teal | 58 + ....teal => app_roundtrip_uint64[42]_v6.teal} | 0 .../app_roundtrip_uint64[42]_v8.teal | 550 +++++ ....teal => app_roundtrip_uint64[]_0_v6.teal} | 0 .../app_roundtrip_uint64[]_0_v8.teal | 92 + ....teal => app_roundtrip_uint64[]_1_v6.teal} | 0 .../app_roundtrip_uint64[]_1_v8.teal | 114 + ...teal => app_roundtrip_uint64[]_42_v6.teal} | 0 .../app_roundtrip_uint64[]_42_v8.teal | 688 ++++++ ...nt64.teal => app_roundtrip_uint64_v6.teal} | 0 .../roundtrip/app_roundtrip_uint64_v8.teal | 44 + ...uint8.teal => app_roundtrip_uint8_v6.teal} | 0 .../roundtrip/app_roundtrip_uint8_v8.teal | 55 + 103 files changed, 13255 insertions(+), 433 deletions(-) rename tests/integration/teal/roundtrip/{app_roundtrip_().teal => app_roundtrip_()_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool)[10].teal => app_roundtrip_(bool)[10]_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool).teal => app_roundtrip_(bool)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64).teal => app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool,byte).teal => app_roundtrip_(bool,byte)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool,byte,address,string).teal => app_roundtrip_(bool,byte,address,string)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2.teal => app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool,byte,address,string,uint64).teal => app_roundtrip_(bool,byte,address,string,uint64)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(bool,uint64,uint32).teal => app_roundtrip_(bool,uint64,uint32)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(byte).teal => app_roundtrip_(byte)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(byte,bool,uint64).teal => app_roundtrip_(byte,bool,uint64)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7.teal => app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint16).teal => app_roundtrip_(uint16)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint16,uint8,byte).teal => app_roundtrip_(uint16,uint8,byte)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint32).teal => app_roundtrip_(uint32)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint32,uint16,uint8).teal => app_roundtrip_(uint32,uint16,uint8)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint64).teal => app_roundtrip_(uint64)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint64,uint32,uint16).teal => app_roundtrip_(uint64,uint32,uint16)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_(uint8).teal => app_roundtrip_(uint8)_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal delete mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool).teal create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v6.teal create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_address[]_10.teal => app_roundtrip_address[]_10_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_address.teal => app_roundtrip_address_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool[1].teal => app_roundtrip_bool[1]_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool[3][]_11.teal => app_roundtrip_bool[3][]_11_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool[42].teal => app_roundtrip_bool[42]_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool[]_0.teal => app_roundtrip_bool[]_0_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool[]_1.teal => app_roundtrip_bool[]_1_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool[]_42.teal => app_roundtrip_bool[]_42_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_bool.teal => app_roundtrip_bool_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_byte[16].teal => app_roundtrip_byte[16]_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_byte[]_36.teal => app_roundtrip_byte[]_36_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_byte.teal => app_roundtrip_byte_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_string_0.teal => app_roundtrip_string_0_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_string_13.teal => app_roundtrip_string_13_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_string_1.teal => app_roundtrip_string_1_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint16.teal => app_roundtrip_uint16_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint32.teal => app_roundtrip_uint32_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint64[1].teal => app_roundtrip_uint64[1]_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint64[42].teal => app_roundtrip_uint64[42]_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint64[]_0.teal => app_roundtrip_uint64[]_0_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint64[]_1.teal => app_roundtrip_uint64[]_1_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint64[]_42.teal => app_roundtrip_uint64[]_42_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint64.teal => app_roundtrip_uint64_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal rename tests/integration/teal/roundtrip/{app_roundtrip_uint8.teal => app_roundtrip_uint8_v6.teal} (100%) create mode 100644 tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal diff --git a/CHANGELOG.md b/CHANGELOG.md index d2efdc526..1c9265ab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,14 @@ # Unreleased +# Added +* Added frame pointer support for subroutine arguments, replacing the previous usage of scratch. ([#562](https://github.com/algorand/pyteal/pull/562)) + # Fixed * Allowing the `MethodCall` and `ExecuteMethodCall` to be passed `None` as app_id argument in the case of an app create transaction ([#592](https://github.com/algorand/pyteal/pull/592)) +# Changed +* Introducing `AbstractVar` to abstract value access: store, load, and stack type. ([#584](https://github.com/algorand/pyteal/pull/584)) + * NOTE: a backwards incompatable change was imposed in this PR: previous ABI value's public member `stored_value` with type `ScratchVar`, is now changed to protected member `_stored_value` with type `AbstractVar`. # 0.20.1 diff --git a/docker-compose.yml b/docker-compose.yml index 50b59f15f..8c18a1501 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,9 +8,9 @@ services: - "4160:4160" # gossip - "9100:9100" # prometheus environment: - - DEV_MODE + - DEV_MODE=true - TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa healthcheck: - test: goal node status || exit 1 + test: goal node status interval: 2s retries: 10 diff --git a/pyteal/ast/abi/tuple.py b/pyteal/ast/abi/tuple.py index 3149250a6..2d744eeeb 100644 --- a/pyteal/ast/abi/tuple.py +++ b/pyteal/ast/abi/tuple.py @@ -679,6 +679,13 @@ def __setattr__(self, name: str, field: Any) -> None: if name == "_NamedTuple__ready" or not self.__ready: super().__setattr__(name, field) return + # NOTE this pass condition is for following scenario: + # NamedTuple is an argument, and inside subroutine, subroutine set internal ABI value with FrameStorage + # This used to violate `__setattr__` for not allowing any assignment to attributes + # Now this case is lifted such that we can shift the storage scheme. + if name == "_stored_value" and self.__ready: + super().__setattr__(name, field) + return raise TealInputError("cannot assign to NamedTuple attributes.") diff --git a/pyteal/ast/frame.py b/pyteal/ast/frame.py index 40c32d3cb..904885f66 100644 --- a/pyteal/ast/frame.py +++ b/pyteal/ast/frame.py @@ -89,19 +89,13 @@ def __init__( f"be greater than local allocations {len(local_stack_types)}." ) - if not all(map(lambda t: t != TealType.none, arg_stack_types)): + if any(t == TealType.none for t in arg_stack_types + local_stack_types): raise TealInternalError("Variables in frame memory layout must be typed.") self.num_return_allocs: int = num_return_allocs self.arg_stack_types: list[TealType] = arg_stack_types self.local_stack_types: list[TealType] = local_stack_types - # Type check of local variables are performed over LocalTypeSegments - self.succinct_repr: list[LocalTypeSegment] = [ - LocalTypeSegment(t_type, len(list(dup_seg))) - for t_type, dup_seg in groupby(self.local_stack_types) - ] - def __getitem__(self, index: int) -> TealType: if index < 0: return self.arg_stack_types[len(self.arg_stack_types) + index] @@ -116,10 +110,19 @@ def has_return(self) -> bool: def type_of(self) -> TealType: return TealType.none + def _succinct_repr(self) -> list[LocalTypeSegment]: + return [ + LocalTypeSegment(t_type, len(list(dup_seg))) + for t_type, dup_seg in groupby(self.local_stack_types) + ] + def __teal__(self, options: "CompileOptions") -> tuple[TealBlock, TealSimpleBlock]: srt = TealSimpleBlock([]) end = srt - for iter_seg in self.succinct_repr: + + # Type check of local variables are performed over LocalTypeSegments + succinct_repr: list[LocalTypeSegment] = self._succinct_repr() + for iter_seg in succinct_repr: seg_srt, seg_end = iter_seg.__teal__(options) end.setNextBlock(seg_srt) end = seg_end @@ -201,7 +204,7 @@ class FrameDig(Expr): """An expression that digs a value from a position around frame pointer. This class is intentionally hidden because it's too basic to directly expose. - his is used only internally by FrameVar. + This is used only internally by FrameVar. """ def __init__(self, frame_index: int, *, inferred_type: Optional[TealType] = None): @@ -235,7 +238,7 @@ class FrameBury(Expr): """An expression that buries a value to a position around frame pointer. This class is intentionally hidden because it's too basic to directly expose. - his is used only internally by FrameVar. + This is used only internally by FrameVar. """ def __init__( diff --git a/pyteal/ast/frame_test.py b/pyteal/ast/frame_test.py index b5fd1e183..e58e11af7 100644 --- a/pyteal/ast/frame_test.py +++ b/pyteal/ast/frame_test.py @@ -305,5 +305,5 @@ class SuccinctReprTestCase: ], ) def test_proto_stack_layout_succinct_repr(testcase: SuccinctReprTestCase): - actual = ProtoStackLayout([], testcase.local_types, False).succinct_repr + actual = ProtoStackLayout([], testcase.local_types, False)._succinct_repr() assert actual == testcase.expected diff --git a/pyteal/ast/router.py b/pyteal/ast/router.py index d10204501..e5cfb513e 100644 --- a/pyteal/ast/router.py +++ b/pyteal/ast/router.py @@ -724,6 +724,7 @@ def compile_program( version: int = DEFAULT_TEAL_VERSION, assemble_constants: bool = False, optimize: OptimizeOptions = None, + frame_pointers: Optional[bool] = None, ) -> tuple[str, str, sdk_abi.Contract]: """ Constructs and compiles approval and clear-state programs from the registered methods and @@ -749,6 +750,7 @@ def compile_program( version=version, assembleConstants=assemble_constants, optimize=optimize, + frame_pointers=frame_pointers, ) csp_compiled = compileTeal( csp, @@ -756,6 +758,7 @@ def compile_program( version=version, assembleConstants=assemble_constants, optimize=optimize, + frame_pointers=frame_pointers, ) return ap_compiled, csp_compiled, contract diff --git a/pyteal/ast/subroutine.py b/pyteal/ast/subroutine.py index 1695d4547..eeea8950b 100644 --- a/pyteal/ast/subroutine.py +++ b/pyteal/ast/subroutine.py @@ -8,8 +8,9 @@ from pyteal.ast import abi from pyteal.ast.expr import Expr from pyteal.ast.seq import Seq -from pyteal.ast.scratchvar import DynamicScratchVar, ScratchVar -from pyteal.errors import TealInputError, verifyProgramVersion +from pyteal.ast.scratchvar import DynamicScratchVar, ScratchVar, ScratchSlot +from pyteal.ast.frame import Proto, FrameVar, ProtoStackLayout +from pyteal.errors import TealInputError, TealInternalError, verifyProgramVersion from pyteal.ir import TealOp, Op, TealBlock from pyteal.types import TealType @@ -17,6 +18,69 @@ from pyteal.compiler import CompileOptions +class _SubroutineDeclByOption: + def __init__(self, subroutine_def: "SubroutineDefinition") -> None: + self.subroutine: SubroutineDefinition = subroutine_def + self.option_map: dict[bool, Optional[SubroutineDeclaration]] = { + True: None, + False: None, + } + self.option_method: dict[bool, SubroutineEval] = { + True: SubroutineEval.fp_evaluator(), + False: SubroutineEval.normal_evaluator(), + } + self.has_return: Optional[bool] = None + self.type_of: Optional[TealType] = None + + def get_declaration(self) -> "SubroutineDeclaration": + return self.get_declaration_by_option(False) + + def get_declaration_by_option( + self, + fp_option: bool = True, + ) -> "SubroutineDeclaration": + decl = self.option_map[fp_option] + if decl is not None: + return decl + self.option_map[fp_option] = self.option_method[fp_option](self.subroutine) + return cast(SubroutineDeclaration, self.option_map[fp_option]) + + def __probe_info(self, fp_option: bool) -> tuple[bool, TealType]: + current_slot_id = ScratchSlot.nextSlotId + is_pre_existing = self.option_map[fp_option] is not None + decl = self.get_declaration_by_option(fp_option) + has_return, type_of = decl.has_return(), decl.type_of() + if not is_pre_existing: + self.option_map[fp_option] = None + ScratchSlot.nextSlotId = current_slot_id + return has_return, type_of + + def __info_prepare(self) -> None: + if self.has_return is not None and self.type_of is not None: + return + ss_ret, ss_type = self.__probe_info(False) + fp_ret, fp_type = self.__probe_info(True) + assert ss_ret == fp_ret + assert ss_type == fp_type + self.has_return = ss_ret + self.type_of = ss_type + + def versions_type_of(self) -> TealType: + self.__info_prepare() + return cast(TealType, self.type_of) + + def versions_has_return(self) -> bool: + self.__info_prepare() + return cast(bool, self.has_return) + + def get_declarations(self) -> None: + self.option_map[False] = self.get_declaration_by_option(False) + self.option_map[True] = self.get_declaration_by_option(True) + + +_SubroutineDeclByOption.__module__ = "pyteal" + + class SubroutineDefinition: """ Class that leverages TEAL's `callsub` and `retsub` opcode-pair for subroutines @@ -45,6 +109,7 @@ def __init__( self.return_type = return_type self.declaration: Optional["SubroutineDeclaration"] = None + self.declarations: _SubroutineDeclByOption = _SubroutineDeclByOption(self) self.implementation: Callable = implementation self.has_abi_output: bool = has_abi_output @@ -239,10 +304,13 @@ def _validate_annotation( ) def get_declaration(self) -> "SubroutineDeclaration": - if self.declaration is None: - # lazy evaluate subroutine - self.declaration = evaluate_subroutine(self) - return self.declaration + return self.declarations.get_declaration() + + def get_declaration_by_option( + self, + fp_option: bool = True, + ) -> "SubroutineDeclaration": + return self.declarations.get_declaration_by_option(fp_option) def name(self) -> str: return self.__name @@ -475,10 +543,10 @@ def name(self) -> str: return self.subroutine.name() def type_of(self): - return self.subroutine.get_declaration().type_of() + return self.subroutine.declarations.versions_type_of() def has_return(self): - return self.subroutine.get_declaration().has_return() + return self.subroutine.declarations.versions_has_return() SubroutineFnWrapper.__module__ = "pyteal" @@ -747,13 +815,14 @@ def __call__(self, fn_implementation: Callable[..., Expr]) -> SubroutineFnWrappe Subroutine.__module__ = "pyteal" -def evaluate_subroutine(subroutine: SubroutineDefinition) -> SubroutineDeclaration: +@dataclass +class SubroutineEval: """ Puts together the data necessary to define the code for a subroutine. "evaluate" is used here to connote evaluating the PyTEAL AST into a SubroutineDeclaration, but not actually placing it at call locations. The trickiest part here is managing the subroutine's arguments. The arguments are needed for two different code-paths, and there are 2 different argument types to consider - for each of the code-paths: + for each of the code-paths. 2 Argument Usages / Code-Paths - -------- ------ ---------- @@ -767,7 +836,7 @@ def evaluate_subroutine(subroutine: SubroutineDefinition) -> SubroutineDeclarati In both usage cases, we need to handle - 2 Argument Types + 4 Argument Types - -------- ----- Type 1 (by-value): these have python type Expr Type 2 (by-reference): these have python type ScratchVar @@ -775,6 +844,11 @@ def evaluate_subroutine(subroutine: SubroutineDefinition) -> SubroutineDeclarati Type 4 (ABI-output-arg): ABI typed variables with scratch space, a new ABI instance is generated inside function body, not one of the cases in the previous three options + Because of the introduction of frame pointer, the "argumentVars" and "loadedArgs" are different before and after program version 8. + + "argumentVars" and "loadedArgs" before version 8 (frame pointer version) + -------------- --- ------------ ------ ------- - ----------------------- + Usage (A) "argumentVars" - Storing pre-placed stack variables into local scratch space: Type 1. (by-value) use ScratchVar.store() to pick the actual value into a local scratch space Type 2. (by-reference) ALSO use ScratchVar.store() to pick up from the stack @@ -789,10 +863,38 @@ def evaluate_subroutine(subroutine: SubroutineDefinition) -> SubroutineDeclarati Type 3. (ABI) use abi_value itself after storing stack value into scratch space. Type 4. (ABI-output-arg) generates a new instance of the ABI value, and appends a return expression of stored value of the ABI keyword value. + + "argumentVars" and "loadedArgs" after version 8 (frame pointer version) + -------------- --- ------------ ----- ------- - ----------------------- + + Usage (A) "argumentVars" - Storing pre-placed stack variables with frame pointer: + Type 1. (by-value) use None for we can load from stack with FrameDig() from FrameVar abstraction + Type 2. (by-reference) use FrameDig() from FrameVar abstraction to pick up from the stack + NOTE: SubroutineCall.__teal__() has placed the _SLOT INDEX_ on the stack so this is stored into the local scratch space + Type 3. (ABI) use None for we can load from stack with FrameDig() from FrameVar abstraction + NOTE: SubroutineCall.__teal__() has placed the ABI encoding on the stack, so ABI set and get methods are working over stack + Type 4. (ABI-output-arg) it is not really used here, but we use FrameDig/Bury to interact with it + + Usage (B) "loadedArgs" - Passing through to an invoked PyTEAL subroutine AST: + Type 1. (by-value) use FrameDig() from FrameVar abstraction, to have an Expr that can be compiled in python by the PyTEAL subroutine. + Type 2. (by-reference) use a DynamicScratchVar as the user will have written the PyTEAL in a way that satisfies + the ScratchVar API. I.e., the user will write `x.load()` and `x.store(val)` as opposed to just `x`. + Type 3. (ABI) use abi_value that interface with stack data through FrameVar abstraction. + Type 4. (ABI-output-arg) Prepare a FrameVar over the stack with frame-index 0 against current frame pointer, + and set the ABI value's _stored_value to be using FrameVar. """ - def var_n_loaded( + var_n_loaded_method: Callable[ + [SubroutineDefinition, str, Optional[Proto]], + tuple[Optional[ScratchVar], ScratchVar | abi.BaseType | Expr], + ] + use_frame_pt: bool = False + + @staticmethod + def var_n_loaded_scratch( + subroutine: SubroutineDefinition, param: str, + _: Optional[Proto] = None, ) -> tuple[ScratchVar, ScratchVar | abi.BaseType | Expr]: loaded_var: ScratchVar | abi.BaseType | Expr argument_var: ScratchVar @@ -810,53 +912,146 @@ def var_n_loaded( return argument_var, loaded_var - if len(subroutine.output_kwarg) > 1: - raise TealInputError( - f"ABI keyword argument num: {len(subroutine.output_kwarg)}. " - f"Exceeding abi output keyword argument max number 1." - ) + @staticmethod + def var_n_loaded_fp( + subroutine: SubroutineDefinition, + param: str, + proto: Optional[Proto], + ) -> tuple[Optional[ScratchVar], ScratchVar | abi.BaseType | Expr]: + if not proto: + raise TealInternalError( + "proto should be available for frame pointer based subroutine." + ) + + loaded_var: ScratchVar | abi.BaseType | Expr + argument_var: Optional[ScratchVar] + + if param in subroutine.by_ref_args: + argument_var = DynamicScratchVar(TealType.anytype) + loaded_var = argument_var + elif param in subroutine.abi_args: + internal_abi_var = subroutine.abi_args[param].new_instance() + dig_index = ( + subroutine.arguments().index(param) - subroutine.argument_count() + ) + internal_abi_var._stored_value = FrameVar(proto, dig_index) + argument_var = None + loaded_var = internal_abi_var + else: + dig_index = ( + subroutine.arguments().index(param) - subroutine.argument_count() + ) + argument_var = None + loaded_var = FrameVar(proto, dig_index).load() - args = subroutine.arguments() + return argument_var, loaded_var - arg_vars: list[ScratchVar] = [] - loaded_args: list[ScratchVar | Expr | abi.BaseType] = [] - for arg in args: - arg_var, loaded_arg = var_n_loaded(arg) - arg_vars.append(arg_var) - loaded_args.append(loaded_arg) + @staticmethod + def __proto(subroutine: SubroutineDefinition) -> Proto: + arg_stack_types: list[TealType] = [] + for t in subroutine.expected_arg_types: + if t is Expr: + arg_stack_types.append(TealType.anytype) + elif t is ScratchVar: + arg_stack_types.append(TealType.uint64) + else: + arg_stack_types.append(cast(abi.TypeSpec, t).storage_type()) - abi_output_kwargs: dict[str, abi.BaseType] = {} - output_kwarg_info = OutputKwArgInfo.from_dict(subroutine.output_kwarg) - output_carrying_abi: Optional[abi.BaseType] = None + num_return_allocs: int = int(subroutine.has_abi_output) - if output_kwarg_info: - output_carrying_abi = output_kwarg_info.abi_type.new_instance() - abi_output_kwargs[output_kwarg_info.name] = output_carrying_abi + local_stack_types: list[TealType] = [] + if subroutine.has_abi_output: + output_info = cast( + OutputKwArgInfo, OutputKwArgInfo.from_dict(subroutine.output_kwarg) + ) + local_stack_types = [output_info.abi_type.storage_type()] - # Arg usage "B" supplied to build an AST from the user-defined PyTEAL function: - subroutine_body = subroutine.implementation(*loaded_args, **abi_output_kwargs) + layout: ProtoStackLayout = ProtoStackLayout( + arg_stack_types, local_stack_types, num_return_allocs + ) - if not isinstance(subroutine_body, Expr): - raise TealInputError( - f"Subroutine function does not return a PyTeal expression. Got type {type(subroutine_body)}." + # if subroutine do not have abi output, then only two cases happen: + # - subroutine is a normal subroutine, then check subroutine body evaluates to something, rather than none + # - subroutine is an ABIReturnSubroutine, the type is void, and its subroutine body type of is always none + num_stack_outputs: int = ( + 1 + if subroutine.has_abi_output + else int(subroutine.return_type != TealType.none) ) - deferred_expr: Optional[Expr] = None + return Proto(subroutine.argument_count(), num_stack_outputs, mem_layout=layout) - # if there is an output keyword argument for ABI, place the storing on the stack - if output_carrying_abi: - if subroutine_body.type_of() != TealType.none: + def __call__(self, subroutine: SubroutineDefinition) -> SubroutineDeclaration: + proto = self.__proto(subroutine) + + args = subroutine.arguments() + arg_var_n_frame_index_pairs: list[tuple[ScratchVar, int]] = [] + loaded_args: list[ScratchVar | Expr | abi.BaseType] = [] + for index, arg in enumerate(args): + arg_var, loaded_arg = self.var_n_loaded_method(subroutine, arg, proto) + if arg_var: + arg_var_n_frame_index_pairs.append( + (arg_var, index - subroutine.argument_count()) + ) + loaded_args.append(loaded_arg) + + abi_output_kwargs: dict[str, abi.BaseType] = {} + output_kwarg_info = OutputKwArgInfo.from_dict(subroutine.output_kwarg) + output_carrying_abi: Optional[abi.BaseType] = None + + if output_kwarg_info: + output_carrying_abi = output_kwarg_info.abi_type.new_instance() + if self.use_frame_pt: + output_carrying_abi._stored_value = FrameVar(proto, 0) + abi_output_kwargs[output_kwarg_info.name] = output_carrying_abi + + # Arg usage "B" supplied to build an AST from the user-defined PyTEAL function: + subroutine_body = subroutine.implementation(*loaded_args, **abi_output_kwargs) + if not isinstance(subroutine_body, Expr): raise TealInputError( - f"ABI returning subroutine definition should evaluate to TealType.none, " - f"while evaluate to {subroutine_body.type_of()}." + f"Subroutine function does not return a PyTeal expression. Got type {type(subroutine_body)}." ) - deferred_expr = output_carrying_abi._stored_value.load() - # Arg usage "A" to be pick up and store in scratch parameters that have been placed on the stack - # need to reverse order of argumentVars because the last argument will be on top of the stack - body_ops = [var.slot.store() for var in arg_vars[::-1]] - body_ops.append(subroutine_body) + deferred_expr: Optional[Expr] = None + + # if there is an output keyword argument for ABI + # place the storing on the stack with deferred expr only when compile to scratch var + if output_carrying_abi: + if subroutine_body.type_of() != TealType.none: + raise TealInputError( + f"ABI returning subroutine definition should evaluate to TealType.none, " + f"while evaluate to {subroutine_body.type_of()}." + ) + if not self.use_frame_pt: + deferred_expr = output_carrying_abi._stored_value.load() + + # Arg usage "A" to be pick up and store in scratch parameters that have been placed on the stack + # need to reverse order of argumentVars because the last argument will be on top of the stack + + body_ops: list[Expr] + if not self.use_frame_pt: + body_ops = [ + var.slot.store() for var, _ in arg_var_n_frame_index_pairs[::-1] + ] + else: + body_ops = [proto] + body_ops += [ + var.slot.store(FrameVar(proto, index).load()) + for var, index in arg_var_n_frame_index_pairs[::-1] + ] + + body_ops.append(subroutine_body) + sd = SubroutineDeclaration(subroutine, Seq(body_ops), deferred_expr) + sd.trace = subroutine_body.trace + return sd + + @classmethod + def normal_evaluator(cls) -> "SubroutineEval": + return cls(SubroutineEval.var_n_loaded_scratch, False) + + @classmethod + def fp_evaluator(cls) -> "SubroutineEval": + return cls(SubroutineEval.var_n_loaded_fp, True) + - sd = SubroutineDeclaration(subroutine, Seq(body_ops), deferred_expr) - sd.trace = subroutine_body.trace - return sd +SubroutineEval.__module__ = "pyteal" diff --git a/pyteal/ast/subroutine_test.py b/pyteal/ast/subroutine_test.py index c7b7df03a..32c426b09 100644 --- a/pyteal/ast/subroutine_test.py +++ b/pyteal/ast/subroutine_test.py @@ -1,13 +1,17 @@ from itertools import product -from typing import List, Literal, Optional, cast +from typing import Callable, Literal, Optional, cast +from inspect import signature import pytest from dataclasses import dataclass import pyteal as pt -from pyteal.ast.subroutine import ABIReturnSubroutine, evaluate_subroutine +from pyteal.ast.frame import Proto +from pyteal.ast.subroutine import ABIReturnSubroutine, SubroutineEval +from pyteal.compiler.compiler import FRAME_POINTER_VERSION options = pt.CompileOptions(version=5) +options_v8 = pt.CompileOptions(version=8) def test_subroutine_definition(): @@ -1138,169 +1142,205 @@ def mySubroutine(a): mySubroutine(a=pt.Int(1)) -def test_evaluate_subroutine_no_args(): - cases = ( - (pt.TealType.none, pt.Return()), - (pt.TealType.uint64, pt.Int(1) + pt.Int(2)), - (pt.TealType.uint64, pt.Return(pt.Int(1) + pt.Int(2))), - (pt.TealType.bytes, pt.Bytes("value")), - (pt.TealType.bytes, pt.Return(pt.Bytes("value"))), - ) +SUBROUTINE_VAR_ARGS_CASES = [ + (pt.TealType.none, pt.Return()), + (pt.TealType.uint64, pt.Int(1) + pt.Int(2)), + (pt.TealType.uint64, pt.Return(pt.Int(1) + pt.Int(2))), + (pt.TealType.bytes, pt.Bytes("value")), + (pt.TealType.bytes, pt.Return(pt.Bytes("value"))), +] - for (returnType, returnValue) in cases: - def mySubroutine(): - return returnValue +@pytest.mark.parametrize("return_type, return_value", SUBROUTINE_VAR_ARGS_CASES) +def test_evaluate_subroutine_no_args(return_type: pt.TealType, return_value: pt.Expr): + def mySubroutine(): + return return_value - definition = pt.SubroutineDefinition(mySubroutine, returnType) - declaration = evaluate_subroutine(definition) + definition = pt.SubroutineDefinition(mySubroutine, return_type) + evaluate_subroutine = SubroutineEval.normal_evaluator() - assert isinstance(declaration, pt.SubroutineDeclaration) - assert declaration.subroutine is definition + declaration = evaluate_subroutine(definition) - assert declaration.type_of() == returnValue.type_of() - assert declaration.has_return() == returnValue.has_return() + assert isinstance(declaration, pt.SubroutineDeclaration) + assert declaration.subroutine is definition - options.setSubroutine(definition) - expected, _ = pt.Seq([returnValue]).__teal__(options) + assert declaration.type_of() == return_value.type_of() + assert declaration.has_return() == return_value.has_return() - actual, _ = declaration.__teal__(options) - options.setSubroutine(None) - assert actual == expected + options.setSubroutine(definition) + expected, _ = pt.Seq([return_value]).__teal__(options) + actual, _ = declaration.__teal__(options) + options.setSubroutine(None) + assert actual == expected -def test_evaluate_subroutine_1_arg(): - cases = ( - (pt.TealType.none, pt.Return()), - (pt.TealType.uint64, pt.Int(1) + pt.Int(2)), - (pt.TealType.uint64, pt.Return(pt.Int(1) + pt.Int(2))), - (pt.TealType.bytes, pt.Bytes("value")), - (pt.TealType.bytes, pt.Return(pt.Bytes("value"))), - ) - for (returnType, returnValue) in cases: - argSlots: List[pt.ScratchSlot] = [] +@pytest.mark.parametrize("return_type, return_value", SUBROUTINE_VAR_ARGS_CASES) +def test_evaluate_subroutine_1_arg(return_type: pt.TealType, return_value: pt.Expr): + argSlots: list[pt.ScratchSlot] = [] - def mySubroutine(a1): - assert isinstance(a1, pt.ScratchLoad) - argSlots.append(a1.slot) - return returnValue + def mySubroutine(a1): + assert isinstance(a1, pt.ScratchLoad) + argSlots.append(a1.slot) + return return_value - definition = pt.SubroutineDefinition(mySubroutine, returnType) - declaration = evaluate_subroutine(definition) + definition = pt.SubroutineDefinition(mySubroutine, return_type) - assert isinstance(declaration, pt.SubroutineDeclaration) - assert declaration.subroutine is definition + evaluate_subroutine = SubroutineEval.normal_evaluator() + declaration = evaluate_subroutine(definition) - assert declaration.type_of() == returnValue.type_of() - assert declaration.has_return() == returnValue.has_return() + assert isinstance(declaration, pt.SubroutineDeclaration) + assert declaration.subroutine is definition - assert isinstance(declaration.body, pt.Seq) - assert len(declaration.body.args) == 2 + assert declaration.type_of() == return_value.type_of() + assert declaration.has_return() == return_value.has_return() - assert isinstance(declaration.body.args[0], pt.ScratchStackStore) + assert isinstance(declaration.body, pt.Seq) + assert len(declaration.body.args) == 2 - assert declaration.body.args[0].slot is argSlots[-1] + assert isinstance(declaration.body.args[0], pt.ScratchStackStore) - options.setSubroutine(definition) - expected, _ = pt.Seq([declaration.body.args[0], returnValue]).__teal__(options) + assert declaration.body.args[0].slot is argSlots[-1] - actual, _ = declaration.__teal__(options) - options.setSubroutine(None) - assert actual == expected + options.setSubroutine(definition) + expected, _ = pt.Seq([declaration.body.args[0], return_value]).__teal__(options) + actual, _ = declaration.__teal__(options) + options.setSubroutine(None) + assert actual == expected -def test_evaluate_subroutine_2_args(): - cases = ( - (pt.TealType.none, pt.Return()), - (pt.TealType.uint64, pt.Int(1) + pt.Int(2)), - (pt.TealType.uint64, pt.Return(pt.Int(1) + pt.Int(2))), - (pt.TealType.bytes, pt.Bytes("value")), - (pt.TealType.bytes, pt.Return(pt.Bytes("value"))), - ) - for (returnType, returnValue) in cases: - argSlots: List[pt.ScratchSlot] = [] +@pytest.mark.parametrize("return_type, return_value", SUBROUTINE_VAR_ARGS_CASES) +def test_evaluate_subroutine_2_args(return_type: pt.TealType, return_value: pt.Expr): + argSlots: list[pt.ScratchSlot] = [] - def mySubroutine(a1, a2): - assert isinstance(a1, pt.ScratchLoad) - argSlots.append(a1.slot) - assert isinstance(a2, pt.ScratchLoad) - argSlots.append(a2.slot) - return returnValue + def mySubroutine(a1, a2): + assert isinstance(a1, pt.ScratchLoad) + argSlots.append(a1.slot) + assert isinstance(a2, pt.ScratchLoad) + argSlots.append(a2.slot) + return return_value - definition = pt.SubroutineDefinition(mySubroutine, returnType) + definition = pt.SubroutineDefinition(mySubroutine, return_type) - declaration = evaluate_subroutine(definition) + evaluate_subroutine = SubroutineEval.normal_evaluator() + declaration = evaluate_subroutine(definition) - assert isinstance(declaration, pt.SubroutineDeclaration) - assert declaration.subroutine is definition + assert isinstance(declaration, pt.SubroutineDeclaration) + assert declaration.subroutine is definition - assert declaration.type_of() == returnValue.type_of() - assert declaration.has_return() == returnValue.has_return() + assert declaration.type_of() == return_value.type_of() + assert declaration.has_return() == return_value.has_return() - assert isinstance(declaration.body, pt.Seq) - assert len(declaration.body.args) == 3 + assert isinstance(declaration.body, pt.Seq) + assert len(declaration.body.args) == 3 - assert isinstance(declaration.body.args[0], pt.ScratchStackStore) - assert isinstance(declaration.body.args[1], pt.ScratchStackStore) + assert isinstance(declaration.body.args[0], pt.ScratchStackStore) + assert isinstance(declaration.body.args[1], pt.ScratchStackStore) - assert declaration.body.args[0].slot is argSlots[-1] - assert declaration.body.args[1].slot is argSlots[-2] + assert declaration.body.args[0].slot is argSlots[-1] + assert declaration.body.args[1].slot is argSlots[-2] - options.setSubroutine(definition) - expected, _ = pt.Seq( - [declaration.body.args[0], declaration.body.args[1], returnValue] - ).__teal__(options) + options.setSubroutine(definition) + expected, _ = pt.Seq( + [declaration.body.args[0], declaration.body.args[1], return_value] + ).__teal__(options) - actual, _ = declaration.__teal__(options) - options.setSubroutine(None) - assert actual == expected + actual, _ = declaration.__teal__(options) + options.setSubroutine(None) + assert actual == expected -def test_evaluate_subroutine_10_args(): - cases = ( - (pt.TealType.none, pt.Return()), - (pt.TealType.uint64, pt.Int(1) + pt.Int(2)), - (pt.TealType.uint64, pt.Return(pt.Int(1) + pt.Int(2))), - (pt.TealType.bytes, pt.Bytes("value")), - (pt.TealType.bytes, pt.Return(pt.Bytes("value"))), - ) +@pytest.mark.parametrize("return_type, return_value", SUBROUTINE_VAR_ARGS_CASES) +def test_evaluate_subroutine_10_args(return_type: pt.TealType, return_value: pt.Expr): + argSlots: list[pt.ScratchSlot] = [] - for (returnType, returnValue) in cases: - argSlots: List[pt.ScratchSlot] = [] + def mySubroutine(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): + for a in (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): + assert isinstance(a, pt.ScratchLoad) + argSlots.append(a.slot) + return return_value - def mySubroutine(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): - for a in (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): - assert isinstance(a, pt.ScratchLoad) - argSlots.append(a.slot) - return returnValue + definition = pt.SubroutineDefinition(mySubroutine, return_type) + + evaluate_subroutine = SubroutineEval.normal_evaluator() + declaration = evaluate_subroutine(definition) + + assert isinstance(declaration, pt.SubroutineDeclaration) + assert declaration.subroutine is definition + + assert declaration.type_of() == return_value.type_of() + assert declaration.has_return() == return_value.has_return() + + assert isinstance(declaration.body, pt.Seq) + assert len(declaration.body.args) == 11 + + for i in range(10): + assert isinstance(declaration.body.args[i], pt.ScratchStackStore) + + for i in range(10): + assert declaration.body.args[i].slot is argSlots[-i - 1] + + options.setSubroutine(definition) + expected, _ = pt.Seq(declaration.body.args[:10] + [return_value]).__teal__(options) + + actual, _ = declaration.__teal__(options) + options.setSubroutine(None) + assert actual == expected + + +@pytest.mark.parametrize("return_type, return_value", SUBROUTINE_VAR_ARGS_CASES) +def test_evaluate_subroutine_frame_pt_version( + return_type: pt.TealType, return_value: pt.Expr +): + def mySubroutine_no_arg(): + return return_value + + def mySubroutine_arg_1(a1): + return return_value + + def mySubroutine_arg_2(a1, a2): + return return_value + + def mySubroutine_arg_10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10): + return return_value + + for subr in [ + mySubroutine_no_arg, + mySubroutine_arg_1, + mySubroutine_arg_2, + mySubroutine_arg_10, + ]: + subr = cast(Callable[..., pt.Expr], subr) + definition = pt.SubroutineDefinition(subr, return_type) + evaluate_subroutine = SubroutineEval.fp_evaluator() - definition = pt.SubroutineDefinition(mySubroutine, returnType) declaration = evaluate_subroutine(definition) assert isinstance(declaration, pt.SubroutineDeclaration) assert declaration.subroutine is definition - assert declaration.type_of() == returnValue.type_of() - assert declaration.has_return() == returnValue.has_return() + assert declaration.type_of() == return_value.type_of() + assert declaration.has_return() == return_value.has_return() assert isinstance(declaration.body, pt.Seq) - assert len(declaration.body.args) == 11 + assert len(declaration.body.args) == 2 + + assert isinstance(declaration.body.args[0], Proto) - for i in range(10): - assert isinstance(declaration.body.args[i], pt.ScratchStackStore) + proto_expr = declaration.body.args[0] + assert proto_expr.num_returns == int(return_type != pt.TealType.none) + assert proto_expr.num_args == len(signature(subr).parameters) - for i in range(10): - assert declaration.body.args[i].slot is argSlots[-i - 1] + assert isinstance(declaration.body.args[1], type(return_value)) - options.setSubroutine(definition) - expected, _ = pt.Seq(declaration.body.args[:10] + [returnValue]).__teal__( - options + options_v8.setSubroutine(definition) + expected, _ = pt.Seq([declaration.body.args[0], return_value]).__teal__( + options_v8 ) - actual, _ = declaration.__teal__(options) - options.setSubroutine(None) + actual, _ = declaration.__teal__(options_v8) + options_v8.setSubroutine(None) assert actual == expected @@ -1505,3 +1545,9 @@ def abi_meth_2(a: pt.abi.Uint64, b: pt.abi.Uint64, *, output: pt.abi.Uint64): mspec = abi_meth_2.method_spec().dictify() assert mspec["name"] == "overriden_add" + + +def test_frame_option_version_range_well_formed(): + assert ( + pt.Op.callsub.min_version < FRAME_POINTER_VERSION < pt.MAX_PROGRAM_VERSION + 1 + ) diff --git a/pyteal/compiler/compiler.py b/pyteal/compiler/compiler.py index f2b25b489..dfbf44a83 100644 --- a/pyteal/compiler/compiler.py +++ b/pyteal/compiler/compiler.py @@ -46,10 +46,22 @@ def __init__( mode: Mode = Mode.Signature, version: int = DEFAULT_PROGRAM_VERSION, optimize: OptimizeOptions = None, + frame_pointers: Optional[bool] = None, ) -> None: self.mode = mode self.version = version self.optimize = optimize if optimize is not None else OptimizeOptions() + self.use_frame_pointer: bool + + if frame_pointers is None: + self.use_frame_pointer = self.version >= FRAME_POINTER_VERSION + else: + if frame_pointers and self.version < FRAME_POINTER_VERSION: + raise TealInputError( + f"Try to use frame pointer with an insufficient version {self.version}." + ) + else: + self.use_frame_pointer = frame_pointers self.currentSubroutine: Optional[SubroutineDefinition] = None @@ -154,11 +166,18 @@ def compileSubroutine( start.validateTree() if ( - currentSubroutine is not None - and currentSubroutine.get_declaration().deferred_expr is not None + currentSubroutine + and currentSubroutine.get_declaration_by_option( + options.use_frame_pointer + ).deferred_expr ): # this represents code that should be inserted before each retsub op - deferred_expr = cast(Expr, currentSubroutine.get_declaration().deferred_expr) + deferred_expr = cast( + Expr, + currentSubroutine.get_declaration_by_option( + options.use_frame_pointer + ).deferred_expr, + ) for block in TealBlock.Iterate(start): if not any(op.getOp() == Op.retsub for op in block.ops): @@ -209,7 +228,7 @@ def compileSubroutine( newSubroutines = referencedSubroutines - subroutine_start_blocks.keys() for subroutine in sorted(newSubroutines, key=lambda subroutine: subroutine.id): compileSubroutine( - subroutine.get_declaration(), + subroutine.get_declaration_by_option(options.use_frame_pointer), options, subroutineGraph, subroutine_start_blocks, @@ -238,6 +257,7 @@ def compileTeal( version: int = DEFAULT_PROGRAM_VERSION, assembleConstants: bool = False, optimize: OptimizeOptions = None, + frame_pointers: Optional[bool] = None, ) -> str: """Compile a PyTeal expression into TEAL assembly. @@ -271,7 +291,9 @@ def compileTeal( ) ) - options = CompileOptions(mode=mode, version=version, optimize=optimize) + options = CompileOptions( + mode=mode, version=version, optimize=optimize, frame_pointers=frame_pointers + ) subroutineGraph: Dict[SubroutineDefinition, Set[SubroutineDefinition]] = dict() subroutine_start_blocks: Dict[Optional[SubroutineDefinition], TealBlock] = dict() @@ -311,9 +333,7 @@ def compileTeal( if assembleConstants: if version < 3: raise TealInternalError( - "The minimum program version required to enable assembleConstants is 3. The current version is {}".format( - version - ) + f"The minimum program version required to enable assembleConstants is 3. The current version is {version}." ) teal = createConstantBlocks(teal) diff --git a/pyteal/compiler/compiler_test.py b/pyteal/compiler/compiler_test.py index 3016b8254..d4852bd73 100644 --- a/pyteal/compiler/compiler_test.py +++ b/pyteal/compiler/compiler_test.py @@ -2347,6 +2347,13 @@ def approve_if_odd(condition_encoding: pt.abi.Uint32) -> pt.Expr: clear_state=pt.OnCompleteAction.call_only(pt.Approve()), ) + with pytest.raises(pt.TealInputError) as e: + pt.Router("will-error", on_completion_actions).compile_program( + version=6, frame_pointers=True + ) + + assert "Try to use frame pointer with an insufficient version 6" in str(e) + _router_with_oc = pt.Router( "ASimpleQuestionablyRobustContract", on_completion_actions ) diff --git a/tests/abi_roundtrip.py b/tests/abi_roundtrip.py index efde3ecd3..d4801f7d5 100644 --- a/tests/abi_roundtrip.py +++ b/tests/abi_roundtrip.py @@ -1,4 +1,4 @@ -from typing import Generic, TypeVar +from typing import Generic, TypeVar, Optional import pyteal as pt from pyteal import abi @@ -14,13 +14,13 @@ class ABIRoundtrip(Generic[T]): def __init__( self, annotation_instance: abi.BaseType, - length: int | None = None, + length: Optional[int] = None, ): self.instance: abi.BaseType = annotation_instance self.type_spec: abi.TypeSpec = annotation_instance.type_spec() self.annotation: type[abi.BaseType] = self.type_spec.annotation_type() - self.length: int | None = length + self.length: Optional[int] = length def pytealer(self) -> PyTealDryRunExecutor: roundtrip = self.roundtrip_factory() @@ -120,11 +120,12 @@ def array_comp_factory(self) -> pt.ABIReturnSubroutine: When the length has not been provided for a dynamic array, default to DEFAULT_DYNAMIC_ARRAY_LENGTH """ - if self.length is not None: - assert self.type_spec.is_length_dynamic() # type: ignore[attr-defined] - elif not self.type_spec.is_length_dynamic(): # type: ignore[attr-defined] - self.length = self.type_spec.length_static() # type: ignore[attr-defined] - else: + if not self.type_spec.is_length_dynamic(): # type: ignore[attr-defined] + if self.length is not None: + assert self.length == self.type_spec.length_static() # type: ignore[attr-defined] + else: + self.length = self.type_spec.length_static() # type: ignore[attr-defined] + elif self.length is None: self.length = DEFAULT_DYNAMIC_ARRAY_LENGTH internal_type_spec = self.type_spec.value_type_spec() # type: ignore[attr-defined] diff --git a/tests/integration/abi_roundtrip_test.py b/tests/integration/abi_roundtrip_test.py index c70e3ad4b..849d632ed 100644 --- a/tests/integration/abi_roundtrip_test.py +++ b/tests/integration/abi_roundtrip_test.py @@ -209,21 +209,25 @@ def test_pure_compilation(abi_type): assert [sdk_abi_type] == abi_arg_types assert algosdk.abi.TupleType([sdk_abi_type] * 3) == abi_ret_type - teal = roundtripper.compile(version=6) + def compile_and_compare(version: int): + teal = roundtripper.compile(version) - filename = ( - f"app_roundtrip_{sdk_abi_type}" - + ("" if dynamic_length is None else f"_{dynamic_length}") - + ".teal" - ) - tealdir = GENERATED / "roundtrip" - tealdir.mkdir(parents=True, exist_ok=True) + filename = ( + f"app_roundtrip_{sdk_abi_type}" + + ("" if dynamic_length is None else f"_{dynamic_length}") + + f"_v{version}.teal" + ) + tealdir = GENERATED / "roundtrip" + tealdir.mkdir(parents=True, exist_ok=True) + + save_to = tealdir / filename + with open(save_to, "w") as f: + f.write(teal) - save_to = tealdir / filename - with open(save_to, "w") as f: - f.write(teal) + assert_teal_as_expected(save_to, FIXTURES / "roundtrip" / filename) - assert_teal_as_expected(save_to, FIXTURES / "roundtrip" / filename) + compile_and_compare(6) + compile_and_compare(8) @pytest.mark.parametrize("abi_type", ABI_TYPES) @@ -251,14 +255,17 @@ def test_roundtrip(abi_type): abi_strat = RandomABIStrategy(sdk_abi_types[0], dynamic_length=dynamic_length) rand_abi_instance = abi_strat.get() args = (rand_abi_instance,) - inspector = roundtripper.dryrun(args) - cost = inspector.cost() - passed = inspector.passed() - original, mut, mut_mut = inspector.last_log() + def dryrun_roundtrip(version: int): + inspector = roundtripper.dryrun(args, compiler_version=version) - print( - f""" + cost = inspector.cost() + passed = inspector.passed() + original, mut, mut_mut = inspector.last_log() + + print( + f""" +version={version} {abi_type=} {sdk_abi_str=} {dynamic_length=} @@ -270,21 +277,24 @@ def test_roundtrip(abi_type): {mut=} {mut_mut=} """ - ) - - last_steps = 2 - - assert passed == (cost <= 700), inspector.report( - args, f"passed={passed} contradicted cost={cost}", last_steps=last_steps - ) - assert rand_abi_instance == original, inspector.report( - args, "rand_abi_instance v. original", last_steps=last_steps - ) - assert original == mut_mut, inspector.report( - args, "orginal v. mut_mut", last_steps=last_steps - ) - - expected_mut = abi_strat.mutate_for_roundtrip(rand_abi_instance) - assert expected_mut == mut, inspector.report( - args, "expected_mut v. mut", last_steps=last_steps - ) + ) + + last_steps = 2 + + assert passed == (cost <= 700), inspector.report( + args, f"passed={passed} contradicted cost={cost}", last_steps=last_steps + ) + assert rand_abi_instance == original, inspector.report( + args, "rand_abi_instance v. original", last_steps=last_steps + ) + assert original == mut_mut, inspector.report( + args, "orginal v. mut_mut", last_steps=last_steps + ) + + expected_mut = abi_strat.mutate_for_roundtrip(rand_abi_instance) + assert expected_mut == mut, inspector.report( + args, "expected_mut v. mut", last_steps=last_steps + ) + + dryrun_roundtrip(6) + dryrun_roundtrip(8) diff --git a/tests/integration/graviton_abi_test.py b/tests/integration/graviton_abi_test.py index 229b7a671..0806ee96e 100644 --- a/tests/integration/graviton_abi_test.py +++ b/tests/integration/graviton_abi_test.py @@ -1,4 +1,5 @@ import random +import pytest from graviton.blackbox import DryRunInspector @@ -15,8 +16,8 @@ """ -WARNING: The following ABI types Int65 and Complex130 are ONLY for the purpose of testing/demo'ing -ABISubroutine and graviton ABI capabilities and are NOT the recommended approach for +WARNING: The following ABI types Int65 and Complex130 are ONLY for the purpose of testing/demo'ing +ABISubroutine and graviton ABI capabilities and are NOT the recommended approach for implementing integers and complex integers. A better approach would likely leverage `Uint64` (if any ABI type at all) and make use of 2's complement arithmetic. @@ -299,7 +300,8 @@ def conditional_factorial(_factor: pt.abi.Uint64, *, output: pt.abi.Uint64) -> p # ---- integration test functions ---- # -def test_integer65(): +@pytest.mark.parametrize("version", [6, 8]) +def test_integer65(version: int): bbpt_subtract_slick = PyTealDryRunExecutor(int65_sub, pt.Mode.Application) bbpt_subtract_cond = PyTealDryRunExecutor(int65_minus_cond, pt.Mode.Application) @@ -329,7 +331,7 @@ def pytuple_to_num(t): ] def binary_dryrun(p: PyTealDryRunExecutor) -> list[DryRunInspector]: - return p.dryrun_on_sequence(binary_inputs) + return p.dryrun_on_sequence(binary_inputs, compiler_version=version) # type: ignore # Binary: inspectors_subtract_slick = binary_dryrun(bbpt_subtract_slick) @@ -341,7 +343,9 @@ def binary_dryrun(p: PyTealDryRunExecutor) -> list[DryRunInspector]: inspectors_add = binary_dryrun(bbpt_add) # Unary: - inspectors_negate = bbpt_negate.dryrun_on_sequence(unary_inputs) + inspectors_negate = bbpt_negate.dryrun_on_sequence( + unary_inputs, compiler_version=version # type: ignore + ) for i in range(N): binary_args = binary_inputs[i] @@ -382,7 +386,8 @@ def binary_dryrun(p: PyTealDryRunExecutor) -> list[DryRunInspector]: ), inspector_negate.report(unary_args, f"failed for {unary_args}", row=i) -def test_complex130(): +@pytest.mark.parametrize("version", [6, 8]) +def test_complex130(version: int): # Binary: bbpt_cplx_add = PyTealDryRunExecutor(complex130_add, pt.Mode.Application) @@ -439,16 +444,16 @@ def pytuple_to_complex(tt): # Binary: def binary_dryrun(p: PyTealDryRunExecutor) -> list[DryRunInspector]: - return p.dryrun_on_sequence(binary_inputs) + return p.dryrun_on_sequence(binary_inputs, compiler_version=version) # type: ignore + + # Unary: + def unary_dryrun(p: PyTealDryRunExecutor) -> list[DryRunInspector]: + return p.dryrun_on_sequence(unary_inputs, compiler_version=version) # type: ignore inspectors_cplx_add = binary_dryrun(bbpt_cplx_add) inspectors_cplx_mult = binary_dryrun(bbpt_cplx_mult) - # Unary: - def unary_dryrun(p: PyTealDryRunExecutor) -> list[DryRunInspector]: - return p.dryrun_on_sequence(unary_inputs) - inspectors_cplx_real = unary_dryrun(bbpt_complex_real) inspectors_cplx_imag = unary_dryrun(bbpt_complex_imag) @@ -513,10 +518,12 @@ def py_factorial(n): return 1 if n <= 1 else n * py_factorial(n - 1) -def test_conditional_factorial(): +@pytest.mark.parametrize("version", [6, 8]) +def test_conditional_factorial(version: int): ptdre = PyTealDryRunExecutor(conditional_factorial, pt.Mode.Application) inputs = [(n,) for n in range(20)] - inspectors = ptdre.dryrun_on_sequence(inputs) + + inspectors = ptdre.dryrun_on_sequence(inputs, compiler_version=version) # type: ignore for i, args in enumerate(inputs): inspector = inspectors[i] n = args[0] diff --git a/tests/integration/graviton_test.py b/tests/integration/graviton_test.py index 50c3fdbd1..31f77bb04 100644 --- a/tests/integration/graviton_test.py +++ b/tests/integration/graviton_test.py @@ -42,7 +42,7 @@ def wrap_compile_and_save( is_app = mode == pt.Mode.Application teal = PyTealDryRunExecutor(subr, mode).compile(version, assemble_constants) - tealfile = f'{"app" if is_app else "lsig"}_{case_name}.teal' + tealfile = f'{"app" if is_app else "lsig"}_{case_name}_v{version}.teal' tealdir = GENERATED / test_name tealdir.mkdir(parents=True, exist_ok=True) @@ -519,7 +519,7 @@ def blackbox_test_runner( inspectors = list(map(lambda a: execute(algod, teal, a, exec_mode), inputs)) # 4. Statistical report: - csvpath = GENERATED / "blackbox" / f"{tealfile}.csv" + csvpath = GENERATED / "blackbox" / f"{tealfile}_v{version}.csv" with open(csvpath, "w") as f: f.write(DryRunInspector.csv_report(inputs, inspectors)) @@ -549,6 +549,7 @@ def test_blackbox_subroutines_as_apps( scenario: Dict[str, Any], ): blackbox_test_runner(subr, pt.Mode.Application, scenario, 6) + blackbox_test_runner(subr, pt.Mode.Application, scenario, 8) @pytest.mark.parametrize("subr, scenario", LOGICSIG_SCENARIOS.items()) @@ -557,6 +558,7 @@ def test_blackbox_subroutines_as_logic_sigs( scenario: Dict[str, Any], ): blackbox_test_runner(subr, pt.Mode.Signature, scenario, 6) + blackbox_test_runner(subr, pt.Mode.Signature, scenario, 8) def blackbox_pyteal_example1(): @@ -575,22 +577,30 @@ def square(x): x = 9 args = [x] - # evaluate the programs - app_result = PyTealDryRunExecutor(square, Mode.Application).dryrun(args) - lsig_result = PyTealDryRunExecutor(square, Mode.Signature).dryrun(args) + def evaluate_and_check(version: int): + # evaluate the programs + app_result = PyTealDryRunExecutor(square, Mode.Application).dryrun( + args, compiler_version=version + ) + lsig_result = PyTealDryRunExecutor(square, Mode.Signature).dryrun( + args, compiler_version=version + ) - # check to see that x^2 is at the top of the stack as expected - assert app_result.stack_top() == x**2, app_result.report( - args, "stack_top() gave unexpected results for app" - ) - assert lsig_result.stack_top() == x**2, lsig_result.report( - args, "stack_top() gave unexpected results for lsig" - ) + # check to see that x^2 is at the top of the stack as expected + assert app_result.stack_top() == x**2, app_result.report( + args, "stack_top() gave unexpected results for app" + ) + assert lsig_result.stack_top() == x**2, lsig_result.report( + args, "stack_top() gave unexpected results for lsig" + ) - # check to see that itob of x^2 has been logged (only for the app case) - assert app_result.last_log() == DryRunEncoder.hex(x**2), app_result.report( - args, "last_log() gave unexpected results from app" - ) + # check to see that itob of x^2 has been logged (only for the app case) + assert app_result.last_log() == DryRunEncoder.hex(x**2), app_result.report( + args, "last_log() gave unexpected results from app" + ) + + evaluate_and_check(6) + evaluate_and_check(8) def blackbox_pyteal_example2(): @@ -639,20 +649,24 @@ def euclid(x, y): ) ) - # assert that each result is that same as what Python's math.gcd() computes - inspectors = PyTealDryRunExecutor(euclid, Mode.Application).dryrun_on_sequence( - inputs - ) - for i, result in enumerate(inspectors): - args = inputs[i] - assert result.stack_top() == math.gcd(*args), result.report( - args, f"failed for {args}" + def test_and_report(version: int): + # assert that each result is that same as what Python's math.gcd() computes + inspectors = PyTealDryRunExecutor(euclid, Mode.Application).dryrun_on_sequence( + inputs, compiler_version=version ) + for i, result in enumerate(inspectors): + args = inputs[i] + assert result.stack_top() == math.gcd(*args), result.report( + args, f"failed for {args}" + ) - # save the CSV to ...current working directory.../euclid.csv - euclid_csv = DryRunInspector.csv_report(inputs, inspectors) - with open(Path.cwd() / "euclid.csv", "w") as f: - f.write(euclid_csv) + # save the CSV to ...current working directory.../euclid_v{version}.csv + euclid_csv = DryRunInspector.csv_report(inputs, inspectors) + with open(Path.cwd() / f"euclid_v{version}.csv", "w") as f: + f.write(euclid_csv) + + test_and_report(6) + test_and_report(8) def blackbox_pyteal_example3(): @@ -731,6 +745,15 @@ def euclid(x, y): for property, predicate in predicates.items(): Invariant(predicate).validates(property, inspectors) + # Execute on the input sequence to get a dry-run inspectors: + inspectors = PyTealDryRunExecutor(euclid, Mode.Application).dryrun_on_sequence( + inputs, compiler_version=8 + ) + + # Assert that each invariant holds on the sequences of inputs and dry-runs: + for property, predicate in predicates.items(): + Invariant(predicate).validates(property, inspectors) + def blackbox_pyteal_example4(): # Example 4: Using PyTealDryRunExecutor to debug an ABIReturnSubroutine with an app, logic sig and csv report @@ -786,47 +809,53 @@ def abi_sum(toSum: abi.DynamicArray[abi.Uint64], *, output: abi.Uint64) -> Expr: for n in range(N): inputs.append(tuple([random.sample(choices, n)])) - app_inspectors = app_pytealer.dryrun_on_sequence(inputs) + def test_and_report_for_app_and_lsig(_version: int): + app_inspectors = app_pytealer.dryrun_on_sequence( + inputs, compiler_version=_version + ) + lsig_inspectors = lsig_pytealer.dryrun_on_sequence( + inputs, compiler_version=_version + ) + for i in range(N): + args = inputs[i] - lsig_inspectors = lsig_pytealer.dryrun_on_sequence(inputs) + app_inspector = app_inspectors[i] + lsig_inspector = lsig_inspectors[i] - for i in range(N): - args = inputs[i] + def message(insp): + return insp.report(args, f"failed for {args}", row=i) - app_inspector = app_inspectors[i] - lsig_inspector = lsig_inspectors[i] + # the app should pass exactly when it's cost was within the 700 budget: + assert app_inspector.passed() == (app_inspector.cost() <= 700), message( + app_inspector + ) + # the lsig always passes (never goes over budget): + assert lsig_inspector.passed(), message(lsig_inspector) - def message(insp): - return insp.report(args, f"failed for {args}", row=i) + expected = sum(args[0]) + actual4app = app_inspector.last_log() + assert expected == actual4app, message(app_inspector) - # the app should pass exactly when it's cost was within the 700 budget: - assert app_inspector.passed() == (app_inspector.cost() <= 700), message( - app_inspector - ) - # the lsig always passes (never goes over budget): - assert lsig_inspector.passed(), message(lsig_inspector) + if i > 0: + assert expected in app_inspector.final_scratch().values(), message( + app_inspector + ) + assert expected in lsig_inspector.final_scratch().values(), message( + lsig_inspector + ) - expected = sum(args[0]) - actual4app = app_inspector.last_log() - assert expected == actual4app, message(app_inspector) + def report(kind): + assert kind in ("app", "lsig") + insps = app_inspectors if kind == "app" else lsig_inspectors + csv_report = DryRunInspector.csv_report(inputs, insps) + with open(Path.cwd() / f"abi_sum_{kind}_v{_version}.csv", "w") as f: + f.write(csv_report) - if i > 0: - assert expected in app_inspector.final_scratch().values(), message( - app_inspector - ) - assert expected in lsig_inspector.final_scratch().values(), message( - lsig_inspector - ) - - def report(kind): - assert kind in ("app", "lsig") - insps = app_inspectors if kind == "app" else lsig_inspectors - csv_report = DryRunInspector.csv_report(inputs, insps) - with open(Path.cwd() / f"abi_sum_{kind}.csv", "w") as f: - f.write(csv_report) + report("app") + report("lsig") - report("app") - report("lsig") + test_and_report_for_app_and_lsig(6) + test_and_report_for_app_and_lsig(8) def blackbox_pyteal_example5(): @@ -845,23 +874,31 @@ def cubed(n: abi.Uint64): inputs = [[i] for i in range(1, 11)] - app_inspect = app_pytealer.dryrun_on_sequence(inputs) - lsig_inspect = lsig_pytealer.dryrun_on_sequence(inputs) - - for index, inspect in enumerate(app_inspect): - input_var = inputs[index][0] - assert inspect.stack_top() == input_var**3, inspect.report( - args=inputs[index], msg="stack_top() gave unexpected results from app" - ) - assert inspect.last_log() == DryRunEncoder.hex(input_var**3), inspect.report( - args=inputs[index], msg="last_log() gave unexpected results from app" + def test_app_and_lsig(_version: int): + app_inspect = app_pytealer.dryrun_on_sequence(inputs, compiler_version=_version) + lsig_inspect = lsig_pytealer.dryrun_on_sequence( + inputs, compiler_version=_version ) - for index, inspect in enumerate(lsig_inspect): - input_var = inputs[index][0] - assert inspect.stack_top() == input_var**3, inspect.report( - args=inputs[index], msg="stack_top() gave unexpected results from app" - ) + for index, inspect in enumerate(app_inspect): + input_var = inputs[index][0] + assert inspect.stack_top() == input_var**3, inspect.report( + args=inputs[index], msg="stack_top() gave unexpected results from app" + ) + assert inspect.last_log() == DryRunEncoder.hex( + input_var**3 + ), inspect.report( + args=inputs[index], msg="last_log() gave unexpected results from app" + ) + + for index, inspect in enumerate(lsig_inspect): + input_var = inputs[index][0] + assert inspect.stack_top() == input_var**3, inspect.report( + args=inputs[index], msg="stack_top() gave unexpected results from app" + ) + + test_app_and_lsig(6) + test_app_and_lsig(8) def blackbox_pyteal_while_continue_test(): @@ -893,11 +930,21 @@ def while_continue_accumulation(n): Return(i.load()), ) + executor = PyTealDryRunExecutor(while_continue_accumulation, Mode.Signature) + for x in range(30): args = [x] - lsig_result = PyTealDryRunExecutor( - while_continue_accumulation, Mode.Signature - ).dryrun(args) + lsig_result = executor.dryrun(args) + if x == 0: + assert not lsig_result.passed() + else: + assert lsig_result.passed() + + assert lsig_result.stack_top() == x, lsig_result.report( + args, "stack_top() gave unexpected results for lsig" + ) + + lsig_result = executor.dryrun(args, compiler_version=8) if x == 0: assert not lsig_result.passed() else: @@ -967,6 +1014,10 @@ def named_tuple_field_access( assert inspector.stack_top() == 1 assert inspector.passed() + inspector = lsig_pytealer.dryrun(args, compiler_version=8) + assert inspector.passed() + assert inspector.stack_top() == 1 + @pytest.mark.parametrize( "example", diff --git a/tests/integration/teal/roundtrip/app_roundtrip_().teal b/tests/integration/teal/roundtrip/app_roundtrip_()_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_().teal rename to tests/integration/teal/roundtrip/app_roundtrip_()_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal new file mode 100644 index 000000000..d0ddb9ccf --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_()_v8.teal @@ -0,0 +1,38 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +byte "" +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 2 +load 2 +callsub tuplecomplement_0 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10].teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool)[10].teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal new file mode 100644 index 000000000..13296df67 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool)[10]_v8.teal @@ -0,0 +1,185 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_2 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +load 0 +callsub boolcomp_3 +store 0 +byte 0x00 +int 0 +load 0 +setbit +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 1 +extract3 +store 5 +frame_dig -1 +int 1 +int 1 +* +int 1 +extract3 +store 6 +frame_dig -1 +int 1 +int 2 +* +int 1 +extract3 +store 7 +frame_dig -1 +int 1 +int 3 +* +int 1 +extract3 +store 8 +frame_dig -1 +int 1 +int 4 +* +int 1 +extract3 +store 9 +frame_dig -1 +int 1 +int 5 +* +int 1 +extract3 +store 10 +frame_dig -1 +int 1 +int 6 +* +int 1 +extract3 +store 11 +frame_dig -1 +int 1 +int 7 +* +int 1 +extract3 +store 12 +frame_dig -1 +int 1 +int 8 +* +int 1 +extract3 +store 13 +frame_dig -1 +int 1 +int 9 +* +int 1 +extract3 +store 14 +load 5 +callsub tuplecomplement_0 +store 5 +load 6 +callsub tuplecomplement_0 +store 6 +load 7 +callsub tuplecomplement_0 +store 7 +load 8 +callsub tuplecomplement_0 +store 8 +load 9 +callsub tuplecomplement_0 +store 9 +load 10 +callsub tuplecomplement_0 +store 10 +load 11 +callsub tuplecomplement_0 +store 11 +load 12 +callsub tuplecomplement_0 +store 12 +load 13 +callsub tuplecomplement_0 +store 13 +load 14 +callsub tuplecomplement_0 +store 14 +load 5 +load 6 +concat +load 7 +concat +load 8 +concat +load 9 +concat +load 10 +concat +load 11 +concat +load 12 +concat +load 13 +concat +load 14 +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 3 +load 3 +callsub arraycomplement_1 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_3: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool).teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal new file mode 100644 index 000000000..72411884c --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool)_v8.teal @@ -0,0 +1,59 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_1 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +load 0 +callsub boolcomp_2 +store 0 +byte 0x00 +int 0 +load 0 +setbit +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 3 +load 3 +callsub tuplecomplement_0 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_2: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64).teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal new file mode 100644 index 000000000..1875b356a --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,address,(uint64,bool),byte[10],bool[4],uint64)_v8.teal @@ -0,0 +1,847 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 7 +load 7 +callsub roundtripper_1 +store 6 +byte 0x151f7c75 +load 6 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +frame_dig -1 +extract 1 32 +store 1 +frame_dig -1 +extract 33 9 +store 2 +frame_dig -1 +extract 42 10 +store 3 +frame_dig -1 +extract 52 1 +store 4 +frame_dig -1 +int 53 +extract_uint64 +store 5 +load 0 +callsub boolcomp_2 +store 0 +load 1 +callsub arraycomplement_4 +store 1 +load 2 +callsub tuplecomplement_5 +store 2 +load 3 +callsub arraycomplement_7 +store 3 +load 4 +callsub arraycomplement_9 +store 4 +load 5 +callsub numericalcomp_10 +store 5 +byte 0x00 +int 0 +load 0 +setbit +load 1 +concat +load 2 +concat +load 3 +concat +load 4 +concat +load 5 +itob +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 8 +load 8 +callsub tuplecomplement_0 +store 9 +frame_dig -1 +load 8 +concat +load 9 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_2: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_4: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 12 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 13 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 14 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 15 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 16 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 17 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 18 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 19 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 20 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 21 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 22 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 23 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 24 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 25 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 26 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 27 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 28 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 29 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 35 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 36 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 37 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 38 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 39 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 40 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 41 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 42 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 43 +load 12 +callsub numericalcomp_3 +store 12 +load 13 +callsub numericalcomp_3 +store 13 +load 14 +callsub numericalcomp_3 +store 14 +load 15 +callsub numericalcomp_3 +store 15 +load 16 +callsub numericalcomp_3 +store 16 +load 17 +callsub numericalcomp_3 +store 17 +load 18 +callsub numericalcomp_3 +store 18 +load 19 +callsub numericalcomp_3 +store 19 +load 20 +callsub numericalcomp_3 +store 20 +load 21 +callsub numericalcomp_3 +store 21 +load 22 +callsub numericalcomp_3 +store 22 +load 23 +callsub numericalcomp_3 +store 23 +load 24 +callsub numericalcomp_3 +store 24 +load 25 +callsub numericalcomp_3 +store 25 +load 26 +callsub numericalcomp_3 +store 26 +load 27 +callsub numericalcomp_3 +store 27 +load 28 +callsub numericalcomp_3 +store 28 +load 29 +callsub numericalcomp_3 +store 29 +load 30 +callsub numericalcomp_3 +store 30 +load 31 +callsub numericalcomp_3 +store 31 +load 32 +callsub numericalcomp_3 +store 32 +load 33 +callsub numericalcomp_3 +store 33 +load 34 +callsub numericalcomp_3 +store 34 +load 35 +callsub numericalcomp_3 +store 35 +load 36 +callsub numericalcomp_3 +store 36 +load 37 +callsub numericalcomp_3 +store 37 +load 38 +callsub numericalcomp_3 +store 38 +load 39 +callsub numericalcomp_3 +store 39 +load 40 +callsub numericalcomp_3 +store 40 +load 41 +callsub numericalcomp_3 +store 41 +load 42 +callsub numericalcomp_3 +store 42 +load 43 +callsub numericalcomp_3 +store 43 +byte 0x00 +int 0 +load 12 +setbyte +byte 0x00 +int 0 +load 13 +setbyte +concat +byte 0x00 +int 0 +load 14 +setbyte +concat +byte 0x00 +int 0 +load 15 +setbyte +concat +byte 0x00 +int 0 +load 16 +setbyte +concat +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +byte 0x00 +int 0 +load 20 +setbyte +concat +byte 0x00 +int 0 +load 21 +setbyte +concat +byte 0x00 +int 0 +load 22 +setbyte +concat +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +byte 0x00 +int 0 +load 26 +setbyte +concat +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +frame_bury 0 +retsub + +// tuple_complement +tuplecomplement_5: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint64 +store 10 +frame_dig -1 +int 64 +getbit +store 11 +load 10 +callsub numericalcomp_11 +store 10 +load 11 +callsub boolcomp_12 +store 11 +load 10 +itob +byte 0x00 +int 0 +load 11 +setbit +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_6: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_7: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 44 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 45 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 46 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 47 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 48 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 49 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 50 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 51 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 52 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 53 +load 44 +callsub numericalcomp_6 +store 44 +load 45 +callsub numericalcomp_6 +store 45 +load 46 +callsub numericalcomp_6 +store 46 +load 47 +callsub numericalcomp_6 +store 47 +load 48 +callsub numericalcomp_6 +store 48 +load 49 +callsub numericalcomp_6 +store 49 +load 50 +callsub numericalcomp_6 +store 50 +load 51 +callsub numericalcomp_6 +store 51 +load 52 +callsub numericalcomp_6 +store 52 +load 53 +callsub numericalcomp_6 +store 53 +byte 0x00 +int 0 +load 44 +setbyte +byte 0x00 +int 0 +load 45 +setbyte +concat +byte 0x00 +int 0 +load 46 +setbyte +concat +byte 0x00 +int 0 +load 47 +setbyte +concat +byte 0x00 +int 0 +load 48 +setbyte +concat +byte 0x00 +int 0 +load 49 +setbyte +concat +byte 0x00 +int 0 +load 50 +setbyte +concat +byte 0x00 +int 0 +load 51 +setbyte +concat +byte 0x00 +int 0 +load 52 +setbyte +concat +byte 0x00 +int 0 +load 53 +setbyte +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_8: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_9: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 54 +frame_dig -1 +int 1 +getbit +store 55 +frame_dig -1 +int 2 +getbit +store 56 +frame_dig -1 +int 3 +getbit +store 57 +load 54 +callsub boolcomp_8 +store 54 +load 55 +callsub boolcomp_8 +store 55 +load 56 +callsub boolcomp_8 +store 56 +load 57 +callsub boolcomp_8 +store 57 +byte 0x00 +int 0 +load 54 +setbit +int 1 +load 55 +setbit +int 2 +load 56 +setbit +int 3 +load 57 +setbit +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_10: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_11: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// bool_comp +boolcomp_12: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte).teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool,byte).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal new file mode 100644 index 000000000..c91fe2871 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte)_v8.teal @@ -0,0 +1,85 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 3 +load 3 +callsub roundtripper_1 +store 2 +byte 0x151f7c75 +load 2 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +frame_dig -1 +int 1 +getbyte +store 1 +load 0 +callsub boolcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +byte 0x00 +int 0 +load 0 +setbit +byte 0x00 +int 0 +load 1 +setbyte +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 4 +load 4 +callsub tuplecomplement_0 +store 5 +frame_dig -1 +load 4 +concat +load 5 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_2: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string).teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal new file mode 100644 index 000000000..dbb2b1b5e --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string)_v8.teal @@ -0,0 +1,683 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 5 +load 5 +callsub roundtripper_1 +store 4 +byte 0x151f7c75 +load 4 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +frame_dig -1 +int 1 +getbyte +store 1 +frame_dig -1 +extract 2 32 +store 2 +frame_dig -1 +frame_dig -1 +int 34 +extract_uint16 +dig 1 +len +substring3 +store 3 +load 0 +callsub boolcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub arraycomplement_5 +store 2 +load 3 +callsub stringreverse_6 +store 3 +byte 0x00 +int 0 +load 0 +setbit +byte 0x00 +int 0 +load 1 +setbyte +concat +load 2 +concat +load 3 +store 14 +load 14 +store 13 +int 36 +store 12 +load 12 +itob +extract 6 0 +concat +load 13 +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 6 +load 6 +callsub tuplecomplement_0 +store 7 +frame_dig -1 +store 11 +load 11 +store 10 +int 6 +store 8 +load 8 +load 11 +len ++ +store 9 +load 9 +int 65536 +< +assert +load 8 +itob +extract 6 0 +load 6 +store 11 +load 10 +load 11 +concat +store 10 +load 9 +store 8 +load 8 +load 11 +len ++ +store 9 +load 9 +int 65536 +< +assert +load 8 +itob +extract 6 0 +concat +load 7 +store 11 +load 10 +load 11 +concat +store 10 +load 9 +store 8 +load 8 +itob +extract 6 0 +concat +load 10 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_2: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_5: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 15 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 16 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 17 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 18 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 19 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 20 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 21 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 22 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 23 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 24 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 25 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 26 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 27 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 28 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 29 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 35 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 36 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 37 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 38 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 39 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 40 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 41 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 42 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 43 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 44 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 45 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 46 +load 15 +callsub numericalcomp_4 +store 15 +load 16 +callsub numericalcomp_4 +store 16 +load 17 +callsub numericalcomp_4 +store 17 +load 18 +callsub numericalcomp_4 +store 18 +load 19 +callsub numericalcomp_4 +store 19 +load 20 +callsub numericalcomp_4 +store 20 +load 21 +callsub numericalcomp_4 +store 21 +load 22 +callsub numericalcomp_4 +store 22 +load 23 +callsub numericalcomp_4 +store 23 +load 24 +callsub numericalcomp_4 +store 24 +load 25 +callsub numericalcomp_4 +store 25 +load 26 +callsub numericalcomp_4 +store 26 +load 27 +callsub numericalcomp_4 +store 27 +load 28 +callsub numericalcomp_4 +store 28 +load 29 +callsub numericalcomp_4 +store 29 +load 30 +callsub numericalcomp_4 +store 30 +load 31 +callsub numericalcomp_4 +store 31 +load 32 +callsub numericalcomp_4 +store 32 +load 33 +callsub numericalcomp_4 +store 33 +load 34 +callsub numericalcomp_4 +store 34 +load 35 +callsub numericalcomp_4 +store 35 +load 36 +callsub numericalcomp_4 +store 36 +load 37 +callsub numericalcomp_4 +store 37 +load 38 +callsub numericalcomp_4 +store 38 +load 39 +callsub numericalcomp_4 +store 39 +load 40 +callsub numericalcomp_4 +store 40 +load 41 +callsub numericalcomp_4 +store 41 +load 42 +callsub numericalcomp_4 +store 42 +load 43 +callsub numericalcomp_4 +store 43 +load 44 +callsub numericalcomp_4 +store 44 +load 45 +callsub numericalcomp_4 +store 45 +load 46 +callsub numericalcomp_4 +store 46 +byte 0x00 +int 0 +load 15 +setbyte +byte 0x00 +int 0 +load 16 +setbyte +concat +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +byte 0x00 +int 0 +load 20 +setbyte +concat +byte 0x00 +int 0 +load 21 +setbyte +concat +byte 0x00 +int 0 +load 22 +setbyte +concat +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +byte 0x00 +int 0 +load 26 +setbyte +concat +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +byte 0x00 +int 0 +load 44 +setbyte +concat +byte 0x00 +int 0 +load 45 +setbyte +concat +byte 0x00 +int 0 +load 46 +setbyte +concat +frame_bury 0 +retsub + +// string_reverse +stringreverse_6: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 49 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 48 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 47 +int 3 +store 50 +load 50 +itob +extract 6 0 +byte 0x00 +int 0 +load 47 +setbyte +byte 0x00 +int 0 +load 48 +setbyte +concat +byte 0x00 +int 0 +load 49 +setbyte +concat +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2.teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal new file mode 100644 index 000000000..ac2ca105f --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,(address,(uint32,string[],bool[2],(byte),uint8)[2],string,bool[]))[]_2_v8.teal @@ -0,0 +1,2033 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 6 +load 6 +callsub roundtripper_2 +store 5 +byte 0x151f7c75 +load 5 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +frame_dig -1 +int 1 +getbyte +store 1 +frame_dig -1 +extract 2 32 +store 2 +frame_dig -1 +frame_dig -1 +int 34 +extract_uint16 +frame_dig -1 +int 36 +extract_uint16 +substring3 +store 3 +frame_dig -1 +frame_dig -1 +int 36 +extract_uint16 +dig 1 +len +substring3 +store 4 +load 0 +callsub boolcomp_3 +store 0 +load 1 +callsub numericalcomp_4 +store 1 +load 2 +callsub arraycomplement_6 +store 2 +load 3 +callsub stringreverse_7 +store 3 +load 4 +callsub tuplecomplement_8 +store 4 +byte 0x00 +int 0 +load 0 +setbit +byte 0x00 +int 0 +load 1 +setbyte +concat +load 2 +concat +load 3 +store 29 +load 29 +store 28 +int 38 +store 26 +load 26 +load 29 +len ++ +store 27 +load 27 +int 65536 +< +assert +load 26 +itob +extract 6 0 +concat +load 4 +store 29 +load 28 +load 29 +concat +store 28 +load 27 +store 26 +load 26 +itob +extract 6 0 +concat +load 28 +concat +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +frame_dig -1 +int 2 +int 0 +* +int 2 ++ +extract_uint16 +int 2 ++ +int 0 +int 1 ++ +frame_dig -1 +int 0 +extract_uint16 +store 15 +load 15 +== +bnz arraycomplement_1_l5 +frame_dig -1 +int 2 +int 0 +* +int 2 ++ +int 2 ++ +extract_uint16 +int 2 ++ +arraycomplement_1_l2: +substring3 +store 13 +frame_dig -1 +frame_dig -1 +int 2 +int 1 +* +int 2 ++ +extract_uint16 +int 2 ++ +int 1 +int 1 ++ +frame_dig -1 +int 0 +extract_uint16 +store 16 +load 16 +== +bnz arraycomplement_1_l4 +frame_dig -1 +int 2 +int 1 +* +int 2 ++ +int 2 ++ +extract_uint16 +int 2 ++ +b arraycomplement_1_l6 +arraycomplement_1_l4: +frame_dig -1 +len +b arraycomplement_1_l6 +arraycomplement_1_l5: +frame_dig -1 +len +b arraycomplement_1_l2 +arraycomplement_1_l6: +substring3 +store 14 +load 13 +callsub tuplecomplement_0 +store 13 +load 14 +callsub tuplecomplement_0 +store 14 +int 2 +store 21 +load 21 +itob +extract 6 0 +load 13 +store 20 +load 20 +store 19 +int 4 +store 17 +load 17 +load 20 +len ++ +store 18 +load 18 +int 65536 +< +assert +load 17 +itob +extract 6 0 +load 14 +store 20 +load 19 +load 20 +concat +store 19 +load 18 +store 17 +load 17 +itob +extract 6 0 +concat +load 19 +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 7 +load 7 +callsub arraycomplement_1 +store 8 +frame_dig -1 +store 12 +load 12 +store 11 +int 6 +store 9 +load 9 +load 12 +len ++ +store 10 +load 10 +int 65536 +< +assert +load 9 +itob +extract 6 0 +load 7 +store 12 +load 11 +load 12 +concat +store 11 +load 10 +store 9 +load 9 +load 12 +len ++ +store 10 +load 10 +int 65536 +< +assert +load 9 +itob +extract 6 0 +concat +load 8 +store 12 +load 11 +load 12 +concat +store 11 +load 10 +store 9 +load 9 +itob +extract 6 0 +concat +load 11 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_3: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// numerical_comp +numericalcomp_5: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_6: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 35 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 36 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 37 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 38 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 39 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 40 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 41 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 42 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 43 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 44 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 45 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 46 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 47 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 48 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 49 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 50 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 51 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 52 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 53 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 54 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 55 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 56 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 57 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 58 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 59 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 60 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 61 +load 30 +callsub numericalcomp_5 +store 30 +load 31 +callsub numericalcomp_5 +store 31 +load 32 +callsub numericalcomp_5 +store 32 +load 33 +callsub numericalcomp_5 +store 33 +load 34 +callsub numericalcomp_5 +store 34 +load 35 +callsub numericalcomp_5 +store 35 +load 36 +callsub numericalcomp_5 +store 36 +load 37 +callsub numericalcomp_5 +store 37 +load 38 +callsub numericalcomp_5 +store 38 +load 39 +callsub numericalcomp_5 +store 39 +load 40 +callsub numericalcomp_5 +store 40 +load 41 +callsub numericalcomp_5 +store 41 +load 42 +callsub numericalcomp_5 +store 42 +load 43 +callsub numericalcomp_5 +store 43 +load 44 +callsub numericalcomp_5 +store 44 +load 45 +callsub numericalcomp_5 +store 45 +load 46 +callsub numericalcomp_5 +store 46 +load 47 +callsub numericalcomp_5 +store 47 +load 48 +callsub numericalcomp_5 +store 48 +load 49 +callsub numericalcomp_5 +store 49 +load 50 +callsub numericalcomp_5 +store 50 +load 51 +callsub numericalcomp_5 +store 51 +load 52 +callsub numericalcomp_5 +store 52 +load 53 +callsub numericalcomp_5 +store 53 +load 54 +callsub numericalcomp_5 +store 54 +load 55 +callsub numericalcomp_5 +store 55 +load 56 +callsub numericalcomp_5 +store 56 +load 57 +callsub numericalcomp_5 +store 57 +load 58 +callsub numericalcomp_5 +store 58 +load 59 +callsub numericalcomp_5 +store 59 +load 60 +callsub numericalcomp_5 +store 60 +load 61 +callsub numericalcomp_5 +store 61 +byte 0x00 +int 0 +load 30 +setbyte +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +byte 0x00 +int 0 +load 44 +setbyte +concat +byte 0x00 +int 0 +load 45 +setbyte +concat +byte 0x00 +int 0 +load 46 +setbyte +concat +byte 0x00 +int 0 +load 47 +setbyte +concat +byte 0x00 +int 0 +load 48 +setbyte +concat +byte 0x00 +int 0 +load 49 +setbyte +concat +byte 0x00 +int 0 +load 50 +setbyte +concat +byte 0x00 +int 0 +load 51 +setbyte +concat +byte 0x00 +int 0 +load 52 +setbyte +concat +byte 0x00 +int 0 +load 53 +setbyte +concat +byte 0x00 +int 0 +load 54 +setbyte +concat +byte 0x00 +int 0 +load 55 +setbyte +concat +byte 0x00 +int 0 +load 56 +setbyte +concat +byte 0x00 +int 0 +load 57 +setbyte +concat +byte 0x00 +int 0 +load 58 +setbyte +concat +byte 0x00 +int 0 +load 59 +setbyte +concat +byte 0x00 +int 0 +load 60 +setbyte +concat +byte 0x00 +int 0 +load 61 +setbyte +concat +frame_bury 0 +retsub + +// string_reverse +stringreverse_7: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 64 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 63 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 62 +int 3 +store 65 +load 65 +itob +extract 6 0 +byte 0x00 +int 0 +load 62 +setbyte +byte 0x00 +int 0 +load 63 +setbyte +concat +byte 0x00 +int 0 +load 64 +setbyte +concat +concat +frame_bury 0 +retsub + +// tuple_complement +tuplecomplement_8: +proto 1 1 +byte "" +frame_dig -1 +extract 0 32 +store 22 +frame_dig -1 +frame_dig -1 +int 32 +extract_uint16 +frame_dig -1 +int 34 +extract_uint16 +substring3 +store 23 +frame_dig -1 +frame_dig -1 +int 34 +extract_uint16 +frame_dig -1 +int 36 +extract_uint16 +substring3 +store 24 +frame_dig -1 +frame_dig -1 +int 36 +extract_uint16 +dig 1 +len +substring3 +store 25 +load 22 +callsub arraycomplement_10 +store 22 +load 23 +callsub arraycomplement_12 +store 23 +load 24 +callsub stringreverse_13 +store 24 +load 25 +callsub arraycomplement_15 +store 25 +load 22 +load 23 +store 74 +load 74 +store 73 +int 38 +store 71 +load 71 +load 74 +len ++ +store 72 +load 72 +int 65536 +< +assert +load 71 +itob +extract 6 0 +concat +load 24 +store 74 +load 73 +load 74 +concat +store 73 +load 72 +store 71 +load 71 +load 74 +len ++ +store 72 +load 72 +int 65536 +< +assert +load 71 +itob +extract 6 0 +concat +load 25 +store 74 +load 73 +load 74 +concat +store 73 +load 72 +store 71 +load 71 +itob +extract 6 0 +concat +load 73 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_9: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_10: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 75 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 76 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 77 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 78 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 79 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 80 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 81 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 82 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 83 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 84 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 85 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 86 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 87 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 88 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 89 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 90 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 91 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 92 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 93 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 94 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 95 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 96 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 97 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 98 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 99 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 100 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 101 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 102 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 103 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 104 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 105 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 106 +load 75 +callsub numericalcomp_9 +store 75 +load 76 +callsub numericalcomp_9 +store 76 +load 77 +callsub numericalcomp_9 +store 77 +load 78 +callsub numericalcomp_9 +store 78 +load 79 +callsub numericalcomp_9 +store 79 +load 80 +callsub numericalcomp_9 +store 80 +load 81 +callsub numericalcomp_9 +store 81 +load 82 +callsub numericalcomp_9 +store 82 +load 83 +callsub numericalcomp_9 +store 83 +load 84 +callsub numericalcomp_9 +store 84 +load 85 +callsub numericalcomp_9 +store 85 +load 86 +callsub numericalcomp_9 +store 86 +load 87 +callsub numericalcomp_9 +store 87 +load 88 +callsub numericalcomp_9 +store 88 +load 89 +callsub numericalcomp_9 +store 89 +load 90 +callsub numericalcomp_9 +store 90 +load 91 +callsub numericalcomp_9 +store 91 +load 92 +callsub numericalcomp_9 +store 92 +load 93 +callsub numericalcomp_9 +store 93 +load 94 +callsub numericalcomp_9 +store 94 +load 95 +callsub numericalcomp_9 +store 95 +load 96 +callsub numericalcomp_9 +store 96 +load 97 +callsub numericalcomp_9 +store 97 +load 98 +callsub numericalcomp_9 +store 98 +load 99 +callsub numericalcomp_9 +store 99 +load 100 +callsub numericalcomp_9 +store 100 +load 101 +callsub numericalcomp_9 +store 101 +load 102 +callsub numericalcomp_9 +store 102 +load 103 +callsub numericalcomp_9 +store 103 +load 104 +callsub numericalcomp_9 +store 104 +load 105 +callsub numericalcomp_9 +store 105 +load 106 +callsub numericalcomp_9 +store 106 +byte 0x00 +int 0 +load 75 +setbyte +byte 0x00 +int 0 +load 76 +setbyte +concat +byte 0x00 +int 0 +load 77 +setbyte +concat +byte 0x00 +int 0 +load 78 +setbyte +concat +byte 0x00 +int 0 +load 79 +setbyte +concat +byte 0x00 +int 0 +load 80 +setbyte +concat +byte 0x00 +int 0 +load 81 +setbyte +concat +byte 0x00 +int 0 +load 82 +setbyte +concat +byte 0x00 +int 0 +load 83 +setbyte +concat +byte 0x00 +int 0 +load 84 +setbyte +concat +byte 0x00 +int 0 +load 85 +setbyte +concat +byte 0x00 +int 0 +load 86 +setbyte +concat +byte 0x00 +int 0 +load 87 +setbyte +concat +byte 0x00 +int 0 +load 88 +setbyte +concat +byte 0x00 +int 0 +load 89 +setbyte +concat +byte 0x00 +int 0 +load 90 +setbyte +concat +byte 0x00 +int 0 +load 91 +setbyte +concat +byte 0x00 +int 0 +load 92 +setbyte +concat +byte 0x00 +int 0 +load 93 +setbyte +concat +byte 0x00 +int 0 +load 94 +setbyte +concat +byte 0x00 +int 0 +load 95 +setbyte +concat +byte 0x00 +int 0 +load 96 +setbyte +concat +byte 0x00 +int 0 +load 97 +setbyte +concat +byte 0x00 +int 0 +load 98 +setbyte +concat +byte 0x00 +int 0 +load 99 +setbyte +concat +byte 0x00 +int 0 +load 100 +setbyte +concat +byte 0x00 +int 0 +load 101 +setbyte +concat +byte 0x00 +int 0 +load 102 +setbyte +concat +byte 0x00 +int 0 +load 103 +setbyte +concat +byte 0x00 +int 0 +load 104 +setbyte +concat +byte 0x00 +int 0 +load 105 +setbyte +concat +byte 0x00 +int 0 +load 106 +setbyte +concat +frame_bury 0 +retsub + +// tuple_complement +tuplecomplement_11: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint32 +store 66 +frame_dig -1 +frame_dig -1 +int 4 +extract_uint16 +dig 1 +len +substring3 +store 67 +frame_dig -1 +extract 6 1 +store 68 +frame_dig -1 +extract 7 1 +store 69 +frame_dig -1 +int 8 +getbyte +store 70 +load 66 +callsub numericalcomp_16 +store 66 +load 67 +callsub arraycomplement_18 +store 67 +load 68 +callsub arraycomplement_20 +store 68 +load 69 +callsub tuplecomplement_21 +store 69 +load 70 +callsub numericalcomp_22 +store 70 +load 66 +itob +extract 4 0 +load 67 +store 116 +load 116 +store 115 +int 9 +store 114 +load 114 +itob +extract 6 0 +concat +load 68 +concat +load 69 +concat +byte 0x00 +int 0 +load 70 +setbyte +concat +load 115 +concat +frame_bury 0 +retsub + +// array_complement +arraycomplement_12: +proto 1 1 +byte "" +frame_dig -1 +frame_dig -1 +int 2 +int 0 +* +extract_uint16 +int 0 +int 1 ++ +int 2 +== +bnz arraycomplement_12_l5 +frame_dig -1 +int 2 +int 0 +* +int 2 ++ +extract_uint16 +arraycomplement_12_l2: +substring3 +store 107 +frame_dig -1 +frame_dig -1 +int 2 +int 1 +* +extract_uint16 +int 1 +int 1 ++ +int 2 +== +bnz arraycomplement_12_l4 +frame_dig -1 +int 2 +int 1 +* +int 2 ++ +extract_uint16 +b arraycomplement_12_l6 +arraycomplement_12_l4: +frame_dig -1 +len +b arraycomplement_12_l6 +arraycomplement_12_l5: +frame_dig -1 +len +b arraycomplement_12_l2 +arraycomplement_12_l6: +substring3 +store 108 +load 107 +callsub tuplecomplement_11 +store 107 +load 108 +callsub tuplecomplement_11 +store 108 +load 107 +store 112 +load 112 +store 111 +int 4 +store 109 +load 109 +load 112 +len ++ +store 110 +load 110 +int 65536 +< +assert +load 109 +itob +extract 6 0 +load 108 +store 112 +load 111 +load 112 +concat +store 111 +load 110 +store 109 +load 109 +itob +extract 6 0 +concat +load 111 +concat +frame_bury 0 +retsub + +// string_reverse +stringreverse_13: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 136 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 135 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 134 +int 3 +store 137 +load 137 +itob +extract 6 0 +byte 0x00 +int 0 +load 134 +setbyte +byte 0x00 +int 0 +load 135 +setbyte +concat +byte 0x00 +int 0 +load 136 +setbyte +concat +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_14: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_15: +proto 1 1 +byte "" +frame_dig -1 +int 0 +int 16 ++ +getbit +store 138 +frame_dig -1 +int 1 +int 16 ++ +getbit +store 139 +frame_dig -1 +int 2 +int 16 ++ +getbit +store 140 +load 138 +callsub boolcomp_14 +store 138 +load 139 +callsub boolcomp_14 +store 139 +load 140 +callsub boolcomp_14 +store 140 +int 3 +store 141 +load 141 +itob +extract 6 0 +byte 0x00 +int 0 +load 138 +setbit +int 1 +load 139 +setbit +int 2 +load 140 +setbit +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_16: +proto 1 1 +int 0 +int 4294967295 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 4294967296 +< +assert +retsub + +// string_reverse +stringreverse_17: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 130 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 129 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 128 +int 3 +store 131 +load 131 +itob +extract 6 0 +byte 0x00 +int 0 +load 128 +setbyte +byte 0x00 +int 0 +load 129 +setbyte +concat +byte 0x00 +int 0 +load 130 +setbyte +concat +concat +frame_bury 0 +retsub + +// array_complement +arraycomplement_18: +proto 1 1 +byte "" +frame_dig -1 +frame_dig -1 +int 2 +int 0 +* +int 2 ++ +extract_uint16 +int 2 ++ +int 0 +int 1 ++ +frame_dig -1 +int 0 +extract_uint16 +store 120 +load 120 +== +bnz arraycomplement_18_l8 +frame_dig -1 +int 2 +int 0 +* +int 2 ++ +int 2 ++ +extract_uint16 +int 2 ++ +arraycomplement_18_l2: +substring3 +store 117 +frame_dig -1 +frame_dig -1 +int 2 +int 1 +* +int 2 ++ +extract_uint16 +int 2 ++ +int 1 +int 1 ++ +frame_dig -1 +int 0 +extract_uint16 +store 121 +load 121 +== +bnz arraycomplement_18_l7 +frame_dig -1 +int 2 +int 1 +* +int 2 ++ +int 2 ++ +extract_uint16 +int 2 ++ +arraycomplement_18_l4: +substring3 +store 118 +frame_dig -1 +frame_dig -1 +int 2 +int 2 +* +int 2 ++ +extract_uint16 +int 2 ++ +int 2 +int 1 ++ +frame_dig -1 +int 0 +extract_uint16 +store 122 +load 122 +== +bnz arraycomplement_18_l6 +frame_dig -1 +int 2 +int 2 +* +int 2 ++ +int 2 ++ +extract_uint16 +int 2 ++ +b arraycomplement_18_l9 +arraycomplement_18_l6: +frame_dig -1 +len +b arraycomplement_18_l9 +arraycomplement_18_l7: +frame_dig -1 +len +b arraycomplement_18_l4 +arraycomplement_18_l8: +frame_dig -1 +len +b arraycomplement_18_l2 +arraycomplement_18_l9: +substring3 +store 119 +load 117 +callsub stringreverse_17 +store 117 +load 118 +callsub stringreverse_17 +store 118 +load 119 +callsub stringreverse_17 +store 119 +int 3 +store 127 +load 127 +itob +extract 6 0 +load 117 +store 126 +load 126 +store 125 +int 6 +store 123 +load 123 +load 126 +len ++ +store 124 +load 124 +int 65536 +< +assert +load 123 +itob +extract 6 0 +load 118 +store 126 +load 125 +load 126 +concat +store 125 +load 124 +store 123 +load 123 +load 126 +len ++ +store 124 +load 124 +int 65536 +< +assert +load 123 +itob +extract 6 0 +concat +load 119 +store 126 +load 125 +load 126 +concat +store 125 +load 124 +store 123 +load 123 +itob +extract 6 0 +concat +load 125 +concat +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_19: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_20: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 132 +frame_dig -1 +int 1 +getbit +store 133 +load 132 +callsub boolcomp_19 +store 132 +load 133 +callsub boolcomp_19 +store 133 +byte 0x00 +int 0 +load 132 +setbit +int 1 +load 133 +setbit +frame_bury 0 +retsub + +// tuple_complement +tuplecomplement_21: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbyte +store 113 +load 113 +callsub numericalcomp_23 +store 113 +byte 0x00 +int 0 +load 113 +setbyte +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_22: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// numerical_comp +numericalcomp_23: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64).teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal new file mode 100644 index 000000000..ac3980f9e --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,byte,address,string,uint64)_v8.teal @@ -0,0 +1,703 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 6 +load 6 +callsub roundtripper_1 +store 5 +byte 0x151f7c75 +load 5 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +frame_dig -1 +int 1 +getbyte +store 1 +frame_dig -1 +extract 2 32 +store 2 +frame_dig -1 +frame_dig -1 +int 34 +extract_uint16 +dig 1 +len +substring3 +store 3 +frame_dig -1 +int 36 +extract_uint64 +store 4 +load 0 +callsub boolcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub arraycomplement_5 +store 2 +load 3 +callsub stringreverse_6 +store 3 +load 4 +callsub numericalcomp_7 +store 4 +byte 0x00 +int 0 +load 0 +setbit +byte 0x00 +int 0 +load 1 +setbyte +concat +load 2 +concat +load 3 +store 15 +load 15 +store 14 +int 44 +store 13 +load 13 +itob +extract 6 0 +concat +load 4 +itob +concat +load 14 +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 7 +load 7 +callsub tuplecomplement_0 +store 8 +frame_dig -1 +store 12 +load 12 +store 11 +int 6 +store 9 +load 9 +load 12 +len ++ +store 10 +load 10 +int 65536 +< +assert +load 9 +itob +extract 6 0 +load 7 +store 12 +load 11 +load 12 +concat +store 11 +load 10 +store 9 +load 9 +load 12 +len ++ +store 10 +load 10 +int 65536 +< +assert +load 9 +itob +extract 6 0 +concat +load 8 +store 12 +load 11 +load 12 +concat +store 11 +load 10 +store 9 +load 9 +itob +extract 6 0 +concat +load 11 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_2: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_5: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 16 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 17 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 18 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 19 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 20 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 21 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 22 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 23 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 24 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 25 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 26 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 27 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 28 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 29 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 35 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 36 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 37 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 38 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 39 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 40 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 41 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 42 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 43 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 44 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 45 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 46 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 47 +load 16 +callsub numericalcomp_4 +store 16 +load 17 +callsub numericalcomp_4 +store 17 +load 18 +callsub numericalcomp_4 +store 18 +load 19 +callsub numericalcomp_4 +store 19 +load 20 +callsub numericalcomp_4 +store 20 +load 21 +callsub numericalcomp_4 +store 21 +load 22 +callsub numericalcomp_4 +store 22 +load 23 +callsub numericalcomp_4 +store 23 +load 24 +callsub numericalcomp_4 +store 24 +load 25 +callsub numericalcomp_4 +store 25 +load 26 +callsub numericalcomp_4 +store 26 +load 27 +callsub numericalcomp_4 +store 27 +load 28 +callsub numericalcomp_4 +store 28 +load 29 +callsub numericalcomp_4 +store 29 +load 30 +callsub numericalcomp_4 +store 30 +load 31 +callsub numericalcomp_4 +store 31 +load 32 +callsub numericalcomp_4 +store 32 +load 33 +callsub numericalcomp_4 +store 33 +load 34 +callsub numericalcomp_4 +store 34 +load 35 +callsub numericalcomp_4 +store 35 +load 36 +callsub numericalcomp_4 +store 36 +load 37 +callsub numericalcomp_4 +store 37 +load 38 +callsub numericalcomp_4 +store 38 +load 39 +callsub numericalcomp_4 +store 39 +load 40 +callsub numericalcomp_4 +store 40 +load 41 +callsub numericalcomp_4 +store 41 +load 42 +callsub numericalcomp_4 +store 42 +load 43 +callsub numericalcomp_4 +store 43 +load 44 +callsub numericalcomp_4 +store 44 +load 45 +callsub numericalcomp_4 +store 45 +load 46 +callsub numericalcomp_4 +store 46 +load 47 +callsub numericalcomp_4 +store 47 +byte 0x00 +int 0 +load 16 +setbyte +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +byte 0x00 +int 0 +load 20 +setbyte +concat +byte 0x00 +int 0 +load 21 +setbyte +concat +byte 0x00 +int 0 +load 22 +setbyte +concat +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +byte 0x00 +int 0 +load 26 +setbyte +concat +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +byte 0x00 +int 0 +load 44 +setbyte +concat +byte 0x00 +int 0 +load 45 +setbyte +concat +byte 0x00 +int 0 +load 46 +setbyte +concat +byte 0x00 +int 0 +load 47 +setbyte +concat +frame_bury 0 +retsub + +// string_reverse +stringreverse_6: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 50 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 49 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 48 +int 3 +store 51 +load 51 +itob +extract 6 0 +byte 0x00 +int 0 +load 48 +setbyte +byte 0x00 +int 0 +load 49 +setbyte +concat +byte 0x00 +int 0 +load 50 +setbyte +concat +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_7: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32).teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal new file mode 100644 index 000000000..8f04b8ad0 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(bool,uint64,uint32)_v8.teal @@ -0,0 +1,104 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 0 +frame_dig -1 +int 1 +extract_uint64 +store 1 +frame_dig -1 +int 9 +extract_uint32 +store 2 +load 0 +callsub boolcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub numericalcomp_4 +store 2 +byte 0x00 +int 0 +load 0 +setbit +load 1 +itob +concat +load 2 +itob +extract 4 0 +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 5 +load 5 +callsub tuplecomplement_0 +store 6 +frame_dig -1 +load 5 +concat +load 6 +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_2: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 4294967295 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 4294967296 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte).teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(byte).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(byte)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal new file mode 100644 index 000000000..4a8d567ff --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte)_v8.teal @@ -0,0 +1,62 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_1 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbyte +store 0 +load 0 +callsub numericalcomp_2 +store 0 +byte 0x00 +int 0 +load 0 +setbyte +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 3 +load 3 +callsub tuplecomplement_0 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64).teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal new file mode 100644 index 000000000..a5fb0355f --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte,bool,uint64)_v8.teal @@ -0,0 +1,105 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbyte +store 0 +frame_dig -1 +int 8 +getbit +store 1 +frame_dig -1 +int 2 +extract_uint64 +store 2 +load 0 +callsub numericalcomp_2 +store 0 +load 1 +callsub boolcomp_3 +store 1 +load 2 +callsub numericalcomp_4 +store 2 +byte 0x00 +int 0 +load 0 +setbyte +byte 0x00 +int 0 +load 1 +setbit +concat +load 2 +itob +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 5 +load 5 +callsub tuplecomplement_0 +store 6 +frame_dig -1 +load 5 +concat +load 6 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// bool_comp +boolcomp_3: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7.teal rename to tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal new file mode 100644 index 000000000..064b29fc8 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(byte[4],(bool,bool),uint64,address)[]_7_v8.teal @@ -0,0 +1,832 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 5 +load 5 +callsub roundtripper_2 +store 4 +byte 0x151f7c75 +load 4 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +extract 0 4 +store 0 +frame_dig -1 +extract 4 1 +store 1 +frame_dig -1 +int 5 +extract_uint64 +store 2 +frame_dig -1 +extract 13 0 +store 3 +load 0 +callsub arraycomplement_4 +store 0 +load 1 +callsub tuplecomplement_5 +store 1 +load 2 +callsub numericalcomp_6 +store 2 +load 3 +callsub arraycomplement_8 +store 3 +load 0 +load 1 +concat +load 2 +itob +concat +load 3 +concat +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 45 +int 0 +* +int 2 ++ +int 45 +extract3 +store 12 +frame_dig -1 +int 45 +int 1 +* +int 2 ++ +int 45 +extract3 +store 13 +frame_dig -1 +int 45 +int 2 +* +int 2 ++ +int 45 +extract3 +store 14 +frame_dig -1 +int 45 +int 3 +* +int 2 ++ +int 45 +extract3 +store 15 +frame_dig -1 +int 45 +int 4 +* +int 2 ++ +int 45 +extract3 +store 16 +frame_dig -1 +int 45 +int 5 +* +int 2 ++ +int 45 +extract3 +store 17 +frame_dig -1 +int 45 +int 6 +* +int 2 ++ +int 45 +extract3 +store 18 +load 12 +callsub tuplecomplement_0 +store 12 +load 13 +callsub tuplecomplement_0 +store 13 +load 14 +callsub tuplecomplement_0 +store 14 +load 15 +callsub tuplecomplement_0 +store 15 +load 16 +callsub tuplecomplement_0 +store 16 +load 17 +callsub tuplecomplement_0 +store 17 +load 18 +callsub tuplecomplement_0 +store 18 +int 7 +store 19 +load 19 +itob +extract 6 0 +load 12 +load 13 +concat +load 14 +concat +load 15 +concat +load 16 +concat +load 17 +concat +load 18 +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 6 +load 6 +callsub arraycomplement_1 +store 7 +frame_dig -1 +store 11 +load 11 +store 10 +int 6 +store 8 +load 8 +load 11 +len ++ +store 9 +load 9 +int 65536 +< +assert +load 8 +itob +extract 6 0 +load 6 +store 11 +load 10 +load 11 +concat +store 10 +load 9 +store 8 +load 8 +load 11 +len ++ +store 9 +load 9 +int 65536 +< +assert +load 8 +itob +extract 6 0 +concat +load 7 +store 11 +load 10 +load 11 +concat +store 10 +load 9 +store 8 +load 8 +itob +extract 6 0 +concat +load 10 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_4: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 22 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 23 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 24 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 25 +load 22 +callsub numericalcomp_3 +store 22 +load 23 +callsub numericalcomp_3 +store 23 +load 24 +callsub numericalcomp_3 +store 24 +load 25 +callsub numericalcomp_3 +store 25 +byte 0x00 +int 0 +load 22 +setbyte +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +frame_bury 0 +retsub + +// tuple_complement +tuplecomplement_5: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 20 +frame_dig -1 +int 1 +getbit +store 21 +load 20 +callsub boolcomp_9 +store 20 +load 21 +callsub boolcomp_10 +store 21 +byte 0x00 +int 0 +load 20 +setbit +int 1 +load 21 +setbit +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_6: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_7: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_8: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 26 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 27 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 28 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 29 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 35 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 36 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 37 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 38 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 39 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 40 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 41 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 42 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 43 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 44 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 45 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 46 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 47 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 48 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 49 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 50 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 51 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 52 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 53 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 54 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 55 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 56 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 57 +load 26 +callsub numericalcomp_7 +store 26 +load 27 +callsub numericalcomp_7 +store 27 +load 28 +callsub numericalcomp_7 +store 28 +load 29 +callsub numericalcomp_7 +store 29 +load 30 +callsub numericalcomp_7 +store 30 +load 31 +callsub numericalcomp_7 +store 31 +load 32 +callsub numericalcomp_7 +store 32 +load 33 +callsub numericalcomp_7 +store 33 +load 34 +callsub numericalcomp_7 +store 34 +load 35 +callsub numericalcomp_7 +store 35 +load 36 +callsub numericalcomp_7 +store 36 +load 37 +callsub numericalcomp_7 +store 37 +load 38 +callsub numericalcomp_7 +store 38 +load 39 +callsub numericalcomp_7 +store 39 +load 40 +callsub numericalcomp_7 +store 40 +load 41 +callsub numericalcomp_7 +store 41 +load 42 +callsub numericalcomp_7 +store 42 +load 43 +callsub numericalcomp_7 +store 43 +load 44 +callsub numericalcomp_7 +store 44 +load 45 +callsub numericalcomp_7 +store 45 +load 46 +callsub numericalcomp_7 +store 46 +load 47 +callsub numericalcomp_7 +store 47 +load 48 +callsub numericalcomp_7 +store 48 +load 49 +callsub numericalcomp_7 +store 49 +load 50 +callsub numericalcomp_7 +store 50 +load 51 +callsub numericalcomp_7 +store 51 +load 52 +callsub numericalcomp_7 +store 52 +load 53 +callsub numericalcomp_7 +store 53 +load 54 +callsub numericalcomp_7 +store 54 +load 55 +callsub numericalcomp_7 +store 55 +load 56 +callsub numericalcomp_7 +store 56 +load 57 +callsub numericalcomp_7 +store 57 +byte 0x00 +int 0 +load 26 +setbyte +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +byte 0x00 +int 0 +load 44 +setbyte +concat +byte 0x00 +int 0 +load 45 +setbyte +concat +byte 0x00 +int 0 +load 46 +setbyte +concat +byte 0x00 +int 0 +load 47 +setbyte +concat +byte 0x00 +int 0 +load 48 +setbyte +concat +byte 0x00 +int 0 +load 49 +setbyte +concat +byte 0x00 +int 0 +load 50 +setbyte +concat +byte 0x00 +int 0 +load 51 +setbyte +concat +byte 0x00 +int 0 +load 52 +setbyte +concat +byte 0x00 +int 0 +load 53 +setbyte +concat +byte 0x00 +int 0 +load 54 +setbyte +concat +byte 0x00 +int 0 +load 55 +setbyte +concat +byte 0x00 +int 0 +load 56 +setbyte +concat +byte 0x00 +int 0 +load 57 +setbyte +concat +frame_bury 0 +retsub + +// bool_comp +boolcomp_9: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// bool_comp +boolcomp_10: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint16).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal new file mode 100644 index 000000000..3a683e4cf --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint16)_v8.teal @@ -0,0 +1,61 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_1 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint16 +store 0 +load 0 +callsub numericalcomp_2 +store 0 +load 0 +itob +extract 6 0 +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 3 +load 3 +callsub tuplecomplement_0 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 65535 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 65536 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal new file mode 100644 index 000000000..47ddf0b4c --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint16,uint8,byte)_v8.teal @@ -0,0 +1,113 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint16 +store 0 +frame_dig -1 +int 2 +getbyte +store 1 +frame_dig -1 +int 3 +getbyte +store 2 +load 0 +callsub numericalcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub numericalcomp_4 +store 2 +load 0 +itob +extract 6 0 +byte 0x00 +int 0 +load 1 +setbyte +concat +byte 0x00 +int 0 +load 2 +setbyte +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 5 +load 5 +callsub tuplecomplement_0 +store 6 +frame_dig -1 +load 5 +concat +load 6 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 65535 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 65536 +< +assert +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint32).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal new file mode 100644 index 000000000..a4b6b04a2 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint32)_v8.teal @@ -0,0 +1,61 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_1 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint32 +store 0 +load 0 +callsub numericalcomp_2 +store 0 +load 0 +itob +extract 4 0 +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 3 +load 3 +callsub tuplecomplement_0 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 4294967295 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 4294967296 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal new file mode 100644 index 000000000..8a165cddc --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint32,uint16,uint8)_v8.teal @@ -0,0 +1,112 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint32 +store 0 +frame_dig -1 +int 4 +extract_uint16 +store 1 +frame_dig -1 +int 6 +getbyte +store 2 +load 0 +callsub numericalcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub numericalcomp_4 +store 2 +load 0 +itob +extract 4 0 +load 1 +itob +extract 6 0 +concat +byte 0x00 +int 0 +load 2 +setbyte +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 5 +load 5 +callsub tuplecomplement_0 +store 6 +frame_dig -1 +load 5 +concat +load 6 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 4294967295 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 4294967296 +< +assert +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 65535 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 65536 +< +assert +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint64).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal new file mode 100644 index 000000000..5ba9c63c6 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint64)_v8.teal @@ -0,0 +1,55 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_1 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +btoi +store 0 +load 0 +callsub numericalcomp_2 +store 0 +load 0 +itob +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 3 +load 3 +callsub tuplecomplement_0 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal new file mode 100644 index 000000000..33a5fb36c --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint64,uint32,uint16)_v8.teal @@ -0,0 +1,106 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +extract_uint64 +store 0 +frame_dig -1 +int 8 +extract_uint32 +store 1 +frame_dig -1 +int 12 +extract_uint16 +store 2 +load 0 +callsub numericalcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub numericalcomp_4 +store 2 +load 0 +itob +load 1 +itob +extract 4 0 +concat +load 2 +itob +extract 6 0 +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 5 +load 5 +callsub tuplecomplement_0 +store 6 +frame_dig -1 +load 5 +concat +load 6 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 4294967295 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 4294967296 +< +assert +retsub + +// numerical_comp +numericalcomp_4: +proto 1 1 +int 0 +int 65535 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 65536 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_(uint8).teal rename to tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal new file mode 100644 index 000000000..4a8d567ff --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8)_v8.teal @@ -0,0 +1,62 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 2 +load 2 +callsub roundtripper_1 +store 1 +byte 0x151f7c75 +load 1 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbyte +store 0 +load 0 +callsub numericalcomp_2 +store 0 +byte 0x00 +int 0 +load 0 +setbyte +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 3 +load 3 +callsub tuplecomplement_0 +store 4 +frame_dig -1 +load 3 +concat +load 4 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool).teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool).teal deleted file mode 100644 index 251e70b5e..000000000 --- a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool).teal +++ /dev/null @@ -1,111 +0,0 @@ -#pragma version 6 -txna ApplicationArgs 0 // [uint8|byte|bool] -store 4 // 4 -> uint8|byte|bool -load 4 // [uint8|byte|bool] -callsub roundtripper_1 // [uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool] -store 3 // 3 -> uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool -byte 0x151f7c75 // [0x151f7c75] -load 3 // [0x151f7c75, uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool] -concat // [0x151f7c75 | uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool] -log // log(0x151f7c75 | uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool) -int 1 // [1] -return // PASSED - -// tuple_complement -tuplecomplement_0: // [uint8|byte|bool] -store 9 // 9 -> uint8|byte|bool -load 9 // [uint8|byte|bool] -int 0 // [uint8|byte|bool, 0] -getbyte // [uint8] -store 0 // 0 -> uint8 -load 9 // [uint8|byte|bool] -int 1 // [uint8|byte|bool, 1] -getbyte // [byte] -store 1 // 1 -> byte -load 9 // [uint8|byte|bool] -int 16 // [uint8|byte|bool, 16] -getbit // bool -store 2 // 2 -> bool -load 0 // [uint8] -callsub numericalcomp_2 // [255 - uint8] -store 0 // 0 -> 255 - uint8 -load 1 // [byte] -callsub numericalcomp_3 // [255 - byte] -store 1 // 1 -> 255 - byte -load 2 // [bool] -callsub boolcomp_4 // [!bool] -store 2 // 2 -> !bool -byte 0x00 // [0x00] -int 0 // [0x00, 0] -load 0 // [0x00, 0, 255 - uint8] -setbyte // [255 - uint8] -byte 0x00 // [255 - uint8, 0x00] -int 0 // [255 - uint8, 0x00, 0] -load 1 // [255 - uint8, 0x00, 0, 255 - byte] -setbyte // [255 - uint8, 255 - byte] -concat // [255 - uint8 | 255 - byte] -byte 0x00 // [255 - uint8 | 255 - byte, 0x00] -int 0 // [255 - uint8 | 255 - byte, 0x00, 0] -load 2 // [255 - uint8 | 255 - byte, 0x00, 0, !bool] -setbit // [255 - uint8 | 255 - byte, !bool] -concat // [255 - uint8 | 255 - byte | !bool] -store 10 // 10 -> 255 - uint8 | 255 - byte | !bool -load 10 // [255 - uint8 | 255 - byte | !bool] -retsub - -// round_tripper -roundtripper_1: // [uint8|byte|bool] -store 5 // 5 -> uint8|byte|bool -load 5 // [uint8|byte|bool] -callsub tuplecomplement_0 // [255 - uint8 | 255 - byte | !bool] -store 7 // 7 -> 255 - uint8 | 255 - byte | !bool -load 7 // [255 - uint8 | 255 - byte | !bool] -callsub tuplecomplement_0 // [255 - (255 - uint8) | 255 - (255 - byte) | !!bool] -store 8 // 8 -> uint8|byte|bool -load 5 // [uint8|byte|bool] -load 7 // [uint8|byte|bool, 255 - uint8 | 255 - byte | !bool] -concat // [uint8|byte|bool | 255 - uint8 | 255 - byte | !bool] -load 8 // [uint8|byte|bool | 255 - uint8 | 255 - byte | !bool, uint8|byte|bool] -concat // [uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool] -store 6 // 6 -> uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool -load 6 // [uint8|byte|bool | 255 - uint8 | 255 - byte | !bool | uint8|byte|bool] -retsub - -// numerical_comp -numericalcomp_2: // [uint8] -store 11 // 11 -> uint8 -int 255 // [255] -load 11 // [255, uint8] -- // [255 - uint8] -store 12 // 12 -> 255 - uint8 -load 12 // [255 - uint8] -int 256 // [255 - uint8, 256] -< // [1] -assert // [] -load 12 // [255 - uint8] -retsub - -// numerical_comp -numericalcomp_3: // [byte] -store 13 // 13 -> byte -int 255 // [255] -load 13 // [255, byte] -- // [255 - byte] -store 14 // 14 -> 255 - byte -load 14 // [255 - byte] -int 256 // [255 - byte, 256] -< // [1] -assert // [] -load 14 // [255 - byte] -retsub - -// bool_comp -boolcomp_4: // [bool] -store 15 // 15 -> bool -load 15 // [bool] -! // [!bool] -! -! -store 16 // 16 -> !bool -load 16 // [!bool] -retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v6.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v6.teal new file mode 100644 index 000000000..d2f050703 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v6.teal @@ -0,0 +1,111 @@ +#pragma version 6 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +store 9 +load 9 +int 0 +getbyte +store 0 +load 9 +int 1 +getbyte +store 1 +load 9 +int 16 +getbit +store 2 +load 0 +callsub numericalcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub boolcomp_4 +store 2 +byte 0x00 +int 0 +load 0 +setbyte +byte 0x00 +int 0 +load 1 +setbyte +concat +byte 0x00 +int 0 +load 2 +setbit +concat +store 10 +load 10 +retsub + +// round_tripper +roundtripper_1: +store 5 +load 5 +callsub tuplecomplement_0 +store 7 +load 7 +callsub tuplecomplement_0 +store 8 +load 5 +load 7 +concat +load 8 +concat +store 6 +load 6 +retsub + +// numerical_comp +numericalcomp_2: +store 11 +int 255 +load 11 +- +store 12 +load 12 +int 256 +< +assert +load 12 +retsub + +// numerical_comp +numericalcomp_3: +store 13 +int 255 +load 13 +- +store 14 +load 14 +int 256 +< +assert +load 14 +retsub + +// bool_comp +boolcomp_4: +store 15 +load 15 +! +! +! +store 16 +load 16 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal new file mode 100644 index 000000000..853a8b269 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_(uint8,byte,bool)_v8.teal @@ -0,0 +1,111 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 4 +load 4 +callsub roundtripper_1 +store 3 +byte 0x151f7c75 +load 3 +concat +log +int 1 +return + +// tuple_complement +tuplecomplement_0: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbyte +store 0 +frame_dig -1 +int 1 +getbyte +store 1 +frame_dig -1 +int 16 +getbit +store 2 +load 0 +callsub numericalcomp_2 +store 0 +load 1 +callsub numericalcomp_3 +store 1 +load 2 +callsub boolcomp_4 +store 2 +byte 0x00 +int 0 +load 0 +setbyte +byte 0x00 +int 0 +load 1 +setbyte +concat +byte 0x00 +int 0 +load 2 +setbit +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub tuplecomplement_0 +store 5 +load 5 +callsub tuplecomplement_0 +store 6 +frame_dig -1 +load 5 +concat +load 6 +concat +frame_bury 0 +retsub + +// numerical_comp +numericalcomp_2: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// numerical_comp +numericalcomp_3: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// bool_comp +boolcomp_4: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address[]_10.teal b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_address[]_10.teal rename to tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal new file mode 100644 index 000000000..d58d71f84 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_address[]_10_v8.teal @@ -0,0 +1,698 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_3 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 19 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 20 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 21 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 22 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 23 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 24 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 25 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 26 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 27 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 28 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 29 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 35 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 36 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 37 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 38 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 39 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 40 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 41 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 42 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 43 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 44 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 45 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 46 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 47 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 48 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 49 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 50 +load 19 +callsub numericalcomp_0 +store 19 +load 20 +callsub numericalcomp_0 +store 20 +load 21 +callsub numericalcomp_0 +store 21 +load 22 +callsub numericalcomp_0 +store 22 +load 23 +callsub numericalcomp_0 +store 23 +load 24 +callsub numericalcomp_0 +store 24 +load 25 +callsub numericalcomp_0 +store 25 +load 26 +callsub numericalcomp_0 +store 26 +load 27 +callsub numericalcomp_0 +store 27 +load 28 +callsub numericalcomp_0 +store 28 +load 29 +callsub numericalcomp_0 +store 29 +load 30 +callsub numericalcomp_0 +store 30 +load 31 +callsub numericalcomp_0 +store 31 +load 32 +callsub numericalcomp_0 +store 32 +load 33 +callsub numericalcomp_0 +store 33 +load 34 +callsub numericalcomp_0 +store 34 +load 35 +callsub numericalcomp_0 +store 35 +load 36 +callsub numericalcomp_0 +store 36 +load 37 +callsub numericalcomp_0 +store 37 +load 38 +callsub numericalcomp_0 +store 38 +load 39 +callsub numericalcomp_0 +store 39 +load 40 +callsub numericalcomp_0 +store 40 +load 41 +callsub numericalcomp_0 +store 41 +load 42 +callsub numericalcomp_0 +store 42 +load 43 +callsub numericalcomp_0 +store 43 +load 44 +callsub numericalcomp_0 +store 44 +load 45 +callsub numericalcomp_0 +store 45 +load 46 +callsub numericalcomp_0 +store 46 +load 47 +callsub numericalcomp_0 +store 47 +load 48 +callsub numericalcomp_0 +store 48 +load 49 +callsub numericalcomp_0 +store 49 +load 50 +callsub numericalcomp_0 +store 50 +byte 0x00 +int 0 +load 19 +setbyte +byte 0x00 +int 0 +load 20 +setbyte +concat +byte 0x00 +int 0 +load 21 +setbyte +concat +byte 0x00 +int 0 +load 22 +setbyte +concat +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +byte 0x00 +int 0 +load 26 +setbyte +concat +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +byte 0x00 +int 0 +load 44 +setbyte +concat +byte 0x00 +int 0 +load 45 +setbyte +concat +byte 0x00 +int 0 +load 46 +setbyte +concat +byte 0x00 +int 0 +load 47 +setbyte +concat +byte 0x00 +int 0 +load 48 +setbyte +concat +byte 0x00 +int 0 +load 49 +setbyte +concat +byte 0x00 +int 0 +load 50 +setbyte +concat +frame_bury 0 +retsub + +// array_complement +arraycomplement_2: +proto 1 1 +byte "" +frame_dig -1 +int 32 +int 0 +* +int 2 ++ +int 32 +extract3 +store 8 +frame_dig -1 +int 32 +int 1 +* +int 2 ++ +int 32 +extract3 +store 9 +frame_dig -1 +int 32 +int 2 +* +int 2 ++ +int 32 +extract3 +store 10 +frame_dig -1 +int 32 +int 3 +* +int 2 ++ +int 32 +extract3 +store 11 +frame_dig -1 +int 32 +int 4 +* +int 2 ++ +int 32 +extract3 +store 12 +frame_dig -1 +int 32 +int 5 +* +int 2 ++ +int 32 +extract3 +store 13 +frame_dig -1 +int 32 +int 6 +* +int 2 ++ +int 32 +extract3 +store 14 +frame_dig -1 +int 32 +int 7 +* +int 2 ++ +int 32 +extract3 +store 15 +frame_dig -1 +int 32 +int 8 +* +int 2 ++ +int 32 +extract3 +store 16 +frame_dig -1 +int 32 +int 9 +* +int 2 ++ +int 32 +extract3 +store 17 +load 8 +callsub arraycomplement_1 +store 8 +load 9 +callsub arraycomplement_1 +store 9 +load 10 +callsub arraycomplement_1 +store 10 +load 11 +callsub arraycomplement_1 +store 11 +load 12 +callsub arraycomplement_1 +store 12 +load 13 +callsub arraycomplement_1 +store 13 +load 14 +callsub arraycomplement_1 +store 14 +load 15 +callsub arraycomplement_1 +store 15 +load 16 +callsub arraycomplement_1 +store 16 +load 17 +callsub arraycomplement_1 +store 17 +int 10 +store 18 +load 18 +itob +extract 6 0 +load 8 +load 9 +concat +load 10 +concat +load 11 +concat +load 12 +concat +load 13 +concat +load 14 +concat +load 15 +concat +load 16 +concat +load 17 +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_3: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_2 +store 2 +load 2 +callsub arraycomplement_2 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address.teal b/tests/integration/teal/roundtrip/app_roundtrip_address_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_address.teal rename to tests/integration/teal/roundtrip/app_roundtrip_address_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal new file mode 100644 index 000000000..0ebe72b72 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_address_v8.teal @@ -0,0 +1,498 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 4 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 5 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 6 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 7 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 8 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 9 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 10 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 11 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 12 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 13 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 14 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 15 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 16 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 17 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 18 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 19 +frame_dig -1 +int 1 +int 16 +* +getbyte +store 20 +frame_dig -1 +int 1 +int 17 +* +getbyte +store 21 +frame_dig -1 +int 1 +int 18 +* +getbyte +store 22 +frame_dig -1 +int 1 +int 19 +* +getbyte +store 23 +frame_dig -1 +int 1 +int 20 +* +getbyte +store 24 +frame_dig -1 +int 1 +int 21 +* +getbyte +store 25 +frame_dig -1 +int 1 +int 22 +* +getbyte +store 26 +frame_dig -1 +int 1 +int 23 +* +getbyte +store 27 +frame_dig -1 +int 1 +int 24 +* +getbyte +store 28 +frame_dig -1 +int 1 +int 25 +* +getbyte +store 29 +frame_dig -1 +int 1 +int 26 +* +getbyte +store 30 +frame_dig -1 +int 1 +int 27 +* +getbyte +store 31 +frame_dig -1 +int 1 +int 28 +* +getbyte +store 32 +frame_dig -1 +int 1 +int 29 +* +getbyte +store 33 +frame_dig -1 +int 1 +int 30 +* +getbyte +store 34 +frame_dig -1 +int 1 +int 31 +* +getbyte +store 35 +load 4 +callsub numericalcomp_0 +store 4 +load 5 +callsub numericalcomp_0 +store 5 +load 6 +callsub numericalcomp_0 +store 6 +load 7 +callsub numericalcomp_0 +store 7 +load 8 +callsub numericalcomp_0 +store 8 +load 9 +callsub numericalcomp_0 +store 9 +load 10 +callsub numericalcomp_0 +store 10 +load 11 +callsub numericalcomp_0 +store 11 +load 12 +callsub numericalcomp_0 +store 12 +load 13 +callsub numericalcomp_0 +store 13 +load 14 +callsub numericalcomp_0 +store 14 +load 15 +callsub numericalcomp_0 +store 15 +load 16 +callsub numericalcomp_0 +store 16 +load 17 +callsub numericalcomp_0 +store 17 +load 18 +callsub numericalcomp_0 +store 18 +load 19 +callsub numericalcomp_0 +store 19 +load 20 +callsub numericalcomp_0 +store 20 +load 21 +callsub numericalcomp_0 +store 21 +load 22 +callsub numericalcomp_0 +store 22 +load 23 +callsub numericalcomp_0 +store 23 +load 24 +callsub numericalcomp_0 +store 24 +load 25 +callsub numericalcomp_0 +store 25 +load 26 +callsub numericalcomp_0 +store 26 +load 27 +callsub numericalcomp_0 +store 27 +load 28 +callsub numericalcomp_0 +store 28 +load 29 +callsub numericalcomp_0 +store 29 +load 30 +callsub numericalcomp_0 +store 30 +load 31 +callsub numericalcomp_0 +store 31 +load 32 +callsub numericalcomp_0 +store 32 +load 33 +callsub numericalcomp_0 +store 33 +load 34 +callsub numericalcomp_0 +store 34 +load 35 +callsub numericalcomp_0 +store 35 +byte 0x00 +int 0 +load 4 +setbyte +byte 0x00 +int 0 +load 5 +setbyte +concat +byte 0x00 +int 0 +load 6 +setbyte +concat +byte 0x00 +int 0 +load 7 +setbyte +concat +byte 0x00 +int 0 +load 8 +setbyte +concat +byte 0x00 +int 0 +load 9 +setbyte +concat +byte 0x00 +int 0 +load 10 +setbyte +concat +byte 0x00 +int 0 +load 11 +setbyte +concat +byte 0x00 +int 0 +load 12 +setbyte +concat +byte 0x00 +int 0 +load 13 +setbyte +concat +byte 0x00 +int 0 +load 14 +setbyte +concat +byte 0x00 +int 0 +load 15 +setbyte +concat +byte 0x00 +int 0 +load 16 +setbyte +concat +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +byte 0x00 +int 0 +load 20 +setbyte +concat +byte 0x00 +int 0 +load 21 +setbyte +concat +byte 0x00 +int 0 +load 22 +setbyte +concat +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +byte 0x00 +int 0 +load 26 +setbyte +concat +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[1].teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool[1].teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal new file mode 100644 index 000000000..3458bde41 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[1]_v8.teal @@ -0,0 +1,59 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// bool_comp +boolcomp_0: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 4 +load 4 +callsub boolcomp_0 +store 4 +byte 0x00 +int 0 +load 4 +setbit +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11.teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal new file mode 100644 index 000000000..64bd1f049 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[3][]_11_v8.teal @@ -0,0 +1,293 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_3 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// bool_comp +boolcomp_0: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 20 +frame_dig -1 +int 1 +getbit +store 21 +frame_dig -1 +int 2 +getbit +store 22 +load 20 +callsub boolcomp_0 +store 20 +load 21 +callsub boolcomp_0 +store 21 +load 22 +callsub boolcomp_0 +store 22 +byte 0x00 +int 0 +load 20 +setbit +int 1 +load 21 +setbit +int 2 +load 22 +setbit +frame_bury 0 +retsub + +// array_complement +arraycomplement_2: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +int 1 +extract3 +store 8 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +int 1 +extract3 +store 9 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +int 1 +extract3 +store 10 +frame_dig -1 +int 1 +int 3 +* +int 2 ++ +int 1 +extract3 +store 11 +frame_dig -1 +int 1 +int 4 +* +int 2 ++ +int 1 +extract3 +store 12 +frame_dig -1 +int 1 +int 5 +* +int 2 ++ +int 1 +extract3 +store 13 +frame_dig -1 +int 1 +int 6 +* +int 2 ++ +int 1 +extract3 +store 14 +frame_dig -1 +int 1 +int 7 +* +int 2 ++ +int 1 +extract3 +store 15 +frame_dig -1 +int 1 +int 8 +* +int 2 ++ +int 1 +extract3 +store 16 +frame_dig -1 +int 1 +int 9 +* +int 2 ++ +int 1 +extract3 +store 17 +frame_dig -1 +int 1 +int 10 +* +int 2 ++ +int 1 +extract3 +store 18 +load 8 +callsub arraycomplement_1 +store 8 +load 9 +callsub arraycomplement_1 +store 9 +load 10 +callsub arraycomplement_1 +store 10 +load 11 +callsub arraycomplement_1 +store 11 +load 12 +callsub arraycomplement_1 +store 12 +load 13 +callsub arraycomplement_1 +store 13 +load 14 +callsub arraycomplement_1 +store 14 +load 15 +callsub arraycomplement_1 +store 15 +load 16 +callsub arraycomplement_1 +store 16 +load 17 +callsub arraycomplement_1 +store 17 +load 18 +callsub arraycomplement_1 +store 18 +int 11 +store 19 +load 19 +itob +extract 6 0 +load 8 +load 9 +concat +load 10 +concat +load 11 +concat +load 12 +concat +load 13 +concat +load 14 +concat +load 15 +concat +load 16 +concat +load 17 +concat +load 18 +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_3: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_2 +store 2 +load 2 +callsub arraycomplement_2 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[42].teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool[42].teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal new file mode 100644 index 000000000..a215df488 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[42]_v8.teal @@ -0,0 +1,469 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// bool_comp +boolcomp_0: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 0 +getbit +store 4 +frame_dig -1 +int 1 +getbit +store 5 +frame_dig -1 +int 2 +getbit +store 6 +frame_dig -1 +int 3 +getbit +store 7 +frame_dig -1 +int 4 +getbit +store 8 +frame_dig -1 +int 5 +getbit +store 9 +frame_dig -1 +int 6 +getbit +store 10 +frame_dig -1 +int 7 +getbit +store 11 +frame_dig -1 +int 8 +getbit +store 12 +frame_dig -1 +int 9 +getbit +store 13 +frame_dig -1 +int 10 +getbit +store 14 +frame_dig -1 +int 11 +getbit +store 15 +frame_dig -1 +int 12 +getbit +store 16 +frame_dig -1 +int 13 +getbit +store 17 +frame_dig -1 +int 14 +getbit +store 18 +frame_dig -1 +int 15 +getbit +store 19 +frame_dig -1 +int 16 +getbit +store 20 +frame_dig -1 +int 17 +getbit +store 21 +frame_dig -1 +int 18 +getbit +store 22 +frame_dig -1 +int 19 +getbit +store 23 +frame_dig -1 +int 20 +getbit +store 24 +frame_dig -1 +int 21 +getbit +store 25 +frame_dig -1 +int 22 +getbit +store 26 +frame_dig -1 +int 23 +getbit +store 27 +frame_dig -1 +int 24 +getbit +store 28 +frame_dig -1 +int 25 +getbit +store 29 +frame_dig -1 +int 26 +getbit +store 30 +frame_dig -1 +int 27 +getbit +store 31 +frame_dig -1 +int 28 +getbit +store 32 +frame_dig -1 +int 29 +getbit +store 33 +frame_dig -1 +int 30 +getbit +store 34 +frame_dig -1 +int 31 +getbit +store 35 +frame_dig -1 +int 32 +getbit +store 36 +frame_dig -1 +int 33 +getbit +store 37 +frame_dig -1 +int 34 +getbit +store 38 +frame_dig -1 +int 35 +getbit +store 39 +frame_dig -1 +int 36 +getbit +store 40 +frame_dig -1 +int 37 +getbit +store 41 +frame_dig -1 +int 38 +getbit +store 42 +frame_dig -1 +int 39 +getbit +store 43 +frame_dig -1 +int 40 +getbit +store 44 +frame_dig -1 +int 41 +getbit +store 45 +load 4 +callsub boolcomp_0 +store 4 +load 5 +callsub boolcomp_0 +store 5 +load 6 +callsub boolcomp_0 +store 6 +load 7 +callsub boolcomp_0 +store 7 +load 8 +callsub boolcomp_0 +store 8 +load 9 +callsub boolcomp_0 +store 9 +load 10 +callsub boolcomp_0 +store 10 +load 11 +callsub boolcomp_0 +store 11 +load 12 +callsub boolcomp_0 +store 12 +load 13 +callsub boolcomp_0 +store 13 +load 14 +callsub boolcomp_0 +store 14 +load 15 +callsub boolcomp_0 +store 15 +load 16 +callsub boolcomp_0 +store 16 +load 17 +callsub boolcomp_0 +store 17 +load 18 +callsub boolcomp_0 +store 18 +load 19 +callsub boolcomp_0 +store 19 +load 20 +callsub boolcomp_0 +store 20 +load 21 +callsub boolcomp_0 +store 21 +load 22 +callsub boolcomp_0 +store 22 +load 23 +callsub boolcomp_0 +store 23 +load 24 +callsub boolcomp_0 +store 24 +load 25 +callsub boolcomp_0 +store 25 +load 26 +callsub boolcomp_0 +store 26 +load 27 +callsub boolcomp_0 +store 27 +load 28 +callsub boolcomp_0 +store 28 +load 29 +callsub boolcomp_0 +store 29 +load 30 +callsub boolcomp_0 +store 30 +load 31 +callsub boolcomp_0 +store 31 +load 32 +callsub boolcomp_0 +store 32 +load 33 +callsub boolcomp_0 +store 33 +load 34 +callsub boolcomp_0 +store 34 +load 35 +callsub boolcomp_0 +store 35 +load 36 +callsub boolcomp_0 +store 36 +load 37 +callsub boolcomp_0 +store 37 +load 38 +callsub boolcomp_0 +store 38 +load 39 +callsub boolcomp_0 +store 39 +load 40 +callsub boolcomp_0 +store 40 +load 41 +callsub boolcomp_0 +store 41 +load 42 +callsub boolcomp_0 +store 42 +load 43 +callsub boolcomp_0 +store 43 +load 44 +callsub boolcomp_0 +store 44 +load 45 +callsub boolcomp_0 +store 45 +byte 0x000000000000 +int 0 +load 4 +setbit +int 1 +load 5 +setbit +int 2 +load 6 +setbit +int 3 +load 7 +setbit +int 4 +load 8 +setbit +int 5 +load 9 +setbit +int 6 +load 10 +setbit +int 7 +load 11 +setbit +int 8 +load 12 +setbit +int 9 +load 13 +setbit +int 10 +load 14 +setbit +int 11 +load 15 +setbit +int 12 +load 16 +setbit +int 13 +load 17 +setbit +int 14 +load 18 +setbit +int 15 +load 19 +setbit +int 16 +load 20 +setbit +int 17 +load 21 +setbit +int 18 +load 22 +setbit +int 19 +load 23 +setbit +int 20 +load 24 +setbit +int 21 +load 25 +setbit +int 22 +load 26 +setbit +int 23 +load 27 +setbit +int 24 +load 28 +setbit +int 25 +load 29 +setbit +int 26 +load 30 +setbit +int 27 +load 31 +setbit +int 28 +load 32 +setbit +int 29 +load 33 +setbit +int 30 +load 34 +setbit +int 31 +load 35 +setbit +int 32 +load 36 +setbit +int 33 +load 37 +setbit +int 34 +load 38 +setbit +int 35 +load 39 +setbit +int 36 +load 40 +setbit +int 37 +load 41 +setbit +int 38 +load 42 +setbit +int 39 +load 43 +setbit +int 40 +load 44 +setbit +int 41 +load 45 +setbit +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool[]_0.teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal new file mode 100644 index 000000000..87f935c92 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_0_v8.teal @@ -0,0 +1,92 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// array_complement +arraycomplement_0: +proto 1 1 +byte "" +int 0 +store 8 +load 8 +itob +extract 6 0 +byte "" +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_0 +store 2 +load 2 +callsub arraycomplement_0 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool[]_1.teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal new file mode 100644 index 000000000..9b403483f --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_1_v8.teal @@ -0,0 +1,115 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// bool_comp +boolcomp_0: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 0 +int 16 ++ +getbit +store 8 +load 8 +callsub boolcomp_0 +store 8 +int 1 +store 9 +load 9 +itob +extract 6 0 +byte 0x00 +int 0 +load 8 +setbit +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool[]_42.teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal new file mode 100644 index 000000000..a2a6821c4 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool[]_42_v8.teal @@ -0,0 +1,607 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// bool_comp +boolcomp_0: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 0 +int 16 ++ +getbit +store 8 +frame_dig -1 +int 1 +int 16 ++ +getbit +store 9 +frame_dig -1 +int 2 +int 16 ++ +getbit +store 10 +frame_dig -1 +int 3 +int 16 ++ +getbit +store 11 +frame_dig -1 +int 4 +int 16 ++ +getbit +store 12 +frame_dig -1 +int 5 +int 16 ++ +getbit +store 13 +frame_dig -1 +int 6 +int 16 ++ +getbit +store 14 +frame_dig -1 +int 7 +int 16 ++ +getbit +store 15 +frame_dig -1 +int 8 +int 16 ++ +getbit +store 16 +frame_dig -1 +int 9 +int 16 ++ +getbit +store 17 +frame_dig -1 +int 10 +int 16 ++ +getbit +store 18 +frame_dig -1 +int 11 +int 16 ++ +getbit +store 19 +frame_dig -1 +int 12 +int 16 ++ +getbit +store 20 +frame_dig -1 +int 13 +int 16 ++ +getbit +store 21 +frame_dig -1 +int 14 +int 16 ++ +getbit +store 22 +frame_dig -1 +int 15 +int 16 ++ +getbit +store 23 +frame_dig -1 +int 16 +int 16 ++ +getbit +store 24 +frame_dig -1 +int 17 +int 16 ++ +getbit +store 25 +frame_dig -1 +int 18 +int 16 ++ +getbit +store 26 +frame_dig -1 +int 19 +int 16 ++ +getbit +store 27 +frame_dig -1 +int 20 +int 16 ++ +getbit +store 28 +frame_dig -1 +int 21 +int 16 ++ +getbit +store 29 +frame_dig -1 +int 22 +int 16 ++ +getbit +store 30 +frame_dig -1 +int 23 +int 16 ++ +getbit +store 31 +frame_dig -1 +int 24 +int 16 ++ +getbit +store 32 +frame_dig -1 +int 25 +int 16 ++ +getbit +store 33 +frame_dig -1 +int 26 +int 16 ++ +getbit +store 34 +frame_dig -1 +int 27 +int 16 ++ +getbit +store 35 +frame_dig -1 +int 28 +int 16 ++ +getbit +store 36 +frame_dig -1 +int 29 +int 16 ++ +getbit +store 37 +frame_dig -1 +int 30 +int 16 ++ +getbit +store 38 +frame_dig -1 +int 31 +int 16 ++ +getbit +store 39 +frame_dig -1 +int 32 +int 16 ++ +getbit +store 40 +frame_dig -1 +int 33 +int 16 ++ +getbit +store 41 +frame_dig -1 +int 34 +int 16 ++ +getbit +store 42 +frame_dig -1 +int 35 +int 16 ++ +getbit +store 43 +frame_dig -1 +int 36 +int 16 ++ +getbit +store 44 +frame_dig -1 +int 37 +int 16 ++ +getbit +store 45 +frame_dig -1 +int 38 +int 16 ++ +getbit +store 46 +frame_dig -1 +int 39 +int 16 ++ +getbit +store 47 +frame_dig -1 +int 40 +int 16 ++ +getbit +store 48 +frame_dig -1 +int 41 +int 16 ++ +getbit +store 49 +load 8 +callsub boolcomp_0 +store 8 +load 9 +callsub boolcomp_0 +store 9 +load 10 +callsub boolcomp_0 +store 10 +load 11 +callsub boolcomp_0 +store 11 +load 12 +callsub boolcomp_0 +store 12 +load 13 +callsub boolcomp_0 +store 13 +load 14 +callsub boolcomp_0 +store 14 +load 15 +callsub boolcomp_0 +store 15 +load 16 +callsub boolcomp_0 +store 16 +load 17 +callsub boolcomp_0 +store 17 +load 18 +callsub boolcomp_0 +store 18 +load 19 +callsub boolcomp_0 +store 19 +load 20 +callsub boolcomp_0 +store 20 +load 21 +callsub boolcomp_0 +store 21 +load 22 +callsub boolcomp_0 +store 22 +load 23 +callsub boolcomp_0 +store 23 +load 24 +callsub boolcomp_0 +store 24 +load 25 +callsub boolcomp_0 +store 25 +load 26 +callsub boolcomp_0 +store 26 +load 27 +callsub boolcomp_0 +store 27 +load 28 +callsub boolcomp_0 +store 28 +load 29 +callsub boolcomp_0 +store 29 +load 30 +callsub boolcomp_0 +store 30 +load 31 +callsub boolcomp_0 +store 31 +load 32 +callsub boolcomp_0 +store 32 +load 33 +callsub boolcomp_0 +store 33 +load 34 +callsub boolcomp_0 +store 34 +load 35 +callsub boolcomp_0 +store 35 +load 36 +callsub boolcomp_0 +store 36 +load 37 +callsub boolcomp_0 +store 37 +load 38 +callsub boolcomp_0 +store 38 +load 39 +callsub boolcomp_0 +store 39 +load 40 +callsub boolcomp_0 +store 40 +load 41 +callsub boolcomp_0 +store 41 +load 42 +callsub boolcomp_0 +store 42 +load 43 +callsub boolcomp_0 +store 43 +load 44 +callsub boolcomp_0 +store 44 +load 45 +callsub boolcomp_0 +store 45 +load 46 +callsub boolcomp_0 +store 46 +load 47 +callsub boolcomp_0 +store 47 +load 48 +callsub boolcomp_0 +store 48 +load 49 +callsub boolcomp_0 +store 49 +int 42 +store 50 +load 50 +itob +extract 6 0 +byte 0x000000000000 +int 0 +load 8 +setbit +int 1 +load 9 +setbit +int 2 +load 10 +setbit +int 3 +load 11 +setbit +int 4 +load 12 +setbit +int 5 +load 13 +setbit +int 6 +load 14 +setbit +int 7 +load 15 +setbit +int 8 +load 16 +setbit +int 9 +load 17 +setbit +int 10 +load 18 +setbit +int 11 +load 19 +setbit +int 12 +load 20 +setbit +int 13 +load 21 +setbit +int 14 +load 22 +setbit +int 15 +load 23 +setbit +int 16 +load 24 +setbit +int 17 +load 25 +setbit +int 18 +load 26 +setbit +int 19 +load 27 +setbit +int 20 +load 28 +setbit +int 21 +load 29 +setbit +int 22 +load 30 +setbit +int 23 +load 31 +setbit +int 24 +load 32 +setbit +int 25 +load 33 +setbit +int 26 +load 34 +setbit +int 27 +load 35 +setbit +int 28 +load 36 +setbit +int 29 +load 37 +setbit +int 30 +load 38 +setbit +int 31 +load 39 +setbit +int 32 +load 40 +setbit +int 33 +load 41 +setbit +int 34 +load 42 +setbit +int 35 +load 43 +setbit +int 36 +load 44 +setbit +int 37 +load 45 +setbit +int 38 +load 46 +setbit +int 39 +load 47 +setbit +int 40 +load 48 +setbit +int 41 +load 49 +setbit +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_bool.teal rename to tests/integration/teal/roundtrip/app_roundtrip_bool_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal new file mode 100644 index 000000000..5e08ac3d2 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_bool_v8.teal @@ -0,0 +1,50 @@ +#pragma version 8 +txna ApplicationArgs 0 +int 0 +int 8 +* +getbit +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// bool_comp +boolcomp_0: +proto 1 1 +int 0 +frame_dig -1 +! +! +! +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub boolcomp_0 +store 2 +load 2 +callsub boolcomp_0 +store 3 +byte 0x00 +int 0 +frame_dig -1 +setbit +int 1 +load 2 +setbit +int 2 +load 3 +setbit +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[16].teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_byte[16].teal rename to tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal new file mode 100644 index 000000000..86fa73f5a --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte[16]_v8.teal @@ -0,0 +1,274 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +getbyte +store 4 +frame_dig -1 +int 1 +int 1 +* +getbyte +store 5 +frame_dig -1 +int 1 +int 2 +* +getbyte +store 6 +frame_dig -1 +int 1 +int 3 +* +getbyte +store 7 +frame_dig -1 +int 1 +int 4 +* +getbyte +store 8 +frame_dig -1 +int 1 +int 5 +* +getbyte +store 9 +frame_dig -1 +int 1 +int 6 +* +getbyte +store 10 +frame_dig -1 +int 1 +int 7 +* +getbyte +store 11 +frame_dig -1 +int 1 +int 8 +* +getbyte +store 12 +frame_dig -1 +int 1 +int 9 +* +getbyte +store 13 +frame_dig -1 +int 1 +int 10 +* +getbyte +store 14 +frame_dig -1 +int 1 +int 11 +* +getbyte +store 15 +frame_dig -1 +int 1 +int 12 +* +getbyte +store 16 +frame_dig -1 +int 1 +int 13 +* +getbyte +store 17 +frame_dig -1 +int 1 +int 14 +* +getbyte +store 18 +frame_dig -1 +int 1 +int 15 +* +getbyte +store 19 +load 4 +callsub numericalcomp_0 +store 4 +load 5 +callsub numericalcomp_0 +store 5 +load 6 +callsub numericalcomp_0 +store 6 +load 7 +callsub numericalcomp_0 +store 7 +load 8 +callsub numericalcomp_0 +store 8 +load 9 +callsub numericalcomp_0 +store 9 +load 10 +callsub numericalcomp_0 +store 10 +load 11 +callsub numericalcomp_0 +store 11 +load 12 +callsub numericalcomp_0 +store 12 +load 13 +callsub numericalcomp_0 +store 13 +load 14 +callsub numericalcomp_0 +store 14 +load 15 +callsub numericalcomp_0 +store 15 +load 16 +callsub numericalcomp_0 +store 16 +load 17 +callsub numericalcomp_0 +store 17 +load 18 +callsub numericalcomp_0 +store 18 +load 19 +callsub numericalcomp_0 +store 19 +byte 0x00 +int 0 +load 4 +setbyte +byte 0x00 +int 0 +load 5 +setbyte +concat +byte 0x00 +int 0 +load 6 +setbyte +concat +byte 0x00 +int 0 +load 7 +setbyte +concat +byte 0x00 +int 0 +load 8 +setbyte +concat +byte 0x00 +int 0 +load 9 +setbyte +concat +byte 0x00 +int 0 +load 10 +setbyte +concat +byte 0x00 +int 0 +load 11 +setbyte +concat +byte 0x00 +int 0 +load 12 +setbyte +concat +byte 0x00 +int 0 +load 13 +setbyte +concat +byte 0x00 +int 0 +load 14 +setbyte +concat +byte 0x00 +int 0 +load 15 +setbyte +concat +byte 0x00 +int 0 +load 16 +setbyte +concat +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_byte[]_36.teal rename to tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal new file mode 100644 index 000000000..3b92e3e84 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte[]_36_v8.teal @@ -0,0 +1,680 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 8 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 9 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 10 +frame_dig -1 +int 1 +int 3 +* +int 2 ++ +getbyte +store 11 +frame_dig -1 +int 1 +int 4 +* +int 2 ++ +getbyte +store 12 +frame_dig -1 +int 1 +int 5 +* +int 2 ++ +getbyte +store 13 +frame_dig -1 +int 1 +int 6 +* +int 2 ++ +getbyte +store 14 +frame_dig -1 +int 1 +int 7 +* +int 2 ++ +getbyte +store 15 +frame_dig -1 +int 1 +int 8 +* +int 2 ++ +getbyte +store 16 +frame_dig -1 +int 1 +int 9 +* +int 2 ++ +getbyte +store 17 +frame_dig -1 +int 1 +int 10 +* +int 2 ++ +getbyte +store 18 +frame_dig -1 +int 1 +int 11 +* +int 2 ++ +getbyte +store 19 +frame_dig -1 +int 1 +int 12 +* +int 2 ++ +getbyte +store 20 +frame_dig -1 +int 1 +int 13 +* +int 2 ++ +getbyte +store 21 +frame_dig -1 +int 1 +int 14 +* +int 2 ++ +getbyte +store 22 +frame_dig -1 +int 1 +int 15 +* +int 2 ++ +getbyte +store 23 +frame_dig -1 +int 1 +int 16 +* +int 2 ++ +getbyte +store 24 +frame_dig -1 +int 1 +int 17 +* +int 2 ++ +getbyte +store 25 +frame_dig -1 +int 1 +int 18 +* +int 2 ++ +getbyte +store 26 +frame_dig -1 +int 1 +int 19 +* +int 2 ++ +getbyte +store 27 +frame_dig -1 +int 1 +int 20 +* +int 2 ++ +getbyte +store 28 +frame_dig -1 +int 1 +int 21 +* +int 2 ++ +getbyte +store 29 +frame_dig -1 +int 1 +int 22 +* +int 2 ++ +getbyte +store 30 +frame_dig -1 +int 1 +int 23 +* +int 2 ++ +getbyte +store 31 +frame_dig -1 +int 1 +int 24 +* +int 2 ++ +getbyte +store 32 +frame_dig -1 +int 1 +int 25 +* +int 2 ++ +getbyte +store 33 +frame_dig -1 +int 1 +int 26 +* +int 2 ++ +getbyte +store 34 +frame_dig -1 +int 1 +int 27 +* +int 2 ++ +getbyte +store 35 +frame_dig -1 +int 1 +int 28 +* +int 2 ++ +getbyte +store 36 +frame_dig -1 +int 1 +int 29 +* +int 2 ++ +getbyte +store 37 +frame_dig -1 +int 1 +int 30 +* +int 2 ++ +getbyte +store 38 +frame_dig -1 +int 1 +int 31 +* +int 2 ++ +getbyte +store 39 +frame_dig -1 +int 1 +int 32 +* +int 2 ++ +getbyte +store 40 +frame_dig -1 +int 1 +int 33 +* +int 2 ++ +getbyte +store 41 +frame_dig -1 +int 1 +int 34 +* +int 2 ++ +getbyte +store 42 +frame_dig -1 +int 1 +int 35 +* +int 2 ++ +getbyte +store 43 +load 8 +callsub numericalcomp_0 +store 8 +load 9 +callsub numericalcomp_0 +store 9 +load 10 +callsub numericalcomp_0 +store 10 +load 11 +callsub numericalcomp_0 +store 11 +load 12 +callsub numericalcomp_0 +store 12 +load 13 +callsub numericalcomp_0 +store 13 +load 14 +callsub numericalcomp_0 +store 14 +load 15 +callsub numericalcomp_0 +store 15 +load 16 +callsub numericalcomp_0 +store 16 +load 17 +callsub numericalcomp_0 +store 17 +load 18 +callsub numericalcomp_0 +store 18 +load 19 +callsub numericalcomp_0 +store 19 +load 20 +callsub numericalcomp_0 +store 20 +load 21 +callsub numericalcomp_0 +store 21 +load 22 +callsub numericalcomp_0 +store 22 +load 23 +callsub numericalcomp_0 +store 23 +load 24 +callsub numericalcomp_0 +store 24 +load 25 +callsub numericalcomp_0 +store 25 +load 26 +callsub numericalcomp_0 +store 26 +load 27 +callsub numericalcomp_0 +store 27 +load 28 +callsub numericalcomp_0 +store 28 +load 29 +callsub numericalcomp_0 +store 29 +load 30 +callsub numericalcomp_0 +store 30 +load 31 +callsub numericalcomp_0 +store 31 +load 32 +callsub numericalcomp_0 +store 32 +load 33 +callsub numericalcomp_0 +store 33 +load 34 +callsub numericalcomp_0 +store 34 +load 35 +callsub numericalcomp_0 +store 35 +load 36 +callsub numericalcomp_0 +store 36 +load 37 +callsub numericalcomp_0 +store 37 +load 38 +callsub numericalcomp_0 +store 38 +load 39 +callsub numericalcomp_0 +store 39 +load 40 +callsub numericalcomp_0 +store 40 +load 41 +callsub numericalcomp_0 +store 41 +load 42 +callsub numericalcomp_0 +store 42 +load 43 +callsub numericalcomp_0 +store 43 +int 36 +store 44 +load 44 +itob +extract 6 0 +byte 0x00 +int 0 +load 8 +setbyte +byte 0x00 +int 0 +load 9 +setbyte +concat +byte 0x00 +int 0 +load 10 +setbyte +concat +byte 0x00 +int 0 +load 11 +setbyte +concat +byte 0x00 +int 0 +load 12 +setbyte +concat +byte 0x00 +int 0 +load 13 +setbyte +concat +byte 0x00 +int 0 +load 14 +setbyte +concat +byte 0x00 +int 0 +load 15 +setbyte +concat +byte 0x00 +int 0 +load 16 +setbyte +concat +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +byte 0x00 +int 0 +load 20 +setbyte +concat +byte 0x00 +int 0 +load 21 +setbyte +concat +byte 0x00 +int 0 +load 22 +setbyte +concat +byte 0x00 +int 0 +load 23 +setbyte +concat +byte 0x00 +int 0 +load 24 +setbyte +concat +byte 0x00 +int 0 +load 25 +setbyte +concat +byte 0x00 +int 0 +load 26 +setbyte +concat +byte 0x00 +int 0 +load 27 +setbyte +concat +byte 0x00 +int 0 +load 28 +setbyte +concat +byte 0x00 +int 0 +load 29 +setbyte +concat +byte 0x00 +int 0 +load 30 +setbyte +concat +byte 0x00 +int 0 +load 31 +setbyte +concat +byte 0x00 +int 0 +load 32 +setbyte +concat +byte 0x00 +int 0 +load 33 +setbyte +concat +byte 0x00 +int 0 +load 34 +setbyte +concat +byte 0x00 +int 0 +load 35 +setbyte +concat +byte 0x00 +int 0 +load 36 +setbyte +concat +byte 0x00 +int 0 +load 37 +setbyte +concat +byte 0x00 +int 0 +load 38 +setbyte +concat +byte 0x00 +int 0 +load 39 +setbyte +concat +byte 0x00 +int 0 +load 40 +setbyte +concat +byte 0x00 +int 0 +load 41 +setbyte +concat +byte 0x00 +int 0 +load 42 +setbyte +concat +byte 0x00 +int 0 +load 43 +setbyte +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_byte.teal rename to tests/integration/teal/roundtrip/app_roundtrip_byte_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal new file mode 100644 index 000000000..c7dfcc09f --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_byte_v8.teal @@ -0,0 +1,55 @@ +#pragma version 8 +txna ApplicationArgs 0 +int 0 +getbyte +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub numericalcomp_0 +store 2 +load 2 +callsub numericalcomp_0 +store 3 +byte 0x00 +int 0 +frame_dig -1 +setbyte +byte 0x00 +int 0 +load 2 +setbyte +concat +byte 0x00 +int 0 +load 3 +setbyte +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_0.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_string_0.teal rename to tests/integration/teal/roundtrip/app_roundtrip_string_0_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal new file mode 100644 index 000000000..f6742b7c1 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_0_v8.teal @@ -0,0 +1,92 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// string_reverse +stringreverse_0: +proto 1 1 +byte "" +int 0 +store 8 +load 8 +itob +extract 6 0 +byte "" +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub stringreverse_0 +store 2 +load 2 +callsub stringreverse_0 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_13.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_string_13.teal rename to tests/integration/teal/roundtrip/app_roundtrip_string_13_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal new file mode 100644 index 000000000..4e608a404 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_13_v8.teal @@ -0,0 +1,259 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// string_reverse +stringreverse_0: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 20 +frame_dig -1 +int 1 +int 1 +* +int 2 ++ +getbyte +store 19 +frame_dig -1 +int 1 +int 2 +* +int 2 ++ +getbyte +store 18 +frame_dig -1 +int 1 +int 3 +* +int 2 ++ +getbyte +store 17 +frame_dig -1 +int 1 +int 4 +* +int 2 ++ +getbyte +store 16 +frame_dig -1 +int 1 +int 5 +* +int 2 ++ +getbyte +store 15 +frame_dig -1 +int 1 +int 6 +* +int 2 ++ +getbyte +store 14 +frame_dig -1 +int 1 +int 7 +* +int 2 ++ +getbyte +store 13 +frame_dig -1 +int 1 +int 8 +* +int 2 ++ +getbyte +store 12 +frame_dig -1 +int 1 +int 9 +* +int 2 ++ +getbyte +store 11 +frame_dig -1 +int 1 +int 10 +* +int 2 ++ +getbyte +store 10 +frame_dig -1 +int 1 +int 11 +* +int 2 ++ +getbyte +store 9 +frame_dig -1 +int 1 +int 12 +* +int 2 ++ +getbyte +store 8 +int 13 +store 21 +load 21 +itob +extract 6 0 +byte 0x00 +int 0 +load 8 +setbyte +byte 0x00 +int 0 +load 9 +setbyte +concat +byte 0x00 +int 0 +load 10 +setbyte +concat +byte 0x00 +int 0 +load 11 +setbyte +concat +byte 0x00 +int 0 +load 12 +setbyte +concat +byte 0x00 +int 0 +load 13 +setbyte +concat +byte 0x00 +int 0 +load 14 +setbyte +concat +byte 0x00 +int 0 +load 15 +setbyte +concat +byte 0x00 +int 0 +load 16 +setbyte +concat +byte 0x00 +int 0 +load 17 +setbyte +concat +byte 0x00 +int 0 +load 18 +setbyte +concat +byte 0x00 +int 0 +load 19 +setbyte +concat +byte 0x00 +int 0 +load 20 +setbyte +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub stringreverse_0 +store 2 +load 2 +callsub stringreverse_0 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_1.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_string_1.teal rename to tests/integration/teal/roundtrip/app_roundtrip_string_1_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal new file mode 100644 index 000000000..8a72badb8 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_string_1_v8.teal @@ -0,0 +1,103 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// string_reverse +stringreverse_0: +proto 1 1 +byte "" +frame_dig -1 +int 1 +int 0 +* +int 2 ++ +getbyte +store 8 +int 1 +store 9 +load 9 +itob +extract 6 0 +byte 0x00 +int 0 +load 8 +setbyte +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub stringreverse_0 +store 2 +load 2 +callsub stringreverse_0 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint16.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint16.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint16_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal new file mode 100644 index 000000000..2baecd50a --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint16_v8.teal @@ -0,0 +1,52 @@ +#pragma version 8 +txna ApplicationArgs 0 +int 0 +extract_uint16 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 65535 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 65536 +< +assert +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub numericalcomp_0 +store 2 +load 2 +callsub numericalcomp_0 +store 3 +frame_dig -1 +itob +extract 6 0 +load 2 +itob +extract 6 0 +concat +load 3 +itob +extract 6 0 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint32.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint32.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint32_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal new file mode 100644 index 000000000..d495dae9d --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint32_v8.teal @@ -0,0 +1,52 @@ +#pragma version 8 +txna ApplicationArgs 0 +int 0 +extract_uint32 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 4294967295 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 4294967296 +< +assert +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub numericalcomp_0 +store 2 +load 2 +callsub numericalcomp_0 +store 3 +frame_dig -1 +itob +extract 4 0 +load 2 +itob +extract 4 0 +concat +load 3 +itob +extract 4 0 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[1].teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint64[1].teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal new file mode 100644 index 000000000..48d881ec6 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[1]_v8.teal @@ -0,0 +1,58 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 8 +int 0 +* +extract_uint64 +store 4 +load 4 +callsub numericalcomp_0 +store 4 +load 4 +itob +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[42].teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint64[42].teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal new file mode 100644 index 000000000..9126983f1 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[42]_v8.teal @@ -0,0 +1,550 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 8 +int 0 +* +extract_uint64 +store 4 +frame_dig -1 +int 8 +int 1 +* +extract_uint64 +store 5 +frame_dig -1 +int 8 +int 2 +* +extract_uint64 +store 6 +frame_dig -1 +int 8 +int 3 +* +extract_uint64 +store 7 +frame_dig -1 +int 8 +int 4 +* +extract_uint64 +store 8 +frame_dig -1 +int 8 +int 5 +* +extract_uint64 +store 9 +frame_dig -1 +int 8 +int 6 +* +extract_uint64 +store 10 +frame_dig -1 +int 8 +int 7 +* +extract_uint64 +store 11 +frame_dig -1 +int 8 +int 8 +* +extract_uint64 +store 12 +frame_dig -1 +int 8 +int 9 +* +extract_uint64 +store 13 +frame_dig -1 +int 8 +int 10 +* +extract_uint64 +store 14 +frame_dig -1 +int 8 +int 11 +* +extract_uint64 +store 15 +frame_dig -1 +int 8 +int 12 +* +extract_uint64 +store 16 +frame_dig -1 +int 8 +int 13 +* +extract_uint64 +store 17 +frame_dig -1 +int 8 +int 14 +* +extract_uint64 +store 18 +frame_dig -1 +int 8 +int 15 +* +extract_uint64 +store 19 +frame_dig -1 +int 8 +int 16 +* +extract_uint64 +store 20 +frame_dig -1 +int 8 +int 17 +* +extract_uint64 +store 21 +frame_dig -1 +int 8 +int 18 +* +extract_uint64 +store 22 +frame_dig -1 +int 8 +int 19 +* +extract_uint64 +store 23 +frame_dig -1 +int 8 +int 20 +* +extract_uint64 +store 24 +frame_dig -1 +int 8 +int 21 +* +extract_uint64 +store 25 +frame_dig -1 +int 8 +int 22 +* +extract_uint64 +store 26 +frame_dig -1 +int 8 +int 23 +* +extract_uint64 +store 27 +frame_dig -1 +int 8 +int 24 +* +extract_uint64 +store 28 +frame_dig -1 +int 8 +int 25 +* +extract_uint64 +store 29 +frame_dig -1 +int 8 +int 26 +* +extract_uint64 +store 30 +frame_dig -1 +int 8 +int 27 +* +extract_uint64 +store 31 +frame_dig -1 +int 8 +int 28 +* +extract_uint64 +store 32 +frame_dig -1 +int 8 +int 29 +* +extract_uint64 +store 33 +frame_dig -1 +int 8 +int 30 +* +extract_uint64 +store 34 +frame_dig -1 +int 8 +int 31 +* +extract_uint64 +store 35 +frame_dig -1 +int 8 +int 32 +* +extract_uint64 +store 36 +frame_dig -1 +int 8 +int 33 +* +extract_uint64 +store 37 +frame_dig -1 +int 8 +int 34 +* +extract_uint64 +store 38 +frame_dig -1 +int 8 +int 35 +* +extract_uint64 +store 39 +frame_dig -1 +int 8 +int 36 +* +extract_uint64 +store 40 +frame_dig -1 +int 8 +int 37 +* +extract_uint64 +store 41 +frame_dig -1 +int 8 +int 38 +* +extract_uint64 +store 42 +frame_dig -1 +int 8 +int 39 +* +extract_uint64 +store 43 +frame_dig -1 +int 8 +int 40 +* +extract_uint64 +store 44 +frame_dig -1 +int 8 +int 41 +* +extract_uint64 +store 45 +load 4 +callsub numericalcomp_0 +store 4 +load 5 +callsub numericalcomp_0 +store 5 +load 6 +callsub numericalcomp_0 +store 6 +load 7 +callsub numericalcomp_0 +store 7 +load 8 +callsub numericalcomp_0 +store 8 +load 9 +callsub numericalcomp_0 +store 9 +load 10 +callsub numericalcomp_0 +store 10 +load 11 +callsub numericalcomp_0 +store 11 +load 12 +callsub numericalcomp_0 +store 12 +load 13 +callsub numericalcomp_0 +store 13 +load 14 +callsub numericalcomp_0 +store 14 +load 15 +callsub numericalcomp_0 +store 15 +load 16 +callsub numericalcomp_0 +store 16 +load 17 +callsub numericalcomp_0 +store 17 +load 18 +callsub numericalcomp_0 +store 18 +load 19 +callsub numericalcomp_0 +store 19 +load 20 +callsub numericalcomp_0 +store 20 +load 21 +callsub numericalcomp_0 +store 21 +load 22 +callsub numericalcomp_0 +store 22 +load 23 +callsub numericalcomp_0 +store 23 +load 24 +callsub numericalcomp_0 +store 24 +load 25 +callsub numericalcomp_0 +store 25 +load 26 +callsub numericalcomp_0 +store 26 +load 27 +callsub numericalcomp_0 +store 27 +load 28 +callsub numericalcomp_0 +store 28 +load 29 +callsub numericalcomp_0 +store 29 +load 30 +callsub numericalcomp_0 +store 30 +load 31 +callsub numericalcomp_0 +store 31 +load 32 +callsub numericalcomp_0 +store 32 +load 33 +callsub numericalcomp_0 +store 33 +load 34 +callsub numericalcomp_0 +store 34 +load 35 +callsub numericalcomp_0 +store 35 +load 36 +callsub numericalcomp_0 +store 36 +load 37 +callsub numericalcomp_0 +store 37 +load 38 +callsub numericalcomp_0 +store 38 +load 39 +callsub numericalcomp_0 +store 39 +load 40 +callsub numericalcomp_0 +store 40 +load 41 +callsub numericalcomp_0 +store 41 +load 42 +callsub numericalcomp_0 +store 42 +load 43 +callsub numericalcomp_0 +store 43 +load 44 +callsub numericalcomp_0 +store 44 +load 45 +callsub numericalcomp_0 +store 45 +load 4 +itob +load 5 +itob +concat +load 6 +itob +concat +load 7 +itob +concat +load 8 +itob +concat +load 9 +itob +concat +load 10 +itob +concat +load 11 +itob +concat +load 12 +itob +concat +load 13 +itob +concat +load 14 +itob +concat +load 15 +itob +concat +load 16 +itob +concat +load 17 +itob +concat +load 18 +itob +concat +load 19 +itob +concat +load 20 +itob +concat +load 21 +itob +concat +load 22 +itob +concat +load 23 +itob +concat +load 24 +itob +concat +load 25 +itob +concat +load 26 +itob +concat +load 27 +itob +concat +load 28 +itob +concat +load 29 +itob +concat +load 30 +itob +concat +load 31 +itob +concat +load 32 +itob +concat +load 33 +itob +concat +load 34 +itob +concat +load 35 +itob +concat +load 36 +itob +concat +load 37 +itob +concat +load 38 +itob +concat +load 39 +itob +concat +load 40 +itob +concat +load 41 +itob +concat +load 42 +itob +concat +load 43 +itob +concat +load 44 +itob +concat +load 45 +itob +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +load 2 +concat +load 3 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal new file mode 100644 index 000000000..87f935c92 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_0_v8.teal @@ -0,0 +1,92 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// array_complement +arraycomplement_0: +proto 1 1 +byte "" +int 0 +store 8 +load 8 +itob +extract 6 0 +byte "" +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_0 +store 2 +load 2 +callsub arraycomplement_0 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal new file mode 100644 index 000000000..fb4caf8bd --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_1_v8.teal @@ -0,0 +1,114 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 8 +int 0 +* +int 2 ++ +extract_uint64 +store 8 +load 8 +callsub numericalcomp_0 +store 8 +int 1 +store 9 +load 9 +itob +extract 6 0 +load 8 +itob +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal new file mode 100644 index 000000000..cf61ff80f --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64[]_42_v8.teal @@ -0,0 +1,688 @@ +#pragma version 8 +txna ApplicationArgs 0 +store 1 +load 1 +callsub roundtripper_2 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// array_complement +arraycomplement_1: +proto 1 1 +byte "" +frame_dig -1 +int 8 +int 0 +* +int 2 ++ +extract_uint64 +store 8 +frame_dig -1 +int 8 +int 1 +* +int 2 ++ +extract_uint64 +store 9 +frame_dig -1 +int 8 +int 2 +* +int 2 ++ +extract_uint64 +store 10 +frame_dig -1 +int 8 +int 3 +* +int 2 ++ +extract_uint64 +store 11 +frame_dig -1 +int 8 +int 4 +* +int 2 ++ +extract_uint64 +store 12 +frame_dig -1 +int 8 +int 5 +* +int 2 ++ +extract_uint64 +store 13 +frame_dig -1 +int 8 +int 6 +* +int 2 ++ +extract_uint64 +store 14 +frame_dig -1 +int 8 +int 7 +* +int 2 ++ +extract_uint64 +store 15 +frame_dig -1 +int 8 +int 8 +* +int 2 ++ +extract_uint64 +store 16 +frame_dig -1 +int 8 +int 9 +* +int 2 ++ +extract_uint64 +store 17 +frame_dig -1 +int 8 +int 10 +* +int 2 ++ +extract_uint64 +store 18 +frame_dig -1 +int 8 +int 11 +* +int 2 ++ +extract_uint64 +store 19 +frame_dig -1 +int 8 +int 12 +* +int 2 ++ +extract_uint64 +store 20 +frame_dig -1 +int 8 +int 13 +* +int 2 ++ +extract_uint64 +store 21 +frame_dig -1 +int 8 +int 14 +* +int 2 ++ +extract_uint64 +store 22 +frame_dig -1 +int 8 +int 15 +* +int 2 ++ +extract_uint64 +store 23 +frame_dig -1 +int 8 +int 16 +* +int 2 ++ +extract_uint64 +store 24 +frame_dig -1 +int 8 +int 17 +* +int 2 ++ +extract_uint64 +store 25 +frame_dig -1 +int 8 +int 18 +* +int 2 ++ +extract_uint64 +store 26 +frame_dig -1 +int 8 +int 19 +* +int 2 ++ +extract_uint64 +store 27 +frame_dig -1 +int 8 +int 20 +* +int 2 ++ +extract_uint64 +store 28 +frame_dig -1 +int 8 +int 21 +* +int 2 ++ +extract_uint64 +store 29 +frame_dig -1 +int 8 +int 22 +* +int 2 ++ +extract_uint64 +store 30 +frame_dig -1 +int 8 +int 23 +* +int 2 ++ +extract_uint64 +store 31 +frame_dig -1 +int 8 +int 24 +* +int 2 ++ +extract_uint64 +store 32 +frame_dig -1 +int 8 +int 25 +* +int 2 ++ +extract_uint64 +store 33 +frame_dig -1 +int 8 +int 26 +* +int 2 ++ +extract_uint64 +store 34 +frame_dig -1 +int 8 +int 27 +* +int 2 ++ +extract_uint64 +store 35 +frame_dig -1 +int 8 +int 28 +* +int 2 ++ +extract_uint64 +store 36 +frame_dig -1 +int 8 +int 29 +* +int 2 ++ +extract_uint64 +store 37 +frame_dig -1 +int 8 +int 30 +* +int 2 ++ +extract_uint64 +store 38 +frame_dig -1 +int 8 +int 31 +* +int 2 ++ +extract_uint64 +store 39 +frame_dig -1 +int 8 +int 32 +* +int 2 ++ +extract_uint64 +store 40 +frame_dig -1 +int 8 +int 33 +* +int 2 ++ +extract_uint64 +store 41 +frame_dig -1 +int 8 +int 34 +* +int 2 ++ +extract_uint64 +store 42 +frame_dig -1 +int 8 +int 35 +* +int 2 ++ +extract_uint64 +store 43 +frame_dig -1 +int 8 +int 36 +* +int 2 ++ +extract_uint64 +store 44 +frame_dig -1 +int 8 +int 37 +* +int 2 ++ +extract_uint64 +store 45 +frame_dig -1 +int 8 +int 38 +* +int 2 ++ +extract_uint64 +store 46 +frame_dig -1 +int 8 +int 39 +* +int 2 ++ +extract_uint64 +store 47 +frame_dig -1 +int 8 +int 40 +* +int 2 ++ +extract_uint64 +store 48 +frame_dig -1 +int 8 +int 41 +* +int 2 ++ +extract_uint64 +store 49 +load 8 +callsub numericalcomp_0 +store 8 +load 9 +callsub numericalcomp_0 +store 9 +load 10 +callsub numericalcomp_0 +store 10 +load 11 +callsub numericalcomp_0 +store 11 +load 12 +callsub numericalcomp_0 +store 12 +load 13 +callsub numericalcomp_0 +store 13 +load 14 +callsub numericalcomp_0 +store 14 +load 15 +callsub numericalcomp_0 +store 15 +load 16 +callsub numericalcomp_0 +store 16 +load 17 +callsub numericalcomp_0 +store 17 +load 18 +callsub numericalcomp_0 +store 18 +load 19 +callsub numericalcomp_0 +store 19 +load 20 +callsub numericalcomp_0 +store 20 +load 21 +callsub numericalcomp_0 +store 21 +load 22 +callsub numericalcomp_0 +store 22 +load 23 +callsub numericalcomp_0 +store 23 +load 24 +callsub numericalcomp_0 +store 24 +load 25 +callsub numericalcomp_0 +store 25 +load 26 +callsub numericalcomp_0 +store 26 +load 27 +callsub numericalcomp_0 +store 27 +load 28 +callsub numericalcomp_0 +store 28 +load 29 +callsub numericalcomp_0 +store 29 +load 30 +callsub numericalcomp_0 +store 30 +load 31 +callsub numericalcomp_0 +store 31 +load 32 +callsub numericalcomp_0 +store 32 +load 33 +callsub numericalcomp_0 +store 33 +load 34 +callsub numericalcomp_0 +store 34 +load 35 +callsub numericalcomp_0 +store 35 +load 36 +callsub numericalcomp_0 +store 36 +load 37 +callsub numericalcomp_0 +store 37 +load 38 +callsub numericalcomp_0 +store 38 +load 39 +callsub numericalcomp_0 +store 39 +load 40 +callsub numericalcomp_0 +store 40 +load 41 +callsub numericalcomp_0 +store 41 +load 42 +callsub numericalcomp_0 +store 42 +load 43 +callsub numericalcomp_0 +store 43 +load 44 +callsub numericalcomp_0 +store 44 +load 45 +callsub numericalcomp_0 +store 45 +load 46 +callsub numericalcomp_0 +store 46 +load 47 +callsub numericalcomp_0 +store 47 +load 48 +callsub numericalcomp_0 +store 48 +load 49 +callsub numericalcomp_0 +store 49 +int 42 +store 50 +load 50 +itob +extract 6 0 +load 8 +itob +load 9 +itob +concat +load 10 +itob +concat +load 11 +itob +concat +load 12 +itob +concat +load 13 +itob +concat +load 14 +itob +concat +load 15 +itob +concat +load 16 +itob +concat +load 17 +itob +concat +load 18 +itob +concat +load 19 +itob +concat +load 20 +itob +concat +load 21 +itob +concat +load 22 +itob +concat +load 23 +itob +concat +load 24 +itob +concat +load 25 +itob +concat +load 26 +itob +concat +load 27 +itob +concat +load 28 +itob +concat +load 29 +itob +concat +load 30 +itob +concat +load 31 +itob +concat +load 32 +itob +concat +load 33 +itob +concat +load 34 +itob +concat +load 35 +itob +concat +load 36 +itob +concat +load 37 +itob +concat +load 38 +itob +concat +load 39 +itob +concat +load 40 +itob +concat +load 41 +itob +concat +load 42 +itob +concat +load 43 +itob +concat +load 44 +itob +concat +load 45 +itob +concat +load 46 +itob +concat +load 47 +itob +concat +load 48 +itob +concat +load 49 +itob +concat +concat +frame_bury 0 +retsub + +// round_tripper +roundtripper_2: +proto 1 1 +byte "" +frame_dig -1 +callsub arraycomplement_1 +store 2 +load 2 +callsub arraycomplement_1 +store 3 +frame_dig -1 +store 7 +load 7 +store 6 +int 6 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +load 2 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +load 7 +len ++ +store 5 +load 5 +int 65536 +< +assert +load 4 +itob +extract 6 0 +concat +load 3 +store 7 +load 6 +load 7 +concat +store 6 +load 5 +store 4 +load 4 +itob +extract 6 0 +concat +load 6 +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint64.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint64_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal new file mode 100644 index 000000000..ce11171f2 --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint64_v8.teal @@ -0,0 +1,44 @@ +#pragma version 8 +txna ApplicationArgs 0 +btoi +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 18446744073709551615 +frame_dig -1 +- +frame_bury 0 +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub numericalcomp_0 +store 2 +load 2 +callsub numericalcomp_0 +store 3 +frame_dig -1 +itob +load 2 +itob +concat +load 3 +itob +concat +frame_bury 0 +retsub \ No newline at end of file diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v6.teal similarity index 100% rename from tests/integration/teal/roundtrip/app_roundtrip_uint8.teal rename to tests/integration/teal/roundtrip/app_roundtrip_uint8_v6.teal diff --git a/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal new file mode 100644 index 000000000..c7dfcc09f --- /dev/null +++ b/tests/integration/teal/roundtrip/app_roundtrip_uint8_v8.teal @@ -0,0 +1,55 @@ +#pragma version 8 +txna ApplicationArgs 0 +int 0 +getbyte +store 1 +load 1 +callsub roundtripper_1 +store 0 +byte 0x151f7c75 +load 0 +concat +log +int 1 +return + +// numerical_comp +numericalcomp_0: +proto 1 1 +int 0 +int 255 +frame_dig -1 +- +frame_bury 0 +frame_dig 0 +int 256 +< +assert +retsub + +// round_tripper +roundtripper_1: +proto 1 1 +byte "" +frame_dig -1 +callsub numericalcomp_0 +store 2 +load 2 +callsub numericalcomp_0 +store 3 +byte 0x00 +int 0 +frame_dig -1 +setbyte +byte 0x00 +int 0 +load 2 +setbyte +concat +byte 0x00 +int 0 +load 3 +setbyte +concat +frame_bury 0 +retsub \ No newline at end of file