From 3d42df36a29a3867081a79784ce554f6d66b085b Mon Sep 17 00:00:00 2001 From: Daniel McGregor Date: Thu, 14 Mar 2024 16:30:48 +0800 Subject: [PATCH] feat: added `puyapy.arc4.call_abi` for typed contract to contract calls (#112) * improved API for `puyapy.arg4.DynamicBytes` * fixed `puyapy.arg4.UFixedNxM` parsing of decimal strings * support generating a client for use with `puyapy.arc4.call_abi` from ARC32 specifications or puya contracts BREAKING CHANGE: renamed `global_num_byte_slices` -> `global_num_bytes` and `local_num_byte_slices` -> `local_num_bytes` members on transaction types restrict `puyapy.arc4.String` operators to only be with other String compatible types --------- Co-authored-by: Adam Chidlow --- .gitignore | 3 + docs/_static/custom.css | 9 + docs/conf.py | 5 +- examples/amm/out/client_ConstantProductAMM.py | 49 + examples/amm/out/contract.awst | 4 +- examples/amm/puya.log | 5 +- examples/auction/out/client_Auction.py | 44 + examples/auction/out/contract.awst | 2 +- examples/auction/puya.log | 5 +- examples/calculator/puya.log | 2 +- examples/global_state/puya.log | 2 +- examples/hello_world/puya.log | 2 +- .../out/client_HelloWorldContract.py | 14 + examples/hello_world_arc4/puya.log | 5 +- examples/local_state/puya.log | 2 +- examples/merkle/out/client_MerkleTree.py | 21 + examples/merkle/out/contract.awst | 18 +- examples/merkle/puya.log | 5 +- examples/sizes.txt | 7 +- examples/voting/out/VotingRoundApp.arc32.json | 2 +- examples/voting/out/client_VotingRoundApp.py | 51 + examples/voting/out/voting.awst | 22 +- examples/voting/puya.log | 5 +- poetry.lock | 2 +- pyproject.toml | 3 +- scripts/compile_all_examples.py | 3 +- scripts/generate_docs.py | 21 +- src/puya/__main__.py | 6 + src/puya/arc32.py | 131 +- src/puya/arc4_util.py | 112 +- src/puya/awst/nodes.py | 6 +- src/puya/awst/wtypes.py | 86 +- src/puya/awst_build/arc4_utils.py | 336 ++ src/puya/awst_build/constants.py | 3 + src/puya/awst_build/context.py | 18 +- src/puya/awst_build/contract.py | 207 +- src/puya/awst_build/eb/arc4/__init__.py | 2 + src/puya/awst_build/eb/arc4/_utils.py | 119 + src/puya/awst_build/eb/arc4/abi_call.py | 418 ++ src/puya/awst_build/eb/arc4/arrays.py | 11 +- src/puya/awst_build/eb/arc4/base.py | 103 +- src/puya/awst_build/eb/arc4/dynamic_bytes.py | 72 + src/puya/awst_build/eb/arc4/numeric.py | 57 +- src/puya/awst_build/eb/arc4/string.py | 30 +- src/puya/awst_build/eb/arc4/struct.py | 5 +- src/puya/awst_build/eb/log.py | 15 +- .../eb/reference_types/application.py | 4 +- .../awst_build/eb/transaction/inner_params.py | 44 +- src/puya/awst_build/eb/type_registry.py | 4 + src/puya/awst_build/main.py | 7 +- src/puya/awst_build/module.py | 8 + src/puya/awst_build/subroutine.py | 16 +- src/puya/awst_build/utils.py | 57 +- .../validation/inner_transactions.py | 3 +- src/puya/client_gen.py | 195 + src/puya/compile.py | 17 +- src/puya/context.py | 11 +- src/puya/ir/arc4_router.py | 156 +- src/puya/ir/builder/arc4.py | 4 +- src/puya/ir/builder/itxn.py | 121 +- src/puya/ir/builder/main.py | 11 +- src/puya/mir/models.py | 2 +- src/puya/mir/vla.py | 2 +- src/puya/models.py | 16 +- src/puya/options.py | 1 + src/puyapy-stubs/_reference.pyi | 4 +- src/puyapy-stubs/_transaction.pyi | 4 +- src/puyapy-stubs/_util.pyi | 4 +- src/puyapy-stubs/arc4.pyi | 120 +- src/puyapy-stubs/itxn.pyi | 68 +- .../abi_routing/out/Reference.approval.mir | 12 +- .../abi_routing/out/client_Reference.py | 113 + test_cases/abi_routing/out/contract.awst | 34 +- test_cases/abi_routing/puya.log | 5 +- test_cases/application/contract.py | 4 +- .../application/out/Reference.approval.mir | 44 +- .../application/out/Reference.approval.teal | 8 +- .../application/out/Reference.destructured.ir | 4 +- test_cases/application/out/Reference.ssa.ir | 4 +- .../out/Reference.ssa.opt_pass_1.ir | 4 +- test_cases/application/out/contract.awst | 4 +- .../out_O2/Reference.approval.teal | 4 +- .../out_O2/Reference.destructured.ir | 4 +- .../out_unoptimized/Reference.approval.teal | 8 +- .../out_unoptimized/Reference.destructured.ir | 4 +- test_cases/application/puya.log | 2 +- .../out/UIntNOrdering.approval.mir | 12 +- .../arc4_numeric_comparisons/out/uint_n.awst | 6 +- test_cases/arc4_numeric_comparisons/puya.log | 2 +- test_cases/arc4_types/dynamic_bytes.py | 39 + test_cases/arc4_types/numeric.py | 41 + .../out/Arc4DynamicBytesContract.approval.mir | 132 + .../Arc4DynamicBytesContract.approval.teal | 111 + .../out/Arc4DynamicBytesContract.clear.mir | 9 + .../out/Arc4DynamicBytesContract.clear.teal | 7 + .../Arc4DynamicBytesContract.destructured.ir | 51 + .../out/Arc4DynamicBytesContract.ssa.ir | 101 + ...Arc4DynamicBytesContract.ssa.opt_pass_1.ir | 85 + ...Arc4DynamicBytesContract.ssa.opt_pass_2.ir | 76 + ...Arc4DynamicBytesContract.ssa.opt_pass_3.ir | 71 + ...Arc4DynamicBytesContract.ssa.opt_pass_4.ir | 69 + ...Arc4DynamicBytesContract.ssa.opt_pass_5.ir | 64 + ...Arc4DynamicBytesContract.ssa.opt_pass_6.ir | 59 + ...Arc4DynamicBytesContract.ssa.opt_pass_7.ir | 57 + .../Arc4MutableParamsContract.approval.mir | 14 +- .../out/Arc4MutationContract.approval.mir | 14 +- .../out/Arc4NumericTypesContract.approval.mir | 4 +- .../Arc4NumericTypesContract.approval.teal | 2 +- .../out/Arc4NumericTypesContract.clear.mir | 4 +- .../out/Arc4NumericTypesContract.clear.teal | 2 +- .../Arc4NumericTypesContract.destructured.ir | 2 +- .../out/Arc4NumericTypesContract.ssa.ir | 119 +- ...Arc4NumericTypesContract.ssa.opt_pass_1.ir | 103 +- ...Arc4NumericTypesContract.ssa.opt_pass_2.ir | 66 +- ...Arc4NumericTypesContract.ssa.opt_pass_3.ir | 16 +- ...Arc4NumericTypesContract.ssa.opt_pass_4.ir | 6 +- ...Arc4NumericTypesContract.ssa.opt_pass_5.ir | 2 +- ...Arc4NumericTypesContract.ssa.opt_pass_6.ir | 2 +- ...Arc4NumericTypesContract.ssa.opt_pass_7.ir | 2 +- .../out/Arc4StringTypesContract.ssa.ir | 33 +- .../Arc4StringTypesContract.ssa.opt_pass_1.ir | 33 +- ...Arc4StringTypesContract.ssa.opt_pass_10.ir | 30 +- ...Arc4StringTypesContract.ssa.opt_pass_11.ir | 28 +- ...Arc4StringTypesContract.ssa.opt_pass_12.ir | 26 +- ...Arc4StringTypesContract.ssa.opt_pass_13.ir | 26 +- ...Arc4StringTypesContract.ssa.opt_pass_14.ir | 26 +- ...Arc4StringTypesContract.ssa.opt_pass_15.ir | 24 +- ...Arc4StringTypesContract.ssa.opt_pass_16.ir | 22 +- ...Arc4StringTypesContract.ssa.opt_pass_17.ir | 20 +- ...Arc4StringTypesContract.ssa.opt_pass_18.ir | 20 +- ...Arc4StringTypesContract.ssa.opt_pass_19.ir | 20 +- .../Arc4StringTypesContract.ssa.opt_pass_2.ir | 32 +- ...Arc4StringTypesContract.ssa.opt_pass_20.ir | 18 +- ...Arc4StringTypesContract.ssa.opt_pass_21.ir | 16 +- ...Arc4StringTypesContract.ssa.opt_pass_22.ir | 14 +- ...Arc4StringTypesContract.ssa.opt_pass_23.ir | 14 +- ...Arc4StringTypesContract.ssa.opt_pass_24.ir | 14 +- ...Arc4StringTypesContract.ssa.opt_pass_25.ir | 12 +- ...Arc4StringTypesContract.ssa.opt_pass_26.ir | 10 +- ...Arc4StringTypesContract.ssa.opt_pass_27.ir | 7 - ...Arc4StringTypesContract.ssa.opt_pass_28.ir | 16 - ...Arc4StringTypesContract.ssa.opt_pass_29.ir | 14 - .../Arc4StringTypesContract.ssa.opt_pass_3.ir | 32 +- ...Arc4StringTypesContract.ssa.opt_pass_30.ir | 13 - ...Arc4StringTypesContract.ssa.opt_pass_31.ir | 12 - ...Arc4StringTypesContract.ssa.opt_pass_32.ir | 10 - .../Arc4StringTypesContract.ssa.opt_pass_4.ir | 32 +- .../Arc4StringTypesContract.ssa.opt_pass_5.ir | 32 +- .../Arc4StringTypesContract.ssa.opt_pass_6.ir | 32 +- .../Arc4StringTypesContract.ssa.opt_pass_7.ir | 32 +- .../Arc4StringTypesContract.ssa.opt_pass_8.ir | 32 +- .../Arc4StringTypesContract.ssa.opt_pass_9.ir | 32 +- test_cases/arc4_types/out/array.awst | 12 +- test_cases/arc4_types/out/bool_eval.awst | 8 +- .../client_Arc4DynamicStringArrayContract.py | 18 + test_cases/arc4_types/out/dynamic_bytes.awst | 33 + .../arc4_types/out/dynamic_string_array.awst | 2 +- test_cases/arc4_types/out/mutable_params.awst | 42 +- test_cases/arc4_types/out/mutation.awst | 46 +- test_cases/arc4_types/out/numeric.O0.log | 205 +- test_cases/arc4_types/out/numeric.awst | 43 +- .../arc4_types/out/reference_types.awst | 6 +- test_cases/arc4_types/out/string.O0.log | 100 +- test_cases/arc4_types/out/string.awst | 2 +- test_cases/arc4_types/out/tuples.awst | 14 +- .../Arc4DynamicBytesContract.approval.teal | 87 + .../Arc4DynamicBytesContract.clear.teal | 5 + .../Arc4DynamicBytesContract.destructured.ir | 51 + .../Arc4NumericTypesContract.destructured.ir | 2 +- .../Arc4DynamicBytesContract.approval.teal | 204 + .../Arc4DynamicBytesContract.clear.teal | 7 + .../Arc4DynamicBytesContract.destructured.ir | 92 + .../Arc4MutableParamsContract.approval.teal | 9 +- .../Arc4NumericTypesContract.approval.teal | 163 +- .../Arc4NumericTypesContract.clear.teal | 2 +- .../Arc4NumericTypesContract.destructured.ir | 119 +- .../Arc4StringTypesContract.approval.teal | 18 +- .../Arc4StringTypesContract.destructured.ir | 23 +- test_cases/arc4_types/puya.log | 723 ++- test_cases/arc4_types/string.py | 6 +- test_cases/asset/puya.log | 2 +- test_cases/augmented_assignment/puya.log | 2 +- .../out/client_TestContract.py | 17 + test_cases/avm_types_in_abi/puya.log | 5 +- test_cases/biguint_binary_ops/puya.log | 2 +- test_cases/boolean_binary_ops/puya.log | 2 +- test_cases/bytes_ops/puya.log | 2 +- test_cases/callsub/puya.log | 2 +- test_cases/chained_assignment/puya.log | 2 +- test_cases/conditional_execution/puya.log | 2 +- test_cases/conditional_expressions/puya.log | 2 +- test_cases/constants/puya.log | 2 +- test_cases/contains/puya.log | 2 +- test_cases/control_op_simplification/puya.log | 2 +- test_cases/edverify/puya.log | 2 +- test_cases/enumeration/puya.log | 2 +- .../everything/out/client_MyContract.py | 36 + test_cases/everything/out/contract.awst | 6 +- test_cases/everything/out/my_base.awst | 4 +- test_cases/everything/puya.log | 5 +- .../out/Greeter.approval.mir | 18 +- .../out/Greeter.destructured.ir | 12 +- .../inner_transactions/out/Greeter.ssa.ir | 21 +- .../out/Greeter.ssa.opt_pass_1.ir | 14 +- .../out/Greeter.ssa.opt_pass_2.ir | 12 +- test_cases/inner_transactions/out/c2c.awst | 2 +- .../inner_transactions/out/client_Greeter.py | 19 + .../out_O2/Greeter.destructured.ir | 12 +- .../out_unoptimized/Greeter.destructured.ir | 23 +- test_cases/inner_transactions/puya.log | 31 +- test_cases/intrinsics/puya.log | 2 +- test_cases/koopman/puya.log | 2 +- test_cases/less_simple/puya.log | 2 +- test_cases/log/out/contract.awst | 6 +- test_cases/log/puya.log | 2 +- test_cases/match/puya.log | 2 +- test_cases/module_consts/puya.log | 2 +- test_cases/mylib/puya.log | 2 +- test_cases/nested_loops/puya.log | 2 +- .../regression_118/out/client_Contract.py | 14 + test_cases/regression_118/out/contract.awst | 2 +- test_cases/regression_118/puya.log | 5 +- .../reversed_iteration/out/contract.awst | 8 +- test_cases/reversed_iteration/puya.log | 2 +- test_cases/scratch_slots/puya.log | 2 +- test_cases/simple/puya.log | 2 +- test_cases/simplish/puya.log | 2 +- test_cases/ssa/puya.log | 2 +- test_cases/ssa2/puya.log | 2 +- .../out/client_StateProxyContract.py | 13 + test_cases/state_proxies/puya.log | 5 +- test_cases/string_ops/puya.log | 2 +- test_cases/stubs/puya.log | 2 +- .../out/client_TemplateVariablesContract.py | 18 + .../template_variables/out/contract.awst | 4 +- test_cases/template_variables/puya.log | 5 +- test_cases/too_many_permutations/puya.log | 2 +- test_cases/transaction/contract.py | 4 +- .../out/TransactionContract.approval.mir | 20 +- .../out/TransactionContract.approval.teal | 8 +- .../out/TransactionContract.arc32.json | 2 +- .../out/TransactionContract.destructured.ir | 4 +- .../out/TransactionContract.ssa.ir | 4 +- .../out/TransactionContract.ssa.opt_pass_1.ir | 4 +- .../out/client_TransactionContract.py | 65 + test_cases/transaction/out/contract.awst | 4 +- .../out_O2/TransactionContract.approval.teal | 4 +- .../TransactionContract.destructured.ir | 4 +- .../TransactionContract.approval.teal | 8 +- .../TransactionContract.destructured.ir | 4 +- test_cases/transaction/puya.log | 5 +- test_cases/tuple_support/puya.log | 2 +- test_cases/typed_abi_call/logger.py | 67 + .../typed_abi_call/out/Greeter.approval.mir | 676 +++ .../typed_abi_call/out/Greeter.approval.teal | 745 ++++ .../typed_abi_call/out/Greeter.arc32.json | 126 + .../typed_abi_call/out/Greeter.clear.mir | 9 + .../typed_abi_call/out/Greeter.clear.teal | 7 + .../out/Greeter.destructured.ir | 313 ++ test_cases/typed_abi_call/out/Greeter.ssa.ir | 2280 ++++++++++ .../out/Greeter.ssa.opt_pass_1.ir | 325 ++ .../out/Greeter.ssa.opt_pass_2.ir | 321 ++ .../out/Greeter.ssa.opt_pass_3.ir | 319 ++ .../out/Greeter.ssa.opt_pass_4.ir | 317 ++ .../out/Greeter.ssa.opt_pass_5.ir | 315 ++ .../out/Greeter.ssa.opt_pass_6.ir | 314 ++ .../out/Greeter.ssa.opt_pass_7.ir | 313 ++ .../typed_abi_call/out/Logger.approval.mir | 508 +++ .../typed_abi_call/out/Logger.approval.teal | 401 ++ .../typed_abi_call/out/Logger.arc32.json | 257 ++ .../typed_abi_call/out/Logger.clear.mir | 9 + .../typed_abi_call/out/Logger.clear.teal | 7 + .../typed_abi_call/out/Logger.destructured.ir | 207 + test_cases/typed_abi_call/out/Logger.ssa.ir | 226 + .../out/Logger.ssa.opt_pass_1.ir | 212 + .../out/Logger.ssa.opt_pass_2.ir | 208 + .../typed_abi_call/out/client_Greeter.py | 39 + .../typed_abi_call/out/client_Logger.py | 77 + test_cases/typed_abi_call/out/logger.awst | 44 + test_cases/typed_abi_call/out/typed_c2c.awst | 54 + .../out_O2/Greeter.approval.teal | 467 ++ .../typed_abi_call/out_O2/Greeter.clear.teal | 5 + .../out_O2/Greeter.destructured.ir | 313 ++ .../out_O2/Logger.approval.teal | 279 ++ .../typed_abi_call/out_O2/Logger.clear.teal | 5 + .../out_O2/Logger.destructured.ir | 207 + .../out_unoptimized/Greeter.approval.teal | 935 ++++ .../out_unoptimized/Greeter.clear.teal | 7 + .../out_unoptimized/Greeter.destructured.ir | 492 +++ .../out_unoptimized/Logger.approval.teal | 476 ++ .../out_unoptimized/Logger.clear.teal | 7 + .../out_unoptimized/Logger.destructured.ir | 224 + test_cases/typed_abi_call/puya.log | 3889 +++++++++++++++++ test_cases/typed_abi_call/typed_c2c.py | 93 + test_cases/unary/puya.log | 2 +- test_cases/undefined_phi_args/puya.log | 2 +- test_cases/unssa/puya.log | 2 +- test_cases/with_reentrancy/puya.log | 2 +- tests/test_arc32.py | 56 + tests/test_compile.py | 1 + tests/test_execution.py | 4 + tests/test_expected_output/itxn.test | 115 + tests/test_expected_output/subroutine.test | 4 +- tests/utils/__init__.py | 7 +- 304 files changed, 22092 insertions(+), 2032 deletions(-) create mode 100644 docs/_static/custom.css create mode 100644 examples/amm/out/client_ConstantProductAMM.py create mode 100644 examples/auction/out/client_Auction.py create mode 100644 examples/hello_world_arc4/out/client_HelloWorldContract.py create mode 100644 examples/merkle/out/client_MerkleTree.py create mode 100644 examples/voting/out/client_VotingRoundApp.py create mode 100644 src/puya/awst_build/arc4_utils.py create mode 100644 src/puya/awst_build/eb/arc4/_utils.py create mode 100644 src/puya/awst_build/eb/arc4/abi_call.py create mode 100644 src/puya/awst_build/eb/arc4/dynamic_bytes.py create mode 100644 src/puya/client_gen.py create mode 100644 test_cases/abi_routing/out/client_Reference.py create mode 100644 test_cases/arc4_types/dynamic_bytes.py create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.mir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.teal create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.mir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.teal create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.destructured.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_1.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_2.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_3.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_4.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_5.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_6.ir create mode 100644 test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_7.ir delete mode 100644 test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_28.ir delete mode 100644 test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_29.ir delete mode 100644 test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_30.ir delete mode 100644 test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_31.ir delete mode 100644 test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_32.ir create mode 100644 test_cases/arc4_types/out/client_Arc4DynamicStringArrayContract.py create mode 100644 test_cases/arc4_types/out/dynamic_bytes.awst create mode 100644 test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.approval.teal create mode 100644 test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.clear.teal create mode 100644 test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.destructured.ir create mode 100644 test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.approval.teal create mode 100644 test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.clear.teal create mode 100644 test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.destructured.ir create mode 100644 test_cases/avm_types_in_abi/out/client_TestContract.py create mode 100644 test_cases/everything/out/client_MyContract.py create mode 100644 test_cases/inner_transactions/out/client_Greeter.py create mode 100644 test_cases/regression_118/out/client_Contract.py create mode 100644 test_cases/state_proxies/out/client_StateProxyContract.py create mode 100644 test_cases/template_variables/out/client_TemplateVariablesContract.py create mode 100644 test_cases/transaction/out/client_TransactionContract.py create mode 100644 test_cases/typed_abi_call/logger.py create mode 100644 test_cases/typed_abi_call/out/Greeter.approval.mir create mode 100644 test_cases/typed_abi_call/out/Greeter.approval.teal create mode 100644 test_cases/typed_abi_call/out/Greeter.arc32.json create mode 100644 test_cases/typed_abi_call/out/Greeter.clear.mir create mode 100644 test_cases/typed_abi_call/out/Greeter.clear.teal create mode 100644 test_cases/typed_abi_call/out/Greeter.destructured.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_1.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_2.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_3.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_4.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_5.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_6.ir create mode 100644 test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_7.ir create mode 100644 test_cases/typed_abi_call/out/Logger.approval.mir create mode 100644 test_cases/typed_abi_call/out/Logger.approval.teal create mode 100644 test_cases/typed_abi_call/out/Logger.arc32.json create mode 100644 test_cases/typed_abi_call/out/Logger.clear.mir create mode 100644 test_cases/typed_abi_call/out/Logger.clear.teal create mode 100644 test_cases/typed_abi_call/out/Logger.destructured.ir create mode 100644 test_cases/typed_abi_call/out/Logger.ssa.ir create mode 100644 test_cases/typed_abi_call/out/Logger.ssa.opt_pass_1.ir create mode 100644 test_cases/typed_abi_call/out/Logger.ssa.opt_pass_2.ir create mode 100644 test_cases/typed_abi_call/out/client_Greeter.py create mode 100644 test_cases/typed_abi_call/out/client_Logger.py create mode 100644 test_cases/typed_abi_call/out/logger.awst create mode 100644 test_cases/typed_abi_call/out/typed_c2c.awst create mode 100644 test_cases/typed_abi_call/out_O2/Greeter.approval.teal create mode 100644 test_cases/typed_abi_call/out_O2/Greeter.clear.teal create mode 100644 test_cases/typed_abi_call/out_O2/Greeter.destructured.ir create mode 100644 test_cases/typed_abi_call/out_O2/Logger.approval.teal create mode 100644 test_cases/typed_abi_call/out_O2/Logger.clear.teal create mode 100644 test_cases/typed_abi_call/out_O2/Logger.destructured.ir create mode 100644 test_cases/typed_abi_call/out_unoptimized/Greeter.approval.teal create mode 100644 test_cases/typed_abi_call/out_unoptimized/Greeter.clear.teal create mode 100644 test_cases/typed_abi_call/out_unoptimized/Greeter.destructured.ir create mode 100644 test_cases/typed_abi_call/out_unoptimized/Logger.approval.teal create mode 100644 test_cases/typed_abi_call/out_unoptimized/Logger.clear.teal create mode 100644 test_cases/typed_abi_call/out_unoptimized/Logger.destructured.ir create mode 100644 test_cases/typed_abi_call/puya.log create mode 100644 test_cases/typed_abi_call/typed_c2c.py create mode 100644 tests/test_expected_output/itxn.test diff --git a/.gitignore b/.gitignore index 63ba652145..f6c31d8128 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ examples/**/*.trace # autogenerated doc /docs/apidocs/ /docs/puyapy-stubs/ +# ignore AWST from generated clients +/examples/**/out/out/**/client_*.awst +/test_cases/**/out/out/**/client_*.awst diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000000..b6ac1076f9 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,9 @@ +/* + Hide the first element of attribute like items as puyapy stubs are more like interfaces and as such + should not indicate a specific "value" for variables + */ +.py.data,.py.attribute { + dd p:first-child { + display: none; + } +} diff --git a/docs/conf.py b/docs/conf.py index 856ab8cbdb..845859bf9a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,7 +44,10 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output html_theme = "furo" -# html_static_path = ["_static"] +html_static_path = ["_static"] +html_css_files = [ + "custom.css", +] python_maximum_signature_line_length = 80 diff --git a/examples/amm/out/client_ConstantProductAMM.py b/examples/amm/out/client_ConstantProductAMM.py new file mode 100644 index 0000000000..f808cfa1e1 --- /dev/null +++ b/examples/amm/out/client_ConstantProductAMM.py @@ -0,0 +1,49 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class ConstantProductAMM(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def set_governor( + self, + new_governor: puyapy.Account, + ) -> None: ... + + @puyapy.arc4.abimethod + def bootstrap( + self, + seed: puyapy.gtxn.PaymentTransaction, + a_asset: puyapy.Asset, + b_asset: puyapy.Asset, + ) -> puyapy.arc4.UInt64: ... + + @puyapy.arc4.abimethod(default_args={'pool_asset': 'pool_token', 'a_asset': 'asset_a', 'b_asset': 'asset_b'}) + def mint( + self, + a_xfer: puyapy.gtxn.AssetTransferTransaction, + b_xfer: puyapy.gtxn.AssetTransferTransaction, + pool_asset: puyapy.Asset, + a_asset: puyapy.Asset, + b_asset: puyapy.Asset, + ) -> None: ... + + @puyapy.arc4.abimethod(default_args={'pool_asset': 'pool_token', 'a_asset': 'asset_a', 'b_asset': 'asset_b'}) + def burn( + self, + pool_xfer: puyapy.gtxn.AssetTransferTransaction, + pool_asset: puyapy.Asset, + a_asset: puyapy.Asset, + b_asset: puyapy.Asset, + ) -> None: ... + + @puyapy.arc4.abimethod(default_args={'a_asset': 'asset_a', 'b_asset': 'asset_b'}) + def swap( + self, + swap_xfer: puyapy.gtxn.AssetTransferTransaction, + a_asset: puyapy.Asset, + b_asset: puyapy.Asset, + ) -> None: ... diff --git a/examples/amm/out/contract.awst b/examples/amm/out/contract.awst index bbf0644295..d9f88877e0 100644 --- a/examples/amm/out/contract.awst +++ b/examples/amm/out/contract.awst @@ -28,7 +28,7 @@ contract ConstantProductAMM this.governor: puyapy.Account = new_governor } - abimethod bootstrap(seed: puyapy.gtxn.PaymentTransaction, a_asset: puyapy.Asset, b_asset: puyapy.Asset): puyapy.arc4.UIntN[typing.Literal[64]] + abimethod bootstrap(seed: puyapy.gtxn.PaymentTransaction, a_asset: puyapy.Asset, b_asset: puyapy.Asset): puyapy.arc4.UInt64 { assert(!(reinterpret_cast(this.pool_token)), comment="application has already been bootstrapped") this::_check_is_governor() @@ -41,7 +41,7 @@ contract ConstantProductAMM this.pool_token: puyapy.Asset = this::_create_pool_token() this::_do_opt_in(this.asset_a) this::_do_opt_in(this.asset_b) - return arc4_encode(reinterpret_cast(this.pool_token), puyapy.arc4.UIntN[typing.Literal[64]]) + return arc4_encode(reinterpret_cast(this.pool_token), puyapy.arc4.UInt64) } abimethod mint(a_xfer: puyapy.gtxn.AssetTransferTransaction, b_xfer: puyapy.gtxn.AssetTransferTransaction, pool_asset: puyapy.Asset, a_asset: puyapy.Asset, b_asset: puyapy.Asset): None diff --git a/examples/amm/puya.log b/examples/amm/puya.log index 2ab2cd4022..fb28cb8a84 100644 --- a/examples/amm/puya.log +++ b/examples/amm/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['amm'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['amm'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1860,4 +1860,5 @@ debug: Inserted __init___block@0.ops[7]: 'store new_state_value%0#0 to l-stack ( debug: Replaced __init___block@0.ops[10]: 'load new_state_value%0#0' with 'load new_state_value%0#0 from l-stack (no copy)' info: Writing amm/out/ConstantProductAMM.approval.teal info: Writing amm/out/ConstantProductAMM.clear.teal -info: Writing amm/out/ConstantProductAMM.arc32.json \ No newline at end of file +info: Writing amm/out/ConstantProductAMM.arc32.json +info: Writing amm/out/client_ConstantProductAMM.py \ No newline at end of file diff --git a/examples/auction/out/client_Auction.py b/examples/auction/out/client_Auction.py new file mode 100644 index 0000000000..591c45af54 --- /dev/null +++ b/examples/auction/out/client_Auction.py @@ -0,0 +1,44 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Auction(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def opt_into_asset( + self, + asset: puyapy.Asset, + ) -> None: ... + + @puyapy.arc4.abimethod + def start_auction( + self, + starting_price: puyapy.arc4.UInt64, + length: puyapy.arc4.UInt64, + axfer: puyapy.gtxn.AssetTransferTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def opt_in( + self, + ) -> None: ... + + @puyapy.arc4.abimethod + def bid( + self, + pay: puyapy.gtxn.PaymentTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def claim_bids( + self, + ) -> None: ... + + @puyapy.arc4.abimethod + def claim_asset( + self, + asset: puyapy.Asset, + ) -> None: ... diff --git a/examples/auction/out/contract.awst b/examples/auction/out/contract.awst index 765c56fb7a..5c55b640cc 100644 --- a/examples/auction/out/contract.awst +++ b/examples/auction/out/contract.awst @@ -33,7 +33,7 @@ contract Auction submit_txn(create_inner_transaction(TypeEnum=axfer, AssetReceiver=global(), XferAsset=asset, Fee=0u)) } - abimethod start_auction(starting_price: puyapy.arc4.UIntN[typing.Literal[64]], length: puyapy.arc4.UIntN[typing.Literal[64]], axfer: puyapy.gtxn.AssetTransferTransaction): None + abimethod start_auction(starting_price: puyapy.arc4.UInt64, length: puyapy.arc4.UInt64, axfer: puyapy.gtxn.AssetTransferTransaction): None { assert(txn() == global(), comment="auction must be started by creator") assert(this.auction_end == 0u, comment="auction already started") diff --git a/examples/auction/puya.log b/examples/auction/puya.log index e73909f854..8e1de3b23c 100644 --- a/examples/auction/puya.log +++ b/examples/auction/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['auction'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['auction'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1199,4 +1199,5 @@ debug: Inserted __init___block@0.ops[13]: 'store new_state_value%0#0 to l-stack debug: Replaced __init___block@0.ops[16]: 'load new_state_value%0#0' with 'load new_state_value%0#0 from l-stack (no copy)' info: Writing auction/out/Auction.approval.teal info: Writing auction/out/Auction.clear.teal -info: Writing auction/out/Auction.arc32.json \ No newline at end of file +info: Writing auction/out/Auction.arc32.json +info: Writing auction/out/client_Auction.py \ No newline at end of file diff --git a/examples/calculator/puya.log b/examples/calculator/puya.log index 03a9910e64..d4bc2bad5d 100644 --- a/examples/calculator/puya.log +++ b/examples/calculator/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['calculator'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['calculator'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/examples/global_state/puya.log b/examples/global_state/puya.log index 07f1b79c8e..e16753a99e 100644 --- a/examples/global_state/puya.log +++ b/examples/global_state/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['global_state'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['global_state'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/examples/hello_world/puya.log b/examples/hello_world/puya.log index 14dd5a3aab..709c7889aa 100644 --- a/examples/hello_world/puya.log +++ b/examples/hello_world/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['hello_world'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['hello_world'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/examples/hello_world_arc4/out/client_HelloWorldContract.py b/examples/hello_world_arc4/out/client_HelloWorldContract.py new file mode 100644 index 0000000000..4fe03d9dee --- /dev/null +++ b/examples/hello_world_arc4/out/client_HelloWorldContract.py @@ -0,0 +1,14 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class HelloWorldContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def hello( + self, + name: puyapy.arc4.String, + ) -> puyapy.arc4.String: ... diff --git a/examples/hello_world_arc4/puya.log b/examples/hello_world_arc4/puya.log index 5993da8fa6..558bb5b125 100644 --- a/examples/hello_world_arc4/puya.log +++ b/examples/hello_world_arc4/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['hello_world_arc4'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['hello_world_arc4'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -481,4 +481,5 @@ debug: Inserted hello_block@0.ops[10]: 'store concatenated%2#0 to l-stack (copy) debug: Replaced hello_block@0.ops[23]: 'load concatenated%2#0' with 'load concatenated%2#0 from l-stack (no copy)' info: Writing hello_world_arc4/out/HelloWorldContract.approval.teal info: Writing hello_world_arc4/out/HelloWorldContract.clear.teal -info: Writing hello_world_arc4/out/HelloWorldContract.arc32.json \ No newline at end of file +info: Writing hello_world_arc4/out/HelloWorldContract.arc32.json +info: Writing hello_world_arc4/out/client_HelloWorldContract.py \ No newline at end of file diff --git a/examples/local_state/puya.log b/examples/local_state/puya.log index 4ab89bf056..dbe6ef8560 100644 --- a/examples/local_state/puya.log +++ b/examples/local_state/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['local_state'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['local_state'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/examples/merkle/out/client_MerkleTree.py b/examples/merkle/out/client_MerkleTree.py new file mode 100644 index 0000000000..41df83426d --- /dev/null +++ b/examples/merkle/out/client_MerkleTree.py @@ -0,0 +1,21 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class MerkleTree(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod(create=True) + def create( + self, + root: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]], + ) -> None: ... + + @puyapy.arc4.abimethod + def verify( + self, + proof: puyapy.arc4.DynamicArray[puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]], + leaf: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]], + ) -> puyapy.arc4.Bool: ... diff --git a/examples/merkle/out/contract.awst b/examples/merkle/out/contract.awst index 1f25d45c6d..f2ceb13ef8 100644 --- a/examples/merkle/out/contract.awst +++ b/examples/merkle/out/contract.awst @@ -1,30 +1,30 @@ contract MerkleTree { globals { - ['root']: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] + ['root']: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] } - subroutine hash_pair(a: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]], b: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]]): puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] + subroutine hash_pair(a: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]], b: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]): puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] { hash_bytes: puyapy.Bytes = sha256((reinterpret_cast(reinterpret_cast(a)) < reinterpret_cast(reinterpret_cast(b))) ? (reinterpret_cast(a) + reinterpret_cast(b)) : (reinterpret_cast(b) + reinterpret_cast(a))) - return reinterpret_cast(hash_bytes) + return reinterpret_cast(hash_bytes) } - subroutine compute_root_hash(proof: puyapy.arc4.DynamicArray[puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]]], leaf: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]]): puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] + subroutine compute_root_hash(proof: puyapy.arc4.DynamicArray[puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]], leaf: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]): puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] { - computed: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] = leaf.copy() + computed: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] = leaf.copy() for proof_hash in proof { - computed: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] = this::hash_pair(computed, proof_hash) + computed: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] = this::hash_pair(computed, proof_hash) } return computed } - abimethod create(root: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]]): None + abimethod create(root: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]): None { - this.root: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] = root.copy() + this.root: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] = root.copy() } - abimethod verify(proof: puyapy.arc4.DynamicArray[puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]]], leaf: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]]): bool + abimethod verify(proof: puyapy.arc4.DynamicArray[puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]], leaf: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]): bool { return reinterpret_cast(this.root) == reinterpret_cast(this::compute_root_hash(proof, leaf)) } diff --git a/examples/merkle/puya.log b/examples/merkle/puya.log index aca8f4a9e2..e7112f4f62 100644 --- a/examples/merkle/puya.log +++ b/examples/merkle/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['merkle'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['merkle'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -620,4 +620,5 @@ debug: shared x-stack for hash_pair_ternary_true@1 -> hash_pair_ternary_merge@3: debug: shared x-stack for hash_pair_ternary_false@2 -> hash_pair_ternary_merge@3: ternary_result%1#0 info: Writing merkle/out/MerkleTree.approval.teal info: Writing merkle/out/MerkleTree.clear.teal -info: Writing merkle/out/MerkleTree.arc32.json \ No newline at end of file +info: Writing merkle/out/MerkleTree.arc32.json +info: Writing merkle/out/client_MerkleTree.py \ No newline at end of file diff --git a/examples/sizes.txt b/examples/sizes.txt index 427848c618..ab5c66c634 100644 --- a/examples/sizes.txt +++ b/examples/sizes.txt @@ -6,12 +6,13 @@ arc4_numeric_comparisons/UIntNOrdering 1220 908 908 arc4_types/Arc4Arrays 588 376 376 arc4_types/Arc4BoolEval 569 20 20 arc4_types/Arc4BoolType 329 57 57 +arc4_types/Arc4DynamicBytes 247 128 128 arc4_types/Arc4DynamicStringArray 230 112 112 arc4_types/Arc4MutableParams 362 222 220 arc4_types/Arc4Mutation 2803 1452 1451 -arc4_types/Arc4NumericTypes 345 8 8 +arc4_types/Arc4NumericTypes 538 8 8 arc4_types/Arc4RefTypes 47 43 43 -arc4_types/Arc4StringTypes 328 8 8 +arc4_types/Arc4StringTypes 309 8 8 arc4_types/Arc4StructsFromAnotherModule 67 12 12 arc4_types/Arc4StructsType 296 237 237 arc4_types/Arc4TuplesType 799 146 146 @@ -67,6 +68,8 @@ template_variables/TemplateVariables 168 155 155 too_many_permutations 108 107 107 transaction/Transaction 893 849 849 tuple_support/TupleSupport 442 294 294 +typed_abi_call/Greeter 1285 1168 1168 +typed_abi_call/Logger 569 478 478 unary/Unary 134 96 96 undefined_phi_args/Baddie 350 286 286 unssa/UnSSA 446 375 375 diff --git a/examples/voting/out/VotingRoundApp.arc32.json b/examples/voting/out/VotingRoundApp.arc32.json index 752f23c4a8..ca65ee3267 100644 --- a/examples/voting/out/VotingRoundApp.arc32.json +++ b/examples/voting/out/VotingRoundApp.arc32.json @@ -22,7 +22,7 @@ }, "structs": { "output": { - "name": "arc4.struct", + "name": "VotingPreconditions", "elements": [ [ "is_voting_open", diff --git a/examples/voting/out/client_VotingRoundApp.py b/examples/voting/out/client_VotingRoundApp.py new file mode 100644 index 0000000000..30ffe39dda --- /dev/null +++ b/examples/voting/out/client_VotingRoundApp.py @@ -0,0 +1,51 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + +class VotingPreconditions(puyapy.arc4.Struct): + is_voting_open: puyapy.arc4.UInt64 + is_allowed_to_vote: puyapy.arc4.UInt64 + has_already_voted: puyapy.arc4.UInt64 + current_time: puyapy.arc4.UInt64 + +class VotingRoundApp(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod(create=True) + def create( + self, + vote_id: puyapy.arc4.String, + snapshot_public_key: puyapy.arc4.DynamicBytes, + metadata_ipfs_cid: puyapy.arc4.String, + start_time: puyapy.arc4.UInt64, + end_time: puyapy.arc4.UInt64, + option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8], + quorum: puyapy.arc4.UInt64, + nft_image_url: puyapy.arc4.String, + ) -> None: ... + + @puyapy.arc4.abimethod + def bootstrap( + self, + fund_min_bal_req: puyapy.gtxn.PaymentTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def close( + self, + ) -> None: ... + + @puyapy.arc4.abimethod(readonly=True) + def get_preconditions( + self, + signature: puyapy.arc4.DynamicBytes, + ) -> VotingPreconditions: ... + + @puyapy.arc4.abimethod + def vote( + self, + fund_min_bal_req: puyapy.gtxn.PaymentTransaction, + signature: puyapy.arc4.DynamicBytes, + answer_ids: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8], + ) -> None: ... diff --git a/examples/voting/out/voting.awst b/examples/voting/out/voting.awst index 5c96ed8724..c688de7ae7 100644 --- a/examples/voting/out/voting.awst +++ b/examples/voting/out/voting.awst @@ -6,10 +6,10 @@ ASSET_MIN_BALANCE = 100000 TALLY_BOX_KEY = b'V' struct VotingPreconditions { - is_voting_open: puyapy.arc4.UIntN[typing.Literal[64]] - is_allowed_to_vote: puyapy.arc4.UIntN[typing.Literal[64]] - has_already_voted: puyapy.arc4.UIntN[typing.Literal[64]] - current_time: puyapy.arc4.UIntN[typing.Literal[64]] + is_voting_open: puyapy.arc4.UInt64 + is_allowed_to_vote: puyapy.arc4.UInt64 + has_already_voted: puyapy.arc4.UInt64 + current_time: puyapy.arc4.UInt64 } contract VotingRoundApp @@ -26,7 +26,7 @@ contract VotingRoundApp ['quorum']: puyapy.UInt64 ['nft_image_url']: puyapy.Bytes ['nft_asset_id']: puyapy.UInt64 - ['option_counts']: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] + ['option_counts']: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] ['total_options']: puyapy.UInt64 } @@ -36,7 +36,7 @@ contract VotingRoundApp this.voter_count: puyapy.UInt64 = 0u } - abimethod create(vote_id: puyapy.arc4.String, snapshot_public_key: puyapy.Bytes, metadata_ipfs_cid: puyapy.arc4.String, start_time: puyapy.UInt64, end_time: puyapy.UInt64, option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]], quorum: puyapy.UInt64, nft_image_url: puyapy.arc4.String): None + abimethod create(vote_id: puyapy.arc4.String, snapshot_public_key: puyapy.Bytes, metadata_ipfs_cid: puyapy.arc4.String, start_time: puyapy.UInt64, end_time: puyapy.UInt64, option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8], quorum: puyapy.UInt64, nft_image_url: puyapy.arc4.String): None { assert(start_time < end_time, comment="End time should be after start time") assert(end_time >= global(), comment="End time should be in the future") @@ -91,12 +91,12 @@ contract VotingRoundApp this.nft_asset_id: puyapy.UInt64 = reinterpret_cast(submit_txn(create_inner_transaction(TypeEnum=acfg, ConfigAssetTotal=1u, ConfigAssetDecimals=0u, ConfigAssetDefaultFrozen=false, ConfigAssetName='[VOTE RESULT] ' + this.vote_id, ConfigAssetUnitName='VOTERSLT', ConfigAssetURL=this.nft_image_url, Note=note)).CreatedAssetID) } - abimethod get_preconditions(signature: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]): examples.voting.voting.VotingPreconditions + abimethod get_preconditions(signature: puyapy.arc4.DynamicBytes): examples.voting.voting.VotingPreconditions { - return arc4_encode((arc4_encode(this::voting_open(), puyapy.arc4.UIntN[typing.Literal[64]]), arc4_encode(this::allowed_to_vote(SINGLE_EVAL(id=0, source=reinterpret_cast(signature))[select(len(SINGLE_EVAL(id=0, source=reinterpret_cast(signature))), 2u, 2u < len(SINGLE_EVAL(id=0, source=reinterpret_cast(signature)))):]), puyapy.arc4.UIntN[typing.Literal[64]]), arc4_encode(this::already_voted(), puyapy.arc4.UIntN[typing.Literal[64]]), arc4_encode(global(), puyapy.arc4.UIntN[typing.Literal[64]])), examples.voting.voting.VotingPreconditions) + return arc4_encode((arc4_encode(this::voting_open(), puyapy.arc4.UInt64), arc4_encode(this::allowed_to_vote(SINGLE_EVAL(id=0, source=reinterpret_cast(signature))[select(len(SINGLE_EVAL(id=0, source=reinterpret_cast(signature))), 2u, 2u < len(SINGLE_EVAL(id=0, source=reinterpret_cast(signature)))):]), puyapy.arc4.UInt64), arc4_encode(this::already_voted(), puyapy.arc4.UInt64), arc4_encode(global(), puyapy.arc4.UInt64)), examples.voting.voting.VotingPreconditions) } - abimethod vote(fund_min_bal_req: puyapy.gtxn.PaymentTransaction, signature: puyapy.Bytes, answer_ids: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]): None + abimethod vote(fund_min_bal_req: puyapy.gtxn.PaymentTransaction, signature: puyapy.Bytes, answer_ids: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]): None { puyapy::ensure_budget(required_budget=7700u, fee_source=0u) assert(this::allowed_to_vote(signature), comment="Not allowed to vote") @@ -131,7 +131,7 @@ contract VotingRoundApp return exists } - subroutine store_option_counts(option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]): None + subroutine store_option_counts(option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]): None { assert(reinterpret_cast(extract_uint16(option_counts, 0u)), comment="option_counts should be non-empty") assert(extract_uint16(option_counts, 0u) <= 112u, comment="Can't have more than 112 questions") @@ -140,7 +140,7 @@ contract VotingRoundApp total_options += arc4_decode(item, puyapy.UInt64) } assert(total_options <= 128u, comment="Can't have more than 128 vote options") - this.option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] = option_counts.copy() + this.option_counts: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] = option_counts.copy() this.total_options: puyapy.UInt64 = total_options } diff --git a/examples/voting/puya.log b/examples/voting/puya.log index acba46ae57..b25f221485 100644 --- a/examples/voting/puya.log +++ b/examples/voting/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['voting'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['voting'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1964,4 +1964,5 @@ debug: Inserted increment_vote_in_box_block@0.ops[25]: 'store tmp%4#0 to l-stack debug: Replaced increment_vote_in_box_block@0.ops[29]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' info: Writing voting/out/VotingRoundApp.approval.teal info: Writing voting/out/VotingRoundApp.clear.teal -info: Writing voting/out/VotingRoundApp.arc32.json \ No newline at end of file +info: Writing voting/out/VotingRoundApp.arc32.json +info: Writing voting/out/client_VotingRoundApp.py \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index fb311ed8d3..853f2b3f6d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3110,4 +3110,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "a2756c76a11aeebc03e6c710c4ae698dbc9832cb03c3a72c3ea4a1a39521d976" +content-hash = "0218b3d2cdeef8a65d35c18097284e89fb368c7c375ce46761e256c3fee58e10" diff --git a/pyproject.toml b/pyproject.toml index 7f64a7b0d8..e61e66fa58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.12" typing-extensions = "^4.8.0" -attrs = "^23.1.0" +attrs = "^23.2.0" structlog = "^23.2.0" networkx = "^3.1" docstring-parser = ">=0.14.1" @@ -70,6 +70,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] puyapy = "puya.__main__:main" +puyapy-clientgen = "puya.client_gen:main" [tool.pytest.ini_options] markers = [ diff --git a/scripts/compile_all_examples.py b/scripts/compile_all_examples.py index cdc41d70d7..c154c0bbae 100755 --- a/scripts/compile_all_examples.py +++ b/scripts/compile_all_examples.py @@ -220,6 +220,7 @@ def _compile_for_level(arg: tuple[Path, int]) -> tuple[CompilationResult, int]: "--output-optimization-ir", "--output-destructured-ir", "--output-memory-ir", + "--output-client", ] out_suffix = SUFFIX_O1 write_logs = True @@ -242,7 +243,7 @@ def main(options: CompileAllOptions) -> None: item for root in CONTRACT_ROOT_DIRS for item in root.iterdir() - if item.is_dir() and not item.name.startswith(".") + if item.is_dir() and any(item.glob("*.py")) ] modified_teal = defaultdict[int, list[Path]](list) diff --git a/scripts/generate_docs.py b/scripts/generate_docs.py index de9ac415f7..a690031d48 100755 --- a/scripts/generate_docs.py +++ b/scripts/generate_docs.py @@ -52,7 +52,7 @@ def output_doc_stubs(parse_result: ParseResult) -> None: def output_combined_stub(stubs: "DocStub", output: Path) -> None: # remove puyapy imports that have been inlined - lines = ["# ruff: noqa: A001, E501, F403, PYI021, PYI034"] + lines = ["# ruff: noqa: A001, E501, F403, PYI021, PYI034, W291"] rexported = list[str]() for module, imports in stubs.collected_imports.items(): if imports.import_module: @@ -103,9 +103,10 @@ class SymbolCollector(NodeVisitor[None]): all_classes: dict[str, tuple[mypy.nodes.MypyFile, mypy.nodes.ClassDef]] inlined_protocols: dict[str, set[str]] symbols: dict[str, str] = attrs.field(factory=dict) + last_stmt: mypy.nodes.Statement | None = None def get_src( - self, node: mypy.nodes.Node, *, path: str | None = None, entire_lines: bool = True + self, node: mypy.nodes.Context, *, path: str | None = None, entire_lines: bool = True ) -> str: columns: tuple[int, int] | None = None if node.end_column and not entire_lines: @@ -131,6 +132,7 @@ def get_src_from_lines( def visit_mypy_file(self, o: mypy.nodes.MypyFile) -> None: for stmt in o.defs: stmt.accept(self) + self.last_stmt = stmt def _get_bases(self, klass: mypy.nodes.ClassDef) -> ClassBases: bases = list[mypy.nodes.Expression]() @@ -194,7 +196,20 @@ def visit_assignment_stmt(self, o: mypy.nodes.AssignmentStmt) -> None: raise Exception(f"Multi assignments are not supported: {o}") from ex if not isinstance(lvalue, mypy.nodes.NameExpr): raise Exception(f"Multi assignments are not supported: {lvalue}") - self.symbols[lvalue.name] = self.get_src(o.rvalue) + # find actual rvalue src location by taking the entire statement and subtracting the lvalue + loc = mypy.nodes.Context() + loc.set_line(o) + if lvalue.end_column: + loc.column = lvalue.end_column + self.symbols[lvalue.name] = self.get_src(loc) + + def visit_expression_stmt(self, o: mypy.nodes.ExpressionStmt) -> None: + if isinstance(o.expr, mypy.nodes.StrExpr) and isinstance( + self.last_stmt, mypy.nodes.AssignmentStmt + ): + (lvalue,) = self.last_stmt.lvalues + if isinstance(lvalue, mypy.nodes.NameExpr): + self.symbols[lvalue.name] += "\n" + self.get_src(o.expr) def _is_protocol(self, fullname: str) -> bool: try: diff --git a/src/puya/__main__.py b/src/puya/__main__.py index c73f27f6ab..9c9593b8c8 100644 --- a/src/puya/__main__.py +++ b/src/puya/__main__.py @@ -34,6 +34,12 @@ def main() -> None: default=True, help="Output arc32.json", ) + parser.add_argument( + "--output-client", + action=argparse.BooleanOptionalAction, + default=True, + help="Output puyapy contract client for typed ARC4 ABI calls", + ) parser.add_argument( "--out-dir", type=Path, help="path for outputting artefacts", default=False ) diff --git a/src/puya/arc32.py b/src/puya/arc32.py index ad1bfca0fb..3ae1467d70 100644 --- a/src/puya/arc32.py +++ b/src/puya/arc32.py @@ -1,18 +1,28 @@ import base64 +import itertools import json +import textwrap import typing -from collections.abc import Collection, Mapping, Sequence +from collections.abc import Collection, Iterable, Mapping, Sequence +from pathlib import Path +import structlog + +from puya.arc4_util import arc4_to_wtype from puya.avm_type import AVMType +from puya.awst_build import constants from puya.errors import InternalError from puya.models import ( ARC4Method, + ARC4MethodArg, ARC4MethodConfig, + ARC32StructDef, CompiledContract, ContractState, OnCompletionAction, ) from puya.parse import SourceLocation +from puya.utils import make_path_relative_to_cwd, unique OCA_ARC32_MAPPING = { OnCompletionAction.NoOp: "no_op", @@ -25,6 +35,10 @@ JSONValue: typing.TypeAlias = "str | int | float | bool | None | Sequence[JSONValue] | JSONDict" JSONDict: typing.TypeAlias = Mapping[str, "JSONValue"] +_AUTO_GENERATED_COMMENT = "# This file is auto-generated, do not modify" +_INDENT = " " * 4 + +logger = structlog.get_logger(__file__) def _encode_source(teal_text: str) -> str: @@ -76,7 +90,9 @@ def _get_signature(method: ARC4Method) -> str: return f"{method.config.name}({','.join(m.type_ for m in method.args)}){method.returns.type_}" -def _encode_default_arg(contract: CompiledContract, source: str, loc: SourceLocation) -> JSONDict: +def _encode_default_arg( + contract: CompiledContract, source: str, loc: SourceLocation | None +) -> JSONDict: if state := contract.metadata.global_state.get(source): return { "source": "global-state", @@ -192,3 +208,114 @@ def create_arc32_json(contract: CompiledContract) -> str: "bare_call_config": _encode_bare_method_configs(bare_methods), } return json.dumps(_filter_none(app_spec), indent=4) + + +def write_arc32_client(name: str, methods: Sequence[ARC4Method], out_dir: Path) -> None: + stub_path = out_dir / f"client_{name}.py" + if _can_overwrite_auto_generated_file(stub_path): + logger.info(f"Writing {make_path_relative_to_cwd(stub_path)}") + stub_text = _create_arc32_stub(name, methods) + stub_path.write_text(stub_text) + else: + logger.error( + f"Not outputting {make_path_relative_to_cwd(stub_path)} " + "since content does not appear to be auto-generated" + ) + + +def _can_overwrite_auto_generated_file(path: Path) -> bool: + return not path.exists() or path.read_text().startswith(_AUTO_GENERATED_COMMENT) + + +def _create_arc32_stub(name: str, methods: Sequence[ARC4Method]) -> str: + return "\n".join( + ( + _AUTO_GENERATED_COMMENT, + "# flake8: noqa", # this works for flake8 and ruff + "# fmt: off", # disable formatting" + "import typing", + "", + "import puyapy", + "", + *itertools.chain( + *( + _abi_struct_to_class(s) + for s in unique(s for m in methods for s in m.config.structs.values()) + ) + ), + "", + f"class {name}(puyapy.arc4.ARC4Client, typing.Protocol):", + *(_abi_method_to_signature(m) for m in methods if not m.config.is_bare), + ) + ) + + +def _abi_struct_to_class(s: ARC32StructDef) -> Iterable[str]: + return ( + f"class {s.name}(puyapy.arc4.Struct):", + _indent( + f"{name}: {_arc4_type_to_puyapy_cls(elem_type)}" for name, elem_type in s.elements + ), + ) + + +def _abi_method_to_signature(m: ARC4Method) -> str: + structs = dict(m.config.structs) + try: + output_struct = structs["output"] + except KeyError: + return_type = _arc4_type_to_puyapy_cls(m.returns.type_) + else: + return_type = output_struct.name + + return _indent( + ( + _arc4_method_to_decorator(m), + f"def {m.name}(", + _indent( + ( + "self,", + *(_abi_arg(arg, structs.get(arg.name)) for arg in m.args), + ) + ), + f") -> {return_type}: ...", + "", + ) + ) + + +def _abi_arg(arg: ARC4MethodArg, struct: ARC32StructDef | None) -> str: + python_type = struct.name if struct else _arc4_type_to_puyapy_cls(arg.type_) + return f"{arg.name}: {python_type}," + + +def _arc4_type_to_puyapy_cls(typ: str) -> str: + return arc4_to_wtype(typ).stub_name + + +def _arc4_method_to_decorator(method: ARC4Method) -> str: + config = method.config + abimethod_args = dict[str, object]() + if config.name and config.name != method.name: + abimethod_args["name"] = config.name + if config.readonly: + abimethod_args["readonly"] = True + if config.default_args: + abimethod_args["default_args"] = dict(config.default_args) + if config.allowed_completion_types != (OnCompletionAction.NoOp,): + abimethod_args["allow_actions"] = [oca.name for oca in config.allowed_completion_types] + if config.allow_create: + abimethod_args["create"] = "allow" + elif config.require_create: + abimethod_args["create"] = True + kwargs = ", ".join(f"{name}={value!r}" for name, value in abimethod_args.items()) + decorator = f"@{constants.ABIMETHOD_DECORATOR_ALIAS}" + if kwargs: + decorator += f"({kwargs})" + return decorator + + +def _indent(lines: Iterable[str] | str) -> str: + if not isinstance(lines, str): + lines = "\n".join(lines) + return textwrap.indent(lines, _INDENT) diff --git a/src/puya/arc4_util.py b/src/puya/arc4_util.py index 1eb8554972..a540d52115 100644 --- a/src/puya/arc4_util.py +++ b/src/puya/arc4_util.py @@ -1,12 +1,14 @@ +import re import typing -from collections.abc import Sequence +from collections.abc import Iterable, Sequence from itertools import zip_longest from puya.awst import ( nodes as awst_nodes, wtypes, ) -from puya.errors import InternalError +from puya.awst_build import constants +from puya.errors import InternalError, PuyaError from puya.models import ARC4MethodConfig from puya.parse import SourceLocation from puya.utils import round_bits_to_nearest_bytes @@ -42,6 +44,104 @@ def determine_arc4_tuple_head_size( ) +_UINT_REGEX = re.compile(r"^uint(?P[0-9]+)$") +_UFIXED_REGEX = re.compile(r"^ufixed(?P[0-9]+)x(?P[0-9]+)$") +_FIXED_ARRAY_REGEX = re.compile(r"^(?P.+)\[(?P[0-9]+)]$") +_DYNAMIC_ARRAY_REGEX = re.compile(r"^(?P.+)\[]$") +_TUPLE_REGEX = re.compile(r"^\((?P.+)\)$") +_ARC4_WTYPE_MAPPING = { + "bool": wtypes.arc4_bool_wtype, + "string": wtypes.arc4_string_wtype, + "account": wtypes.account_wtype, + "application": wtypes.application_wtype, + "asset": wtypes.asset_wtype, + "void": wtypes.void_wtype, + **{ + t.name if t else "txn": wtypes.WGroupTransaction.from_type(t) + for t in constants.TRANSACTION_TYPE_TO_CLS + }, + "address": wtypes.arc4_address_type, + "byte": wtypes.arc4_byte_type, + "byte[]": wtypes.arc4_dynamic_bytes, +} + + +def arc4_to_wtype(typ: str) -> wtypes.WType: + try: + return _ARC4_WTYPE_MAPPING[typ] + except KeyError: + pass + if uint := _UINT_REGEX.match(typ): + n = uint.group("n") + return wtypes.ARC4UIntN.from_scale(int(n)) + if ufixed := _UFIXED_REGEX.match(typ): + n, m = ufixed.group("n", "m") + return wtypes.ARC4UFixedNxM.from_scale_and_precision(int(n), int(m)) + if fixed_array := _FIXED_ARRAY_REGEX.match(typ): + arr_type, size = fixed_array.group("type", "size") + inner_cls = arc4_to_wtype(arr_type) + return wtypes.ARC4StaticArray.from_element_type_and_size(inner_cls, int(size)) + if dynamic_array := _DYNAMIC_ARRAY_REGEX.match(typ): + arr_type = dynamic_array.group("type") + inner_cls = arc4_to_wtype(arr_type) + return wtypes.ARC4DynamicArray.from_element_type(inner_cls) + if tuple_match := _TUPLE_REGEX.match(typ): + tuple_types = map(arc4_to_wtype, _split_tuple_types(tuple_match.group("types"))) + return wtypes.ARC4Tuple.from_types(tuple_types) + raise PuyaError(f"Unknown ARC4 type '{typ}'") + + +def _split_tuple_types(types: str) -> Iterable[str]: + """Splits inner tuple types into individual elements. + + e.g. "uint64,(uint8,string),bool" becomes ["uint64", "(uint8,string)", "bool"] + """ + tuple_level = 0 + last_idx = 0 + for idx, token in enumerate(types): + if token == "(": + tuple_level += 1 + elif token == ")": + tuple_level -= 1 + if token == "," and tuple_level == 0: + yield types[last_idx:idx] + last_idx = idx + 1 + yield types[last_idx:] + + +def _split_signature(signature: str) -> Iterable[str]: + """Splits signature into name, args and returns""" + level = 0 + last_idx = 0 + for idx, token in enumerate(signature): + if token == "(": + level += 1 + if level == 1: + yield signature[:idx] + last_idx = idx + 1 + elif token == ")": + level -= 1 + if level == 0: + yield signature[last_idx:idx] + last_idx = idx + 1 + if last_idx < len(signature): + yield signature[last_idx:] + + +def parse_method_signature( + signature: str, +) -> tuple[str, list[wtypes.WType] | None, wtypes.WType | None]: + name, *maybe_arg_returns = _split_signature(signature) + args: list[wtypes.WType] | None = None + returns: wtypes.WType | None = None + if maybe_arg_returns: + args_str, *maybe_returns = maybe_arg_returns + args = [arc4_to_wtype(a) for a in _split_tuple_types(args_str)] + if maybe_returns: + returns = arc4_to_wtype(maybe_returns[0]) + return name, args, returns + + def wtype_to_arc4(wtype: wtypes.WType, loc: SourceLocation | None = None) -> str: match wtype: case ( @@ -79,6 +179,14 @@ def get_abi_signature(subroutine: awst_nodes.ContractMethod, config: ARC4MethodC return f"{config.name}({','.join(arg_types)}){return_type}" +def get_abi_signature_from_wtypes( + name: str, args: Sequence[wtypes.WType], return_wtype: wtypes.WType +) -> str: + arg_types = [wtype_to_arc4(a) for a in args] + return_type = wtype_to_arc4(return_wtype) + return f"{name}({','.join(arg_types)}){return_type}" + + _TIntOrNone = typing.TypeVar("_TIntOrNone", int, None) diff --git a/src/puya/awst/nodes.py b/src/puya/awst/nodes.py index 21e2552bb0..8ed2e86896 100644 --- a/src/puya/awst/nodes.py +++ b/src/puya/awst/nodes.py @@ -650,9 +650,9 @@ class TxnFields: num_assets = TxnField.uint64(is_inner_param=False) num_apps = TxnField.uint64(immediate="NumApplications", is_inner_param=False) global_num_uint = TxnField.uint64() - global_num_byte_slice = TxnField.uint64() + global_num_bytes = TxnField.uint64(immediate="GlobalNumByteSlice") local_num_uint = TxnField.uint64() - local_num_byte_slice = TxnField.uint64() + local_num_bytes = TxnField.uint64(immediate="LocalNumByteSlice") # v4 extra_program_pages = TxnField.uint64() # v5 @@ -1709,7 +1709,7 @@ def accept(self, visitor: ModuleStatementVisitor[T]) -> T: return visitor.visit_structure_definition(self) -@attrs.frozen(slots=False) +@attrs.frozen class Module: name: str source_file_path: str diff --git a/src/puya/awst/wtypes.py b/src/puya/awst/wtypes.py index f3fabc1112..be2eaf6be9 100644 --- a/src/puya/awst/wtypes.py +++ b/src/puya/awst/wtypes.py @@ -21,16 +21,16 @@ def _all_literals_invalid(_value: object) -> bool: return False +LiteralValidator: typing.TypeAlias = Callable[[object], bool] + + @attrs.frozen(str=False, kw_only=True) class WType: name: str stub_name: str lvalue: bool = True immutable: bool = True - is_valid_literal: Callable[[object], bool] = attrs.field( - default=_all_literals_invalid, - eq=False, # TODO: is this the right thing to do? - ) + is_valid_literal: LiteralValidator = attrs.field(default=_all_literals_invalid, eq=False) def __str__(self) -> str: return self.stub_name @@ -44,12 +44,17 @@ def _is_unsigned_int(value: object) -> typing.TypeGuard[int]: return isinstance(value, int) and not isinstance(value, bool) and value >= 0 -def is_valid_uint64_literal(value: object) -> typing.TypeGuard[int]: - return _is_unsigned_int(value) and value.bit_length() <= 64 +def _uint_literal_validator(*, max_bits: int) -> Callable[[object], typing.TypeGuard[int]]: + def validator(value: object) -> typing.TypeGuard[int]: + return _is_unsigned_int(value) and value.bit_length() <= max_bits + + return validator + + +is_valid_uint64_literal = _uint_literal_validator(max_bits=64) -def is_valid_biguint_literal(value: object) -> typing.TypeGuard[int]: - return _is_unsigned_int(value) and value.bit_length() <= MAX_BIGUINT_BITS +is_valid_biguint_literal = _uint_literal_validator(max_bits=MAX_BIGUINT_BITS) def is_valid_bytes_literal(value: object) -> typing.TypeGuard[bytes]: @@ -237,23 +242,24 @@ class ARC4Type(WType): class ARC4UIntN(ARC4Type): n: int + is_valid_literal: LiteralValidator = attrs.field(init=False, eq=False) + + @is_valid_literal.default + def _literal_validator(self) -> LiteralValidator: + return _uint_literal_validator(max_bits=self.n) + @classmethod - def from_scale(cls, n: int, *, alias: str | None = None) -> typing.Self: + def from_scale(cls, n: int) -> typing.Self: assert n % 8 == 0, "bit size must be multiple of 8" assert 8 <= n <= 512, "bit size must be between 8 and 512 inclusive" name = f"arc4.uint{n}" - base_cls = constants.CLS_ARC4_UINTN if n <= 64 else constants.CLS_ARC4_BIG_UINTN + if n.bit_count() == 1: # quick way to check for power of 2 + stub_name = f"{constants.ARC4_PREFIX}UInt{n}" + else: + base_cls = constants.CLS_ARC4_UINTN if n <= 64 else constants.CLS_ARC4_BIG_UINTN + stub_name = f"{base_cls}[typing.Literal[{n}]]" - def is_valid_literal(value: object) -> bool: - return isinstance(value, int) and value >= 0 and value.bit_length() <= n - - return cls( - n=n, - name=name, - stub_name=f"{base_cls}[typing.Literal[{n}]]", - alias=alias, - is_valid_literal=is_valid_literal, - ) + return cls(n=n, name=name, stub_name=stub_name) @typing.final @@ -294,17 +300,15 @@ def is_valid_literal(value: object) -> bool: if not isinstance(value, decimal.Decimal): return False - if value < 0 or not value.is_finite(): + sign, digits, exponent = value.as_tuple() + if sign != 0: # is negative return False - decimal_str = str(value) - try: - whole, part = decimal_str.split(".") - except ValueError: + if not isinstance(exponent, int): # is infinite return False # note: input is expected to be quantized correctly already - if len(part) != m: + if -exponent != m: # wrong precision return False - adjusted_int = int(decimal_str.replace(".", "")) + adjusted_int = int("".join(map(str, digits))) return adjusted_int.bit_length() <= n return cls( @@ -404,7 +408,29 @@ def from_name_and_fields(cls, *, python_name: str, fields: Mapping[str, WType]) is_valid_literal=is_valid_utf8_literal, ) arc4_bool_wtype: typing.Final = ARC4Type( - name="arc4.bool", stub_name=constants.CLS_ARC4_BOOL, alias="bool" + name="arc4.bool", + stub_name=constants.CLS_ARC4_BOOL, + alias="bool", + is_valid_literal=is_valid_bool_literal, +) +arc4_byte_type: typing.Final = ARC4UIntN( + n=8, + name="arc4.byte", + stub_name=constants.CLS_ARC4_BYTE, + alias="byte", +) +arc4_dynamic_bytes: typing.Final = ARC4DynamicArray( + name="arc4.dynamic_bytes", + element_type=arc4_byte_type, + is_valid_literal=is_valid_bytes_literal, + stub_name=constants.CLS_ARC4_DYNAMIC_BYTES, +) +arc4_address_type: typing.Final = ARC4StaticArray( + array_size=32, + name="arc4.address", + element_type=arc4_byte_type, + stub_name=constants.CLS_ARC4_ADDRESS, + alias="address", ) @@ -504,9 +530,7 @@ def avm_to_arc4_equivalent_type(wtype: WType) -> WType: if wtype is biguint_wtype: return ARC4UIntN.from_scale(512) if wtype is bytes_wtype: - return ARC4DynamicArray.from_element_type( - element_type=ARC4UIntN.from_scale(8, alias="byte") - ) + return arc4_dynamic_bytes if isinstance(wtype, WTuple): return ARC4Tuple.from_types(types=[avm_to_arc4_equivalent_type(t) for t in wtype.types]) raise InternalError(f"{wtype} does not have an arc4 equivalent type") diff --git a/src/puya/awst_build/arc4_utils.py b/src/puya/awst_build/arc4_utils.py new file mode 100644 index 0000000000..8a159492f3 --- /dev/null +++ b/src/puya/awst_build/arc4_utils.py @@ -0,0 +1,336 @@ +import typing +from typing import Never + +import mypy.nodes +import mypy.types +import mypy.visitor +from immutabledict import immutabledict + +import puya.models +from puya.arc4_util import wtype_to_arc4 +from puya.awst import ( + nodes as awst_nodes, + wtypes, +) +from puya.awst_build import constants +from puya.awst_build.context import ASTConversionModuleContext +from puya.awst_build.utils import extract_bytes_literal_from_mypy +from puya.errors import CodeError, InternalError +from puya.models import ARC4MethodConfig, ARC32StructDef, OnCompletionAction +from puya.parse import SourceLocation + +ALLOWABLE_OCA = [oca.name for oca in OnCompletionAction if oca != OnCompletionAction.ClearState] + + +def get_arc4_method_config( + context: ASTConversionModuleContext, + decorator: mypy.nodes.Expression, + func_def: mypy.nodes.FuncDef, +) -> ARC4MethodConfig: + dec_loc = context.node_location(decorator, func_def.info) + match decorator: + case mypy.nodes.RefExpr(fullname=fullname): + return ARC4MethodConfig( + name=func_def.name, + source_location=dec_loc, + is_bare=fullname == constants.BAREMETHOD_DECORATOR, + ) + case mypy.nodes.CallExpr( + args=args, + arg_names=arg_names, + callee=mypy.nodes.RefExpr(fullname=fullname), + ): + visitor = _DecoratorArgEvaluator() + abi_hints = typing.cast( + _AbiHints, + {n: a.accept(visitor) for n, a in zip(filter(None, arg_names), args, strict=True)}, + ) + name = abi_hints.get("name", func_def.name) + allow_actions = abi_hints.get("allow_actions", ["NoOp"]) + if len(set(allow_actions)) != len(allow_actions): + context.error("Cannot have duplicate allow_actions", dec_loc) + if not allow_actions: + context.error("Must have at least one allow_actions", dec_loc) + invalid_actions = [a for a in allow_actions if a not in ALLOWABLE_OCA] + if invalid_actions: + context.error( + f"Invalid allowed actions: {invalid_actions}", + dec_loc, + ) + create = abi_hints.get("create", False) + readonly = abi_hints.get("readonly", False) + default_args = immutabledict[str, str](abi_hints.get("default_args", {})) + all_args = [ + a.variable.name for a in (func_def.arguments or []) if not a.variable.is_self + ] + for parameter in default_args: + if parameter not in all_args: + context.error( + f"'{parameter}' is not a parameter of {func_def.fullname}", dec_loc + ) + + structs = immutabledict[str, ARC32StructDef]( + { + n: _wtype_to_struct_def(t) + for n, t in get_func_types( + context, func_def, context.node_location(func_def, func_def.info) + ).items() + if isinstance(t, wtypes.ARC4Struct) + } + ) + + return ARC4MethodConfig( + source_location=dec_loc, + name=name, + allowed_completion_types=[ + puya.models.OnCompletionAction[a] for a in allow_actions + ], + allow_create=create == "allow", + require_create=create is True, + readonly=readonly, + is_bare=fullname == constants.BAREMETHOD_DECORATOR, + default_args=default_args, + structs=structs, + ) + case _: + raise InternalError("Unexpected ARC4 decorator", dec_loc) + + +class _AbiHints(typing.TypedDict, total=False): + name: str + allow_actions: list[str] + create: bool | typing.Literal["allow"] + readonly: bool + default_args: dict[str, str] + + +class _DecoratorArgEvaluator(mypy.visitor.NodeVisitor[typing.Any]): + def __getattribute__(self, name: str) -> object: + attr = super().__getattribute__(name) + if name.startswith("visit_") and not attr.__module__.startswith("puya."): + return self._not_supported + return attr + + def _not_supported(self, o: mypy.nodes.Context) -> Never: + raise CodeError(f"Cannot evaluate expression {o}") + + def visit_int_expr(self, o: mypy.nodes.IntExpr) -> int: + return o.value + + def visit_str_expr(self, o: mypy.nodes.StrExpr) -> str: + return o.value + + def visit_bytes_expr(self, o: mypy.nodes.BytesExpr) -> bytes: + return extract_bytes_literal_from_mypy(o) + + def visit_float_expr(self, o: mypy.nodes.FloatExpr) -> float: + return o.value + + def visit_complex_expr(self, o: mypy.nodes.ComplexExpr) -> object: + return o.value + + def visit_ellipsis(self, _: mypy.nodes.EllipsisExpr) -> object: + return Ellipsis + + def visit_name_expr(self, o: mypy.nodes.NameExpr) -> object: + if o.name == "True": + return True + elif o.name == "False": + return False + elif o.name == "None": + return None + else: + return o.name + + def visit_member_expr(self, o: mypy.nodes.MemberExpr) -> object: + return o.name + + def visit_cast_expr(self, o: mypy.nodes.CastExpr) -> object: + return o.expr.accept(self) + + def visit_assert_type_expr(self, o: mypy.nodes.AssertTypeExpr) -> object: + return o.expr.accept(self) + + def visit_unary_expr(self, o: mypy.nodes.UnaryExpr) -> object: + operand: object = o.expr.accept(self) + if o.op == "-": + if isinstance(operand, (int, float, complex)): + return -operand + elif o.op == "+": + if isinstance(operand, (int, float, complex)): + return +operand + elif o.op == "~": + if isinstance(operand, int): + return ~operand + elif o.op == "not" and isinstance(operand, (bool, int, float, str, bytes)): + return not operand + self._not_supported(o) + + def visit_assignment_expr(self, o: mypy.nodes.AssignmentExpr) -> object: + return o.value.accept(self) + + def visit_list_expr(self, o: mypy.nodes.ListExpr) -> list[object]: + return [item.accept(self) for item in o.items] + + def visit_dict_expr(self, o: mypy.nodes.DictExpr) -> dict[object, object]: + return {key.accept(self) if key else None: value.accept(self) for key, value in o.items} + + def visit_tuple_expr(self, o: mypy.nodes.TupleExpr) -> tuple[object, ...]: + return tuple(item.accept(self) for item in o.items) + + def visit_set_expr(self, o: mypy.nodes.SetExpr) -> set[object]: + return {item.accept(self) for item in o.items} + + +def _wtype_to_struct_def(wtype: wtypes.ARC4Struct) -> ARC32StructDef: + return ARC32StructDef( + name=wtype.stub_name.rsplit(".", maxsplit=1)[-1], + elements=[(n, wtype_to_arc4(t)) for n, t in wtype.fields.items()], + ) + + +def arc4_encode( + base: awst_nodes.Expression, target_wtype: wtypes.WType, location: SourceLocation +) -> awst_nodes.Expression: + match base.wtype: + case wtypes.bytes_wtype: + base_temp = awst_nodes.SingleEvaluation(base) + + length = awst_nodes.IntrinsicCall( + source_location=location, + op_code="substring", + immediates=[6, 8], + wtype=wtypes.bytes_wtype, + stack_args=[ + awst_nodes.IntrinsicCall( + source_location=location, + op_code="itob", + stack_args=[awst_nodes.IntrinsicCall.bytes_len(base_temp, location)], + wtype=wtypes.bytes_wtype, + ) + ], + ) + return awst_nodes.ReinterpretCast( + source_location=location, + wtype=wtypes.arc4_dynamic_bytes, + expr=awst_nodes.IntrinsicCall( + source_location=location, + op_code="concat", + stack_args=[length, base_temp], + wtype=wtypes.bytes_wtype, + ), + ) + case wtypes.WTuple(types=types): + base_temp = awst_nodes.SingleEvaluation(base) + + return awst_nodes.ARC4Encode( + source_location=location, + value=awst_nodes.TupleExpression.from_items( + items=[ + arc4_encode( + awst_nodes.TupleItemExpression( + base=base_temp, + index=i, + source_location=location, + ), + wtypes.avm_to_arc4_equivalent_type(t), + location, + ) + for i, t in enumerate(types) + ], + location=location, + ), + wtype=target_wtype, + ) + + case _: + return awst_nodes.ARC4Encode( + source_location=location, + value=base, + wtype=target_wtype, + ) + + +def arc4_decode( + bytes_arg: awst_nodes.Expression, + target_wtype: wtypes.WType, + location: SourceLocation, + *, + decode_nested_items: bool = False, +) -> awst_nodes.Expression: + match bytes_arg.wtype: + case wtypes.ARC4DynamicArray( + element_type=wtypes.ARC4UIntN(n=8) + ) if target_wtype == wtypes.bytes_wtype: + return awst_nodes.IntrinsicCall( + wtype=wtypes.bytes_wtype, + op_code="extract", + immediates=[2, 0], + source_location=location, + stack_args=[ + awst_nodes.ReinterpretCast( + expr=bytes_arg, wtype=wtypes.bytes_wtype, source_location=location + ) + ], + ) + case wtypes.ARC4Tuple(types=tuple_types): + decode_expression = awst_nodes.ARC4Decode( + source_location=location, + wtype=wtypes.WTuple.from_types(tuple_types), + value=bytes_arg, + ) + if not decode_nested_items: + return decode_expression + decoded = awst_nodes.SingleEvaluation(decode_expression) + return awst_nodes.TupleExpression.from_items( + items=[ + arc4_decode( + awst_nodes.TupleItemExpression( + base=decoded, + index=i, + source_location=location, + ), + wtypes.arc4_to_avm_equivalent_wtype(t), + location, + ) + for i, t in enumerate(tuple_types) + ], + location=location, + ) + + case _: + return awst_nodes.ARC4Decode( + source_location=location, + wtype=target_wtype, + value=bytes_arg, + ) + + +def get_func_types( + context: ASTConversionModuleContext, func_def: mypy.nodes.FuncDef, location: SourceLocation +) -> dict[str, wtypes.WType]: + if not (func_def.arguments and func_def.arguments[0].variable.is_self): + raise InternalError( + "arc4_utils.get_func_types called with non class method," + " which means it can't be an ABI method", + location, + ) + func_type = func_def.type + if not isinstance(func_type, mypy.types.CallableType): + raise InternalError(f"Unexpected FuncDef type: {type(func_def.type).__name__}", location) + if "output" in (arg.variable.name for arg in func_def.arguments): + # https://github.com/algorandfoundation/ARCs/blob/main/assets/arc-0032/application.schema.json + raise CodeError( + "For compatibility with ARC-32, ARC-4 methods cannot have an argument named output", + location, + ) + return { + **{ + arg.variable.name: context.type_to_wtype( + t, source_location=context.node_location(arg, module_src=func_def.info) + ) + for t, arg in zip(func_type.arg_types, func_def.arguments, strict=True) + if not arg.variable.is_self + }, + "output": context.type_to_wtype(func_type.ret_type, source_location=location), + } diff --git a/src/puya/awst_build/constants.py b/src/puya/awst_build/constants.py index 0c3a4c7d98..f107e9e82b 100644 --- a/src/puya/awst_build/constants.py +++ b/src/puya/awst_build/constants.py @@ -57,8 +57,11 @@ CLS_ARC4_BIG_UFIXEDNXM = "puyapy.arc4.BigUFixedNxM" CLS_ARC4_DYNAMIC_ARRAY = "puyapy.arc4.DynamicArray" CLS_ARC4_STATIC_ARRAY = "puyapy.arc4.StaticArray" +CLS_ARC4_DYNAMIC_BYTES = "puyapy.arc4.DynamicBytes" CLS_ARC4_TUPLE = "puyapy.arc4.Tuple" CLS_ARC4_STRUCT = "puyapy.arc4.Struct" +CLS_ARC4_ABI_CALL = "puyapy.arc4.abi_call" +CLS_ARC4_CLIENT = "puyapy.arc4.ARC4Client" CLS_TEMPLATE_VAR_METHOD = f"{PUYAPY_PREFIX}_template_variables.TemplateVar" CONTRACT_STUB_TYPES = [ diff --git a/src/puya/awst_build/context.py b/src/puya/awst_build/context.py index 76b1fe501f..5e398e495e 100644 --- a/src/puya/awst_build/context.py +++ b/src/puya/awst_build/context.py @@ -45,12 +45,24 @@ def module_name(self) -> str: def module_path(self) -> str: return self.current_module.path - def node_location(self, node: mypy.nodes.Context) -> SourceLocation: - loc = SourceLocation.from_mypy(file=self.module_path, node=node) + def node_location( + self, + node: mypy.nodes.Context, + module_src: mypy.nodes.TypeInfo | None = None, + ) -> SourceLocation: + if not module_src: + module_path = self.module_path + else: + module_name = module_src.module_name + try: + module_path = self.module_paths[module_name] + except KeyError as ex: + raise CodeError(f"Could not find module '{module_name}'") from ex + loc = SourceLocation.from_mypy(file=module_path, node=node) lines = self.try_get_source(loc).code if loc.line > 1: prior_code = self.try_get_source( - SourceLocation(file=self.module_path, line=1, end_line=loc.line - 1) + SourceLocation(file=module_path, line=1, end_line=loc.line - 1) ).code unchop = 0 for line in reversed(prior_code or ()): diff --git a/src/puya/awst_build/contract.py b/src/puya/awst_build/contract.py index 62325e01ab..f52065e836 100644 --- a/src/puya/awst_build/contract.py +++ b/src/puya/awst_build/contract.py @@ -1,14 +1,9 @@ -import typing from collections.abc import Iterator, Mapping -from typing import Never import mypy.nodes import mypy.types import mypy.visitor -from immutabledict import immutabledict -import puya.models -from puya.arc4_util import wtype_to_arc4 from puya.awst import wtypes from puya.awst.nodes import ( AppStateDefinition, @@ -19,6 +14,7 @@ ContractReference, ) from puya.awst_build import constants +from puya.awst_build.arc4_utils import get_arc4_method_config, get_func_types from puya.awst_build.base_mypy_visitor import BaseMyPyStatementVisitor from puya.awst_build.context import ASTConversionModuleContext from puya.awst_build.contract_data import ( @@ -28,14 +24,13 @@ ) from puya.awst_build.subroutine import ContractMethodInfo, FunctionASTConverter from puya.awst_build.utils import ( - extract_bytes_literal_from_mypy, extract_docstring, get_decorators_by_fullname, iterate_user_bases, qualified_class_name, ) from puya.errors import CodeError, InternalError -from puya.models import ARC4MethodConfig, ARC32StructDef, OnCompletionAction +from puya.models import ARC4MethodConfig, OnCompletionAction from puya.parse import SourceLocation ALLOWABLE_OCA = frozenset( @@ -222,12 +217,10 @@ def visit_function( self._error( f"cannot be both a subroutine and {arc4_decorator_name}", subroutine_dec ) - *arg_wtypes, ret_wtype = _get_func_types( + *arg_wtypes, ret_wtype = get_func_types( self.context, func_def, location=self._location(func_def) ).values() - arc4_method_config = _get_arc4_method_config( - self.context, arc4_decorator, func_def - ) + arc4_method_config = get_arc4_method_config(self.context, arc4_decorator, func_def) if arc4_method_config.is_bare: if arg_wtypes or (ret_wtype is not wtypes.void_wtype): self._error( @@ -437,198 +430,6 @@ def _gather_app_state( ) -def _get_func_types( - context: ASTConversionModuleContext, func_def: mypy.nodes.FuncDef, location: SourceLocation -) -> dict[str, wtypes.WType]: - start_idx = 0 - if func_def.arguments: - first_arg_var = func_def.arguments[0].variable - if first_arg_var.is_self or first_arg_var.is_cls: - start_idx = 1 - in_var_names = [arg.variable.name for arg in func_def.arguments[start_idx:]] - if "output" in in_var_names: - # https://github.com/algorandfoundation/ARCs/blob/main/assets/arc-0032/application.schema.json - raise CodeError( - "For compatibility with ARC-32, ARC-4 methods cannot have an argument named output", - location, - ) - names = [*in_var_names, "output"] - match func_def.type: - case mypy.types.CallableType(arg_types=arg_types, ret_type=ret_type): - types = arg_types[start_idx:] + [ret_type] - wtypes_ = (context.type_to_wtype(t, source_location=location) for t in types) - return dict(zip(names, wtypes_, strict=True)) - raise InternalError("Unexpected FuncDef type") - - -def _get_arc4_method_config( - context: ASTConversionModuleContext, - decorator: mypy.nodes.Expression, - func_def: mypy.nodes.FuncDef, -) -> ARC4MethodConfig: - dec_loc = context.node_location(decorator) - match decorator: - case mypy.nodes.RefExpr(fullname=fullname): - return ARC4MethodConfig( - name=func_def.name, - source_location=dec_loc, - is_bare=fullname == constants.BAREMETHOD_DECORATOR, - ) - case mypy.nodes.CallExpr( - args=args, - arg_names=arg_names, - callee=mypy.nodes.RefExpr(fullname=fullname), - ): - visitor = _DecoratorArgEvaluator() - abi_hints = typing.cast( - _AbiHints, - {n: a.accept(visitor) for n, a in zip(filter(None, arg_names), args, strict=True)}, - ) - name = abi_hints.get("name", func_def.name) - allow_actions = abi_hints.get("allow_actions", ["NoOp"]) - if len(set(allow_actions)) != len(allow_actions): - context.error("Cannot have duplicate allow_actions", dec_loc) - if not allow_actions: - context.error("Must have at least one allow_actions", dec_loc) - invalid_actions = [a for a in allow_actions if a not in ALLOWABLE_OCA] - if invalid_actions: - context.error( - f"Invalid allowed actions: {invalid_actions}", - dec_loc, - ) - create = abi_hints.get("create", False) - readonly = abi_hints.get("readonly", False) - default_args = immutabledict[str, str](abi_hints.get("default_args", {})) - all_args = [ - a.variable.name for a in (func_def.arguments or []) if not a.variable.is_self - ] - for parameter in default_args: - if parameter not in all_args: - context.error( - f"'{parameter}' is not a parameter of {func_def.fullname}", dec_loc - ) - # TODO: validate source here as well? - # Deferring it allows for more flexibility in contract composition - - structs = immutabledict[str, ARC32StructDef]( - { - n: _wtype_to_struct_def(t) - for n, t in _get_func_types( - context, func_def, context.node_location(func_def) - ).items() - if isinstance(t, wtypes.ARC4Struct) - } - ) - - return ARC4MethodConfig( - source_location=dec_loc, - name=name, - allowed_completion_types=[ - puya.models.OnCompletionAction[a] for a in allow_actions - ], - allow_create=create == "allow", - require_create=create is True, - readonly=readonly, - is_bare=fullname == constants.BAREMETHOD_DECORATOR, - default_args=default_args, - structs=structs, - ) - case _: - raise InternalError("Unexpected ARC4 decorator", dec_loc) - - -class _AbiHints(typing.TypedDict, total=False): - name: str - allow_actions: list[str] - create: bool | typing.Literal["allow"] - readonly: bool - default_args: dict[str, str] - - -class _DecoratorArgEvaluator(mypy.visitor.NodeVisitor[typing.Any]): - def __getattribute__(self, name: str) -> object: - attr = super().__getattribute__(name) - if name.startswith("visit_") and not attr.__module__.startswith("puya."): - return self._not_supported - return attr - - def _not_supported(self, o: mypy.nodes.Context) -> Never: - raise CodeError(f"Cannot evaluate expression {o}") - - def visit_int_expr(self, o: mypy.nodes.IntExpr) -> int: - return o.value - - def visit_str_expr(self, o: mypy.nodes.StrExpr) -> str: - return o.value - - def visit_bytes_expr(self, o: mypy.nodes.BytesExpr) -> bytes: - return extract_bytes_literal_from_mypy(o) - - def visit_float_expr(self, o: mypy.nodes.FloatExpr) -> float: - return o.value - - def visit_complex_expr(self, o: mypy.nodes.ComplexExpr) -> object: - return o.value - - def visit_ellipsis(self, _: mypy.nodes.EllipsisExpr) -> object: - return Ellipsis - - def visit_name_expr(self, o: mypy.nodes.NameExpr) -> object: - if o.name == "True": - return True - elif o.name == "False": - return False - elif o.name == "None": - return None - else: - return o.name - - def visit_member_expr(self, o: mypy.nodes.MemberExpr) -> object: - return o.name - - def visit_cast_expr(self, o: mypy.nodes.CastExpr) -> object: - return o.expr.accept(self) - - def visit_assert_type_expr(self, o: mypy.nodes.AssertTypeExpr) -> object: - return o.expr.accept(self) - - def visit_unary_expr(self, o: mypy.nodes.UnaryExpr) -> object: - operand: object = o.expr.accept(self) - if o.op == "-": - if isinstance(operand, (int, float, complex)): - return -operand - elif o.op == "+": - if isinstance(operand, (int, float, complex)): - return +operand - elif o.op == "~": - if isinstance(operand, int): - return ~operand - elif o.op == "not" and isinstance(operand, (bool, int, float, str, bytes)): - return not operand - self._not_supported(o) - - def visit_assignment_expr(self, o: mypy.nodes.AssignmentExpr) -> object: - return o.value.accept(self) - - def visit_list_expr(self, o: mypy.nodes.ListExpr) -> list[object]: - return [item.accept(self) for item in o.items] - - def visit_dict_expr(self, o: mypy.nodes.DictExpr) -> dict[object, object]: - return {key.accept(self) if key else None: value.accept(self) for key, value in o.items} - - def visit_tuple_expr(self, o: mypy.nodes.TupleExpr) -> tuple[object, ...]: - return tuple(item.accept(self) for item in o.items) - - def visit_set_expr(self, o: mypy.nodes.SetExpr) -> set[object]: - return {item.accept(self) for item in o.items} - - -def _wtype_to_struct_def(wtype: wtypes.ARC4Struct) -> ARC32StructDef: - return ARC32StructDef( - name=wtype.name, elements=[(n, wtype_to_arc4(t)) for n, t in wtype.fields.items()] - ) - - def _gather_bases( context: ASTConversionModuleContext, class_def: mypy.nodes.ClassDef ) -> list[ContractReference]: diff --git a/src/puya/awst_build/eb/arc4/__init__.py b/src/puya/awst_build/eb/arc4/__init__.py index efe5f995c9..33d33e99ff 100644 --- a/src/puya/awst_build/eb/arc4/__init__.py +++ b/src/puya/awst_build/eb/arc4/__init__.py @@ -1,6 +1,8 @@ # ruff: noqa: F403 +from puya.awst_build.eb.arc4.abi_call import * from puya.awst_build.eb.arc4.arrays import * from puya.awst_build.eb.arc4.bool import * +from puya.awst_build.eb.arc4.dynamic_bytes import * from puya.awst_build.eb.arc4.numeric import * from puya.awst_build.eb.arc4.string import * from puya.awst_build.eb.arc4.struct import * diff --git a/src/puya/awst_build/eb/arc4/_utils.py b/src/puya/awst_build/eb/arc4/_utils.py new file mode 100644 index 0000000000..29096d3353 --- /dev/null +++ b/src/puya/awst_build/eb/arc4/_utils.py @@ -0,0 +1,119 @@ +from __future__ import annotations + +import decimal +import typing +from typing import TYPE_CHECKING + +import structlog + +from puya.awst import ( + nodes as awst_nodes, + wtypes, +) +from puya.awst.nodes import DecimalConstant +from puya.awst_build.eb.base import ExpressionBuilder +from puya.awst_build.utils import convert_literal +from puya.errors import CodeError + +if TYPE_CHECKING: + from puya.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +def convert_arc4_literal( + literal: awst_nodes.Literal, + target_wtype: wtypes.ARC4Type, + loc: SourceLocation | None = None, +) -> awst_nodes.Expression: + literal_value: typing.Any = literal.value + loc = loc or literal.source_location + match target_wtype: + case wtypes.ARC4UIntN(): + return awst_nodes.IntegerConstant( + value=literal_value, wtype=target_wtype, source_location=loc + ) + case wtypes.ARC4UFixedNxM() as fixed_wtype: + with decimal.localcontext( + decimal.Context( + prec=160, + traps=[ + decimal.Rounded, + decimal.InvalidOperation, + decimal.Overflow, + decimal.DivisionByZero, + ], + ) + ): + try: + d = decimal.Decimal(literal_value) + except ArithmeticError as ex: + raise CodeError(f"Invalid decimal literal: {literal_value}", loc) from ex + if d < 0: + raise CodeError("Negative numbers not allowed", loc) + try: + q = d.quantize(decimal.Decimal(f"1e-{fixed_wtype.m}")) + except ArithmeticError as ex: + raise CodeError( + f"Too many decimals, expected max of {fixed_wtype.m}", loc + ) from ex + return DecimalConstant( + source_location=loc, + value=q, + wtype=fixed_wtype, + ) + case wtypes.arc4_dynamic_bytes: + return awst_nodes.ARC4Encode( + value=awst_nodes.BytesConstant( + value=literal_value, + source_location=loc, + encoding=awst_nodes.BytesEncoding.unknown, + ), + source_location=loc, + wtype=target_wtype, + ) + case wtypes.arc4_string_wtype: + if isinstance(literal_value, str): + try: + literal_bytes = literal_value.encode("utf8") + except ValueError: + pass + else: + return awst_nodes.ARC4Encode( + value=awst_nodes.BytesConstant( + value=literal_bytes, + source_location=loc, + encoding=awst_nodes.BytesEncoding.utf8, + ), + source_location=loc, + wtype=target_wtype, + ) + case wtypes.arc4_bool_wtype: + return awst_nodes.ARC4Encode( + value=awst_nodes.BoolConstant( + value=literal_value, + source_location=loc, + ), + source_location=loc, + wtype=target_wtype, + ) + raise CodeError(f"Can't construct {target_wtype} from Python literal {literal_value}", loc) + + +def expect_arc4_operand_wtype( + literal_or_expr: awst_nodes.Literal | awst_nodes.Expression | ExpressionBuilder, + target_wtype: wtypes.WType, +) -> awst_nodes.Expression: + if isinstance(literal_or_expr, awst_nodes.Literal): + if isinstance(target_wtype, wtypes.ARC4Type): + return convert_arc4_literal(literal_or_expr, target_wtype) + return convert_literal(literal_or_expr, target_wtype) + if isinstance(literal_or_expr, ExpressionBuilder): + literal_or_expr = literal_or_expr.rvalue() + + if literal_or_expr.wtype != target_wtype: + raise CodeError( + f"Expected type {target_wtype}, got type {literal_or_expr.wtype}", + literal_or_expr.source_location, + ) + return literal_or_expr diff --git a/src/puya/awst_build/eb/arc4/abi_call.py b/src/puya/awst_build/eb/arc4/abi_call.py new file mode 100644 index 0000000000..3e59f88ac4 --- /dev/null +++ b/src/puya/awst_build/eb/arc4/abi_call.py @@ -0,0 +1,418 @@ +from __future__ import annotations + +import operator +from functools import reduce +from typing import TYPE_CHECKING + +import attrs +import mypy.nodes +import mypy.types +import structlog + +from puya.arc4_util import get_abi_signature_from_wtypes, parse_method_signature +from puya.awst import wtypes +from puya.awst.nodes import ( + ARC4Encode, + BytesConstant, + BytesEncoding, + CreateInnerTransaction, + Expression, + InnerTransactionField, + Literal, + MethodConstant, + SingleEvaluation, + SubmitInnerTransaction, + TupleExpression, + TxnField, + TxnFields, + UInt64Constant, +) +from puya.awst_build import constants +from puya.awst_build.arc4_utils import arc4_encode, get_arc4_method_config, get_func_types +from puya.awst_build.eb.arc4._utils import expect_arc4_operand_wtype +from puya.awst_build.eb.arc4.base import ARC4FromLogBuilder +from puya.awst_build.eb.base import ( + ExpressionBuilder, + GenericClassExpressionBuilder, + IntermediateExpressionBuilder, + TypeClassExpressionBuilder, +) +from puya.awst_build.eb.transaction.inner_params import get_field_expr +from puya.awst_build.eb.var_factory import var_expression +from puya.awst_build.utils import ( + get_decorators_by_fullname, +) +from puya.errors import CodeError, InternalError + +if TYPE_CHECKING: + from collections.abc import Sequence + + from puya.awst_build.context import ASTConversionModuleContext + from puya.models import ARC4MethodConfig + from puya.parse import SourceLocation + + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) +_APP_TRANSACTION_FIELDS = ( + TxnFields.app_id, + TxnFields.on_completion, + TxnFields.approval_program, + TxnFields.clear_state_program, + TxnFields.global_num_uint, + TxnFields.global_num_bytes, + TxnFields.local_num_uint, + TxnFields.local_num_bytes, + TxnFields.extra_program_pages, + TxnFields.fee, + TxnFields.sender, + TxnFields.note, + TxnFields.rekey_to, +) + + +@attrs.frozen +class _ABICallExpr: + method: ExpressionBuilder | Literal + abi_args: Sequence[ExpressionBuilder | Literal] + transaction_kwargs: dict[str, ExpressionBuilder | Literal] + + +class ABICallGenericClassExpressionBuilder(GenericClassExpressionBuilder): + def call( + self, + args: Sequence[ExpressionBuilder | Literal], + arg_kinds: list[mypy.nodes.ArgKind], + arg_names: list[str | None], + location: SourceLocation, + original_expr: mypy.nodes.CallExpr, + ) -> ExpressionBuilder: + abi_call_expr = _extract_abi_call_args(args, arg_kinds, arg_names, location) + method = abi_call_expr.method + match method: + case Literal(value=str(method_sig)): + method_name, maybe_args, maybe_return_type = parse_method_signature(method_sig) + arg_types = ( + list(map(_arg_to_wtype, abi_call_expr.abi_args)) + if maybe_args is None + else maybe_args + ) + return_type = maybe_return_type or wtypes.void_wtype + case ARC4MethodConfigExpressionBuilder() as eb: + method_name = eb.method_config.name + arg_types = eb.arg_types + return_type = eb.return_type + case _: + raise CodeError( + "First argument must be a reference to an ARC4 ABI method", location + ) + + return var_expression( + _create_abi_call_expr( + get_abi_signature_from_wtypes(method_name, arg_types, return_type), + arg_types, + return_type, + abi_call_expr.abi_args, + abi_call_expr.transaction_kwargs, + location, + ) + ) + + def index_multiple( + self, indexes: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> TypeClassExpressionBuilder: + try: + (index,) = indexes + except ValueError as ex: + raise CodeError("Expected a single type arg", location) from ex + match index: + case TypeClassExpressionBuilder() as type_class: + wtype = type_class.produces() + case _: + raise CodeError("Invalid type parameter", index.source_location) + return ABICallClassExpressionBuilder(wtype, location) + + +class ARC4ClientClassExpressionBuilder(IntermediateExpressionBuilder): + def __init__( + self, + context: ASTConversionModuleContext, + source_location: SourceLocation, + type_info: mypy.nodes.TypeInfo, + ): + super().__init__(source_location) + self.context = context + self.type_info = type_info + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + dec = self.type_info.get_method(name) + if isinstance(dec, mypy.nodes.Decorator): + decorators = get_decorators_by_fullname(self.context, dec) + abimethod_dec = decorators.get(constants.ABIMETHOD_DECORATOR) + if abimethod_dec is not None: + func_def = dec.func + arc4_method_config = get_arc4_method_config(self.context, abimethod_dec, func_def) + *arg_types, return_type = get_func_types(self.context, func_def, location).values() + return ARC4MethodConfigExpressionBuilder( + arc4_method_config, arg_types, return_type, location + ) + raise CodeError(f"'{self.type_info.fullname}.{name}' is not a valid ARC4 method", location) + + +class ARC4MethodConfigExpressionBuilder(IntermediateExpressionBuilder): + def __init__( + self, + method_config: ARC4MethodConfig, + arg_types: list[wtypes.WType], + return_type: wtypes.WType, + location: SourceLocation, + ): + super().__init__(location) + self.method_config = method_config + self.arg_types = arg_types + self.return_type = return_type + + +class ABICallClassExpressionBuilder(TypeClassExpressionBuilder): + def __init__(self, wtype: wtypes.WType, source_location: SourceLocation) -> None: + super().__init__(source_location) + self.wtype = wtype + + def produces(self) -> wtypes.WType: + if self.wtype is None: + raise CodeError("ABICall must have a type parameter", self.source_location) + return self.wtype + + def call( + self, + args: Sequence[ExpressionBuilder | Literal], + arg_kinds: list[mypy.nodes.ArgKind], + arg_names: list[str | None], + location: SourceLocation, + original_expr: mypy.nodes.CallExpr, + ) -> ExpressionBuilder: + abi_call_expr = _extract_abi_call_args(args, arg_kinds, arg_names, location) + method = abi_call_expr.method + + match method: + case Literal(value=str(method_str)): + method_name, method_args, method_return = parse_method_signature(method_str) + case _: + raise CodeError( + "First argument must be a `str` value of an ARC4 method name/selector", + location, + ) + + if method_args: + arg_wtypes = [ + _arg_to_wtype(arg, arg_wtype) + for arg, arg_wtype in zip(abi_call_expr.abi_args, method_args, strict=True) + ] + else: + arg_wtypes = list(map(_arg_to_wtype, abi_call_expr.abi_args)) + + calculated_signature = get_abi_signature_from_wtypes(method_name, arg_wtypes, self.wtype) + if not calculated_signature.startswith(method_str): + raise CodeError( + f"Method selector from args '{calculated_signature}' " + f"does not match provided method selector: '{method_str}'", + method.source_location, + ) + + return var_expression( + _create_abi_call_expr( + calculated_signature, + arg_wtypes, + self.wtype, + abi_call_expr.abi_args, + abi_call_expr.transaction_kwargs, + location, + ) + ) + + +def _arg_to_wtype( + arg: ExpressionBuilder | Literal, wtype: wtypes.WType | None = None +) -> wtypes.WType: + # if wtype is known, then ensure arg can be coerced to that type + if wtype: + return expect_arc4_operand_wtype(arg, wtype).wtype + # otherwise infer arg from literal type + match arg: + case ExpressionBuilder(value_type=wtypes.WType() as expr_wtype): + return expr_wtype + case Literal(value=bytes()): + return wtypes.bytes_wtype + case Literal(value=int()): + return wtypes.uint64_wtype + case Literal(value=str()): + return wtypes.arc4_string_wtype + case Literal(value=bool()): + return wtypes.bool_wtype + raise CodeError("Invalid arg type", arg.source_location) + + +def _create_abi_call_expr( + method_selector: str, + abi_arg_types: Sequence[wtypes.WType], + abi_return_type: wtypes.WType, + abi_args: Sequence[ExpressionBuilder | Literal], + transaction_kwargs: dict[str, ExpressionBuilder | Literal], + location: SourceLocation, +) -> Expression: + abi_arg_exprs: list[Expression] = [ + MethodConstant( + value=method_selector, + source_location=location, + ) + ] + asset_exprs = list[Expression]() + account_exprs = list[Expression]() + application_exprs = list[Expression]() + + def append_ref_arg(ref_list: list[Expression], arg_expr: Expression) -> None: + # asset refs start at 0, account and application start at 1 + implicit_offset = 0 if ref_list is asset_exprs else 1 + # TODO: what about references that are used more than once? + ref_index = len(ref_list) + ref_list.append(arg_expr) + abi_arg_exprs.append( + BytesConstant( + value=(ref_index + implicit_offset).to_bytes(length=1), + encoding=BytesEncoding.base16, + source_location=arg_expr.source_location, + ) + ) + + for arg, wtype in zip(abi_args, abi_arg_types, strict=True): + arg_expr = expect_arc4_operand_wtype(arg, wtype) + match wtype: + case wtypes.ARC4Type(): + abi_arg_exprs.append(arg_expr) + case wtypes.asset_wtype: + append_ref_arg(asset_exprs, arg_expr) + case wtypes.account_wtype: + append_ref_arg(account_exprs, arg_expr) + case wtypes.application_wtype: + append_ref_arg(application_exprs, arg_expr) + case _ if wtypes.has_arc4_equivalent_type(wtype): + arc4_wtype = wtypes.avm_to_arc4_equivalent_type(wtype) + abi_arg_exprs.append(arc4_encode(arg_expr, arc4_wtype, arg_expr.source_location)) + case wtypes.WGroupTransaction(): + raise CodeError( + "Transaction arguments are not supported for contract to contract calls", + arg_expr.source_location, + ) + case _: + raise CodeError("Invalid argument type", arg_expr.source_location) + + fields: dict[TxnField, Expression] = { + TxnFields.type: UInt64Constant( + value=constants.TransactionType.appl.value, + teal_alias=constants.TransactionType.appl.name, + source_location=location, + ) + } + if len(abi_arg_exprs) > 15: + packed_arg_slice = slice(15, None) + args_to_pack = abi_arg_exprs[packed_arg_slice] + args_tuple = TupleExpression.from_items(args_to_pack, _combine_locs(args_to_pack)) + abi_arg_exprs[packed_arg_slice] = [ + ARC4Encode( + value=args_tuple, + wtype=wtypes.ARC4Tuple.from_types(args_tuple.wtype.types), + source_location=args_tuple.source_location, + ) + ] + + _add_array_exprs(fields, TxnFields.app_args, abi_arg_exprs) + _add_array_exprs(fields, TxnFields.accounts, account_exprs) + _add_array_exprs(fields, TxnFields.apps, application_exprs) + _add_array_exprs(fields, TxnFields.assets, asset_exprs) + for field in _APP_TRANSACTION_FIELDS: + try: + value = transaction_kwargs.pop(field.python_name) + except KeyError: + continue + field, field_expr = get_field_expr(field.python_name, value) + fields[field] = field_expr + + if transaction_kwargs: + bad_args = "', '".join(transaction_kwargs) + raise CodeError(f"Unknown arguments: '{bad_args}'", location) + + create_itxn = CreateInnerTransaction( + fields=fields, + wtype=wtypes.WInnerTransactionFields.from_type(constants.TransactionType.appl), + source_location=location, + ) + itxn = SubmitInnerTransaction( + itxns=(create_itxn,), + source_location=location, + wtype=wtypes.WInnerTransaction.from_type(constants.TransactionType.appl), + ) + + if abi_return_type == wtypes.void_wtype: + return itxn + itxn_tmp = SingleEvaluation(itxn) + last_log = InnerTransactionField( + source_location=location, + itxn=itxn_tmp, + field=TxnFields.last_log, + wtype=TxnFields.last_log.wtype, + ) + return TupleExpression( + items=( + ARC4FromLogBuilder.abi_expr_from_log(abi_return_type, last_log, location), + itxn_tmp, + ), + wtype=wtypes.WTuple.from_types( + ( + abi_return_type, + wtypes.WInnerTransaction.from_type(constants.TransactionType.appl), + ) + ), + source_location=location, + ) + + +def _add_array_exprs( + fields: dict[TxnField, Expression], field: TxnField, exprs: list[Expression] +) -> None: + if exprs: + fields[field] = TupleExpression( + items=exprs, + wtype=wtypes.WTuple.from_types([field.wtype] * len(exprs)), + source_location=_combine_locs(exprs), + ) + + +def _combine_locs(exprs: Sequence[Expression]) -> SourceLocation: + return reduce(operator.add, (a.source_location for a in exprs)) + + +def _extract_abi_call_args( + args: Sequence[ExpressionBuilder | Literal], + arg_kinds: list[mypy.nodes.ArgKind], + arg_names: list[str | None], + location: SourceLocation, +) -> _ABICallExpr: + method: ExpressionBuilder | Literal | None = None + abi_args = list[ExpressionBuilder | Literal]() + kwargs = dict[str, ExpressionBuilder | Literal]() + for i in range(len(args)): + arg_kind = arg_kinds[i] + arg_name = arg_names[i] + arg = args[i] + if arg_kind == mypy.nodes.ArgKind.ARG_POS and i == 0: + method = arg + elif arg_kind == mypy.nodes.ArgKind.ARG_POS: + abi_args.append(arg) + elif arg_kind == mypy.nodes.ArgKind.ARG_NAMED: + if arg_name is None: + raise InternalError(f"Expected named argument at pos {i}", location) + kwargs[arg_name] = arg + else: + raise CodeError(f"Unexpected argument kind for '{arg_name}'", location) + if method is None: + raise CodeError("Missing required method positional argument", location) + return _ABICallExpr(method=method, abi_args=abi_args, transaction_kwargs=kwargs) diff --git a/src/puya/awst_build/eb/arc4/arrays.py b/src/puya/awst_build/eb/arc4/arrays.py index 3de64a3bc1..4213c30378 100644 --- a/src/puya/awst_build/eb/arc4/arrays.py +++ b/src/puya/awst_build/eb/arc4/arrays.py @@ -31,6 +31,7 @@ UInt64Constant, ) from puya.awst_build.eb._utils import bool_eval_to_constant +from puya.awst_build.eb.arc4._utils import expect_arc4_operand_wtype from puya.awst_build.eb.arc4.base import ( CopyBuilder, arc4_bool_bytes, @@ -104,7 +105,7 @@ def dynamic_array_constructor( element_wtype = non_literal_args[0].wtype wtype = wtypes.ARC4DynamicArray.from_element_type(element_wtype) else: - raise CodeError("Empy arrays require a type annotation to be instantiated", location) + raise CodeError("Empty arrays require a type annotation to be instantiated", location) for a in non_literal_args: expect_operand_wtype(a, wtype.element_type) @@ -238,11 +239,7 @@ def produces(self) -> wtypes.WType: class AddressClassExpressionBuilder(StaticArrayClassExpressionBuilder): def __init__(self, location: SourceLocation): super().__init__(location=location) - element_wtype = wtypes.ARC4UIntN.from_scale(8, alias="byte") - array_size = 32 - self.wtype = wtypes.ARC4StaticArray.from_element_type_and_size( - element_wtype, array_size=array_size, alias="address" - ) + self.wtype = wtypes.arc4_address_type def call( self, @@ -450,7 +447,7 @@ def call( location: SourceLocation, original_expr: mypy.nodes.CallExpr, ) -> ExpressionBuilder: - args_expr = [expect_operand_wtype(a, self.wtype.element_type) for a in args] + args_expr = [expect_arc4_operand_wtype(a, self.wtype.element_type) for a in args] args_tuple = TupleExpression.from_items(args_expr, location) return var_expression( ArrayExtend( diff --git a/src/puya/awst_build/eb/arc4/base.py b/src/puya/awst_build/eb/arc4/base.py index 690f025a2e..bad93b0dad 100644 --- a/src/puya/awst_build/eb/arc4/base.py +++ b/src/puya/awst_build/eb/arc4/base.py @@ -19,6 +19,8 @@ IntrinsicCall, Literal, ReinterpretCast, + SingleEvaluation, + TupleExpression, ) from puya.awst_build.eb.base import ( BuilderComparisonOp, @@ -104,6 +106,49 @@ def __init__(self, location: SourceLocation, wtype: wtypes.WType): super().__init__(location=location) self.wtype = wtype + @classmethod + def abi_expr_from_log( + cls, wtype: wtypes.WType, value: Expression, location: SourceLocation + ) -> Expression: + tmp_value = SingleEvaluation(value) + arc4_value = IntrinsicCall( + wtype=wtypes.bytes_wtype, + op_code="extract", + immediates=[4, 0], + source_location=location, + stack_args=[tmp_value], + ) + arc4_prefix = IntrinsicCall( + wtype=wtypes.bytes_wtype, + op_code="extract", + immediates=[0, 4], + source_location=location, + stack_args=[tmp_value], + ) + arc4_prefix_is_valid = BytesComparisonExpression( + lhs=arc4_prefix, + rhs=BytesConstant( + value=b"\x15\x1f\x7c\x75", + source_location=location, + encoding=BytesEncoding.base16, + ), + operator=EqualityComparison.eq, + source_location=location, + ) + checked_arc4_value = CheckedMaybe( + expr=TupleExpression( + items=(arc4_value, arc4_prefix_is_valid), + wtype=wtypes.WTuple.from_types((arc4_value.wtype, wtypes.bool_wtype)), + source_location=location, + ), + comment="ARC4 prefix is valid", + ) + return ReinterpretCast( + source_location=location, + expr=checked_arc4_value, + wtype=wtype, + ) + def call( self, args: Sequence[ExpressionBuilder | Literal], @@ -114,49 +159,9 @@ def call( ) -> ExpressionBuilder: match args: case [ExpressionBuilder() as eb]: - value = eb.rvalue() - if value.wtype == wtypes.bytes_wtype: - value_bytes = ReinterpretCast( - expr=value, wtype=wtypes.bytes_wtype, source_location=value.source_location - ) - arc4_prefix = IntrinsicCall( - wtype=wtypes.bytes_wtype, - op_code="extract", - immediates=[0, 4], - source_location=location, - stack_args=[value_bytes], - ) - arc4_prefix_is_valid = BytesComparisonExpression( - lhs=arc4_prefix, - rhs=BytesConstant( - value=b"\x15\x1f\x7c\x75", - source_location=location, - encoding=BytesEncoding.base16, - ), - operator=EqualityComparison.eq, - source_location=location, - ) - arc4_value = IntrinsicCall( - wtype=wtypes.bytes_wtype, - op_code="extract", - immediates=[4, 0], - source_location=location, - stack_args=[value_bytes], - ) - checked_arc4_value = CheckedMaybe.from_tuple_items( - expr=arc4_value, - check=arc4_prefix_is_valid, - source_location=location, - comment="ARC4 prefix is valid", - ) - return var_expression( - ReinterpretCast( - source_location=location, - expr=checked_arc4_value, - wtype=self.wtype, - ) - ) - raise CodeError("Invalid/unhandled arguments", location) + return var_expression(self.abi_expr_from_log(self.wtype, eb.rvalue(), location)) + case _: + raise CodeError("Invalid/unhandled arguments", location) class CopyBuilder(IntermediateExpressionBuilder): @@ -184,18 +189,12 @@ class ARC4DecodeBuilder(IntermediateExpressionBuilder): def __init__(self, expr: Expression, location: SourceLocation): super().__init__(location=location) match expr.wtype: - case wtypes.arc4_string_wtype: - pass - case wtypes.ARC4UIntN(): - pass - case wtypes.ARC4UFixedNxM(): - pass - case wtypes.arc4_bool_wtype: + case wtypes.arc4_string_wtype | wtypes.arc4_dynamic_bytes | wtypes.arc4_bool_wtype: pass - case wtypes.ARC4Tuple(): + case wtypes.ARC4UIntN() | wtypes.ARC4UFixedNxM() | wtypes.ARC4Tuple(): pass case _: - raise InternalError("Unsupported wtype") + raise InternalError("Unsupported wtype for ARC4Decode", location) self.expr = expr def call( diff --git a/src/puya/awst_build/eb/arc4/dynamic_bytes.py b/src/puya/awst_build/eb/arc4/dynamic_bytes.py new file mode 100644 index 0000000000..de157fe5f7 --- /dev/null +++ b/src/puya/awst_build/eb/arc4/dynamic_bytes.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +import typing +from typing import Sequence + +from puya.awst import wtypes +from puya.awst.nodes import ARC4Encode, Literal, ReinterpretCast +from puya.awst_build.eb.arc4._utils import convert_arc4_literal +from puya.awst_build.eb.arc4.arrays import DynamicArrayExpressionBuilder, dynamic_array_constructor +from puya.awst_build.eb.arc4.base import ARC4ClassExpressionBuilder, ARC4DecodeBuilder +from puya.awst_build.eb.base import ExpressionBuilder +from puya.awst_build.eb.var_factory import var_expression +from puya.errors import CodeError + +if typing.TYPE_CHECKING: + import mypy.nodes + + from puya.parse import SourceLocation + + +class DynamicBytesClassExpressionBuilder(ARC4ClassExpressionBuilder): + def produces(self) -> wtypes.ARC4DynamicArray: + return wtypes.arc4_dynamic_bytes + + def call( + self, + args: Sequence[ExpressionBuilder | Literal], + arg_kinds: list[mypy.nodes.ArgKind], + arg_names: list[str | None], + location: SourceLocation, + original_expr: mypy.nodes.CallExpr, + ) -> ExpressionBuilder: + match args: + case [Literal(value=bytes()) as literal]: + return var_expression(convert_arc4_literal(literal, self.produces(), location)) + case [ExpressionBuilder(value_type=wtypes.bytes_wtype) as eb]: + return var_expression( + ARC4Encode(value=eb.rvalue(), source_location=location, wtype=self.produces()) + ) + + return dynamic_array_constructor( + args=list(map(_coerce_to_byte, args)), wtype=self.produces(), location=location + ) + + +def _coerce_to_byte(arg: ExpressionBuilder | Literal) -> ExpressionBuilder: + match arg: + case Literal(value=int()) as literal: + return var_expression(convert_arc4_literal(literal, wtypes.arc4_byte_type)) + case ExpressionBuilder(value_type=wtypes.ARC4UIntN(n=8) as wtype) as eb: + if wtype != wtypes.arc4_byte_type: + return var_expression( + ReinterpretCast( + expr=arg.rvalue(), + wtype=wtypes.arc4_byte_type, + source_location=arg.source_location, + ) + ) + return eb + case _: + raise CodeError("Expected a Byte, UInt64 or int type", arg.source_location) + + +class DynamicBytesExpressionBuilder(DynamicArrayExpressionBuilder): + wtype = wtypes.arc4_dynamic_bytes + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + match name: + case "decode": + return ARC4DecodeBuilder(self.expr, location) + case _: + return super().member_access(name, location) diff --git a/src/puya/awst_build/eb/arc4/numeric.py b/src/puya/awst_build/eb/arc4/numeric.py index 6fb4bd4eca..727267f55d 100644 --- a/src/puya/awst_build/eb/arc4/numeric.py +++ b/src/puya/awst_build/eb/arc4/numeric.py @@ -1,6 +1,5 @@ from __future__ import annotations -import decimal from typing import TYPE_CHECKING import structlog @@ -8,15 +7,14 @@ from puya.awst import wtypes from puya.awst.nodes import ( ARC4Encode, - DecimalConstant, Expression, - IntegerConstant, Literal, NumericComparison, NumericComparisonExpression, ReinterpretCast, ) from puya.awst_build.eb._utils import uint64_to_biguint +from puya.awst_build.eb.arc4._utils import convert_arc4_literal from puya.awst_build.eb.arc4.base import ( ARC4ClassExpressionBuilder, ARC4EncodedExpressionBuilder, @@ -25,7 +23,6 @@ ) from puya.awst_build.eb.base import BuilderComparisonOp, ExpressionBuilder from puya.awst_build.eb.var_factory import var_expression -from puya.awst_build.utils import convert_literal_to_expr from puya.errors import CodeError, InternalError, TodoError if TYPE_CHECKING: @@ -65,49 +62,8 @@ def call( " the generic type parameter." ) match args: - case [Literal(value=int(int_literal), source_location=loc)] if isinstance( - self.wtype, wtypes.ARC4UIntN - ): - return var_expression( - IntegerConstant( - source_location=loc, - value=int_literal, - wtype=self.wtype, - ) - ) - case [Literal(value=str(decimal_str), source_location=loc)] if isinstance( - self.wtype, wtypes.ARC4UFixedNxM - ): - with decimal.localcontext( - decimal.Context( - prec=160, - traps=[ - decimal.Rounded, - decimal.InvalidOperation, - decimal.Overflow, - decimal.DivisionByZero, - ], - ) - ): - try: - d = decimal.Decimal(decimal_str) - except ArithmeticError as ex: - raise CodeError(f"Invalid decimal literal: {decimal_str}", loc) from ex - if d < 0: - raise CodeError("Negative numbers not allowed", loc) - try: - q = d.quantize(decimal.Decimal(f"1e-{self.wtype.m}")) - except ArithmeticError as ex: - raise CodeError( - f"Too many decimals, expected max of {self.wtype.m}", loc - ) from ex - return var_expression( - DecimalConstant( - source_location=loc, - value=q, - wtype=self.wtype, - ) - ) + case [Literal() as lit]: + return var_expression(convert_arc4_literal(lit, self.wtype, location)) case [ExpressionBuilder(value_type=wtypes.WType() as value_type) as eb]: value = eb.rvalue() if value_type not in ( @@ -132,7 +88,7 @@ def call( class ByteClassExpressionBuilder(NumericARC4ClassExpressionBuilder): def __init__(self, location: SourceLocation): super().__init__(location) - self.wtype = wtypes.ARC4UIntN.from_scale(8, alias="byte") + self.wtype = wtypes.arc4_byte_type class UIntNClassExpressionBuilder(NumericARC4ClassExpressionBuilder): @@ -188,7 +144,10 @@ def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> Expres def compare( self, other: ExpressionBuilder | Literal, op: BuilderComparisonOp, location: SourceLocation ) -> ExpressionBuilder: - other_expr = convert_literal_to_expr(other, self.wtype) + if isinstance(other, Literal): + other_expr = convert_arc4_literal(other, self.wtype) + else: + other_expr = other.rvalue() match other_expr.wtype: case wtypes.biguint_wtype: pass diff --git a/src/puya/awst_build/eb/arc4/string.py b/src/puya/awst_build/eb/arc4/string.py index 928148f983..1ed64c05ca 100644 --- a/src/puya/awst_build/eb/arc4/string.py +++ b/src/puya/awst_build/eb/arc4/string.py @@ -50,21 +50,9 @@ def call( location: SourceLocation, original_expr: mypy.nodes.CallExpr, ) -> ExpressionBuilder: - match args: - case [Literal(value=str(str_val), source_location=loc)]: - return var_expression( - ARC4Encode( - value=BytesConstant( - value=str_val.encode("utf8"), - source_location=loc, - encoding=BytesEncoding.utf8, - ), - source_location=location, - wtype=self.produces(), - ) - ) - case _: - raise CodeError("Invalid/unhandled arguments", location) + if len(args) == 1: + return var_expression(expect_string_or_bytes(args[0], location)) + raise CodeError("Invalid/unhandled arguments", location) def arc4_encode_bytes(bytes_expr: Expression, source_location: SourceLocation) -> Expression: @@ -73,9 +61,11 @@ def arc4_encode_bytes(bytes_expr: Expression, source_location: SourceLocation) - ) -def expect_string_or_bytes(expr: ExpressionBuilder | Literal) -> Expression: +def expect_string_or_bytes( + expr: ExpressionBuilder | Literal, source_location: SourceLocation +) -> Expression: match expr: - case Literal(value=str(string_literal), source_location=source_location): + case Literal(value=str(string_literal)): return arc4_encode_bytes( BytesConstant( value=string_literal.encode("utf-8"), @@ -84,7 +74,7 @@ def expect_string_or_bytes(expr: ExpressionBuilder | Literal) -> Expression: ), source_location, ) - case Literal(value=bytes(bytes_literal), source_location=source_location): + case Literal(value=bytes(bytes_literal)): return arc4_encode_bytes( BytesConstant( value=bytes_literal, @@ -113,7 +103,7 @@ def augmented_assignment( return ExpressionStatement( expr=ArrayExtend( base=self.expr, - other=expect_string_or_bytes(rhs), + other=expect_string_or_bytes(rhs, rhs.source_location), source_location=location, wtype=wtypes.arc4_string_wtype, ) @@ -132,7 +122,7 @@ def binary_op( match op: case BuilderBinaryOp.add: lhs = self.expr - rhs = expect_string_or_bytes(other) + rhs = expect_string_or_bytes(other, other.source_location) if reverse: (lhs, rhs) = (rhs, lhs) return var_expression( diff --git a/src/puya/awst_build/eb/arc4/struct.py b/src/puya/awst_build/eb/arc4/struct.py index a60405577a..cde5aaa867 100644 --- a/src/puya/awst_build/eb/arc4/struct.py +++ b/src/puya/awst_build/eb/arc4/struct.py @@ -14,11 +14,12 @@ UInt64Constant, ) from puya.awst_build.eb._utils import bool_eval_to_constant +from puya.awst_build.eb.arc4._utils import expect_arc4_operand_wtype from puya.awst_build.eb.arc4.base import CopyBuilder, arc4_compare_bytes, get_bytes_expr_builder from puya.awst_build.eb.base import BuilderComparisonOp, ValueExpressionBuilder from puya.awst_build.eb.bytes_backed import BytesBackedClassExpressionBuilder from puya.awst_build.eb.var_factory import var_expression -from puya.awst_build.utils import expect_operand_wtype, get_arg_mapping +from puya.awst_build.utils import get_arg_mapping from puya.errors import CodeError if TYPE_CHECKING: @@ -66,7 +67,7 @@ def call( field_value = field_mapping.pop(field_name, None) if field_value is None: raise CodeError(f"Missing required argument {field_name}", location) - args_positioned.append(expect_operand_wtype(field_value, field_type)) + args_positioned.append(expect_arc4_operand_wtype(field_value, field_type)) if field_mapping: raise CodeError(f"Unexpected keyword arguments: {' '.join(field_mapping)}", location) diff --git a/src/puya/awst_build/eb/log.py b/src/puya/awst_build/eb/log.py index 3c9737aafd..48678ce739 100644 --- a/src/puya/awst_build/eb/log.py +++ b/src/puya/awst_build/eb/log.py @@ -11,7 +11,6 @@ Expression, IntrinsicCall, Literal, - ReinterpretCast, UInt64Constant, ) from puya.awst_build.eb.base import ( @@ -61,19 +60,13 @@ def call( match arg: case ExpressionBuilder(value_type=wtypes.uint64_wtype): bytes_expr = _itob(arg.rvalue(), arg.source_location) + case ExpressionBuilder() as eb: + bytes_expr = eb.rvalue() case Literal(value=int(int_literal)): bytes_expr = _itob( UInt64Constant(value=int_literal, source_location=arg.source_location), arg.source_location, ) - case ExpressionBuilder(value_type=wtypes.bytes_wtype): - bytes_expr = arg.rvalue() - case ExpressionBuilder(value_type=wtypes.biguint_wtype): - bytes_expr = ReinterpretCast( - expr=arg.rvalue(), - wtype=wtypes.bytes_wtype, - source_location=arg.source_location, - ) case Literal(value=bytes(bytes_literal)): bytes_expr = BytesConstant( value=bytes_literal, source_location=arg.source_location @@ -82,10 +75,6 @@ def call( bytes_expr = BytesConstant( value=str_literal.encode("utf8"), source_location=arg.source_location ) - case ExpressionBuilder() as eb: - raise CodeError( - f"Unexpected argument type: {eb.value_type}", arg.source_location - ) case Literal() as lit: raise CodeError( f"Unexpected argument type: {type(lit.value).__name__}", diff --git a/src/puya/awst_build/eb/reference_types/application.py b/src/puya/awst_build/eb/reference_types/application.py index 6520954d4b..2ebeeeae96 100644 --- a/src/puya/awst_build/eb/reference_types/application.py +++ b/src/puya/awst_build/eb/reference_types/application.py @@ -50,9 +50,9 @@ class ApplicationExpressionBuilder(UInt64BackedReferenceValueExpressionBuilder): "approval_program": ("AppApprovalProgram", wtypes.bytes_wtype), "clear_state_program": ("AppClearStateProgram", wtypes.bytes_wtype), "global_num_uint": ("AppGlobalNumUint", wtypes.uint64_wtype), - "global_num_byte_slice": ("AppGlobalNumByteSlice", wtypes.uint64_wtype), + "global_num_bytes": ("AppGlobalNumByteSlice", wtypes.uint64_wtype), "local_num_uint": ("AppLocalNumUint", wtypes.uint64_wtype), - "local_num_byte_slice": ("AppLocalNumByteSlice", wtypes.uint64_wtype), + "local_num_bytes": ("AppLocalNumByteSlice", wtypes.uint64_wtype), "extra_program_pages": ("AppExtraProgramPages", wtypes.uint64_wtype), "creator": ("AppCreator", wtypes.account_wtype), "address": ("AppAddress", wtypes.account_wtype), diff --git a/src/puya/awst_build/eb/transaction/inner_params.py b/src/puya/awst_build/eb/transaction/inner_params.py index c0094aaef8..6388450923 100644 --- a/src/puya/awst_build/eb/transaction/inner_params.py +++ b/src/puya/awst_build/eb/transaction/inner_params.py @@ -38,27 +38,13 @@ } -def get_field_exprs( - arg_name: str, arg: ExpressionBuilder | Literal -) -> tuple[TxnField, Expression]: +def get_field_expr(arg_name: str, arg: ExpressionBuilder | Literal) -> tuple[TxnField, Expression]: try: field = _parameter_mapping[arg_name] except KeyError as ex: raise CodeError(f"{arg_name} is not a valid keyword argument", arg.source_location) from ex - if field in (TxnFields.approval_program, TxnFields.clear_state_program): - field = ( - TxnFields.approval_program_pages - if field == TxnFields.approval_program - else TxnFields.clear_state_program_pages - ) - match arg: - case ExpressionBuilder( - value_type=wtypes.WTuple(types=tuple_item_types) as wtype - ) if all(field.valid_type(t) for t in tuple_item_types): - expr = expect_operand_wtype(arg, wtype) - return field, expr - case _: - field_expr = expect_operand_wtype(arg, field.wtype) + if remapped_field := _maybe_transform_program_field_expr(field, arg): + return remapped_field elif field.is_array: match arg: case ExpressionBuilder( @@ -76,6 +62,26 @@ def get_field_exprs( return field, field_expr +def _maybe_transform_program_field_expr( + field: TxnField, eb: ExpressionBuilder | Literal +) -> tuple[TxnField, Expression] | None: + if field not in (TxnFields.approval_program, TxnFields.clear_state_program): + return None + field = ( + TxnFields.approval_program_pages + if field == TxnFields.approval_program + else TxnFields.clear_state_program_pages + ) + match eb: + case ValueExpressionBuilder(wtype=wtypes.WTuple(types=tuple_item_types) as wtype) if all( + field.valid_type(t) for t in tuple_item_types + ): + expr = expect_operand_wtype(eb, wtype) + case _: + expr = expect_operand_wtype(eb, field.wtype) + return field, expr + + class InnerTxnParamsClassExpressionBuilder(TypeClassExpressionBuilder): def __init__(self, source_location: SourceLocation, wtype: wtypes.WInnerTransactionFields): super().__init__(source_location) @@ -105,7 +111,7 @@ def call( raise CodeError( f"Positional arguments are not supported for {self.produces()}", location ) - field, expression = get_field_exprs(arg_name, arg) + field, expression = get_field_expr(arg_name, arg) transaction_fields[field] = expression return var_expression( CreateInnerTransaction( @@ -187,7 +193,7 @@ def call( transaction_fields = dict[TxnField, Expression]() for arg_name, arg in zip(arg_names, args, strict=True): assert arg_name is not None - field, expression = get_field_exprs(arg_name, arg) + field, expression = get_field_expr(arg_name, arg) transaction_fields[field] = expression return var_expression( UpdateInnerTransaction( diff --git a/src/puya/awst_build/eb/type_registry.py b/src/puya/awst_build/eb/type_registry.py index b0c381f1d2..76c87e5a8c 100644 --- a/src/puya/awst_build/eb/type_registry.py +++ b/src/puya/awst_build/eb/type_registry.py @@ -1,6 +1,7 @@ import functools from collections.abc import Callable +import puya.awst_build.eb.arc4.dynamic_bytes from puya.awst import wtypes from puya.awst.nodes import Expression from puya.awst_build import constants @@ -59,6 +60,8 @@ constants.CLS_ARC4_TUPLE: arc4.ARC4TupleGenericClassExpressionBuilder, constants.CLS_ARC4_UFIXEDNXM: arc4.UFixedNxMClassExpressionBuilder, constants.CLS_ARC4_UINTN: arc4.UIntNClassExpressionBuilder, + constants.CLS_ARC4_ABI_CALL: arc4.ABICallGenericClassExpressionBuilder, + constants.CLS_ARC4_DYNAMIC_BYTES: puya.awst_build.eb.arc4.DynamicBytesClassExpressionBuilder, constants.CLS_ACCOUNT: account.AccountClassExpressionBuilder, constants.CLS_ARRAY: array.ArrayGenericClassExpressionBuilder, constants.CLS_ASSET: asset.AssetClassExpressionBuilder, @@ -122,6 +125,7 @@ wtypes.WTuple: tuple_.TupleExpressionBuilder, wtypes.arc4_bool_wtype: arc4.ARC4BoolExpressionBuilder, wtypes.arc4_string_wtype: arc4.StringExpressionBuilder, + wtypes.arc4_dynamic_bytes: puya.awst_build.eb.arc4.DynamicBytesExpressionBuilder, wtypes.account_wtype: account.AccountExpressionBuilder, wtypes.application_wtype: application.ApplicationExpressionBuilder, wtypes.asset_wtype: asset.AssetExpressionBuilder, diff --git a/src/puya/awst_build/main.py b/src/puya/awst_build/main.py index 5c1475d651..92ed0f0dc5 100644 --- a/src/puya/awst_build/main.py +++ b/src/puya/awst_build/main.py @@ -36,11 +36,16 @@ def transform_ast(compile_context: CompileContext) -> dict[str, Module]: else: logger.debug(f"Discovered user module {module_name} at {module_rel_path}") user_modules[module_name] = ModuleASTConverter(ctx, module) + sources = tuple(str(s.path) for s in compile_context.parse_result.sources) for module_name, converter in user_modules.items(): logger.debug(f"Building AWST for module {module_name}") module_awst = converter.convert() result[module_name] = module_awst - if ctx.options.output_awst and not converter.has_errors: + if ( + ctx.options.output_awst + and not converter.has_errors + and module_awst.source_file_path.startswith(sources) + ): output_awst(module_awst, ctx.options) return result diff --git a/src/puya/awst_build/module.py b/src/puya/awst_build/module.py index 01065e048a..ce4f879711 100644 --- a/src/puya/awst_build/module.py +++ b/src/puya/awst_build/module.py @@ -163,6 +163,14 @@ def visit_class_def(self, cdef: mypy.nodes.ClassDef) -> StatementResult: self._error("Struct classes must only inherit directly from Struct", cdef) else: return _process_struct(self.context, cdef) + elif cdef.info.has_base(constants.CLS_ARC4_CLIENT): + if [ti.fullname for ti in cdef.info.direct_base_classes()] != [ + constants.CLS_ARC4_CLIENT + ]: + self._error("ARC4Client classes must only inherit directly from ARC4Client", cdef) + else: + # nothing to do, ARC4Client classes are used for type info only + pass elif cdef.info.has_base(constants.CONTRACT_BASE): # TODO: mypyc also checks for typing.TypingMeta and typing.GenericMeta equivalently # in a similar check - I can't find many references to these, should we include diff --git a/src/puya/awst_build/subroutine.py b/src/puya/awst_build/subroutine.py index d303c05d00..a2cffdc4c3 100644 --- a/src/puya/awst_build/subroutine.py +++ b/src/puya/awst_build/subroutine.py @@ -50,7 +50,10 @@ from puya.awst_build.base_mypy_visitor import BaseMyPyVisitor from puya.awst_build.context import ASTConversionModuleContext from puya.awst_build.contract_data import AppStateDeclaration -from puya.awst_build.eb.arc4 import ARC4StructClassExpressionBuilder +from puya.awst_build.eb.arc4 import ( + ARC4ClientClassExpressionBuilder, + ARC4StructClassExpressionBuilder, +) from puya.awst_build.eb.base import ( BuilderBinaryOp, BuilderComparisonOp, @@ -504,7 +507,9 @@ def visit_return_stmt(self, stmt: mypy.nodes.ReturnStmt) -> ReturnStatement | No returning = require_expression_builder(return_expr.accept(self)).rvalue() if returning.wtype != self._return_type: - self._error("invalid return type", loc) + self._error( + f"invalid return type of {returning.wtype}, expected {self._return_type}", loc + ) return ReturnStatement(source_location=loc, value=returning) def visit_match_stmt(self, stmt: mypy.nodes.MatchStmt) -> Switch | None: @@ -611,6 +616,13 @@ def _visit_ref_expr_maybe_aliased( if fullname.startswith(constants.PUYAPY_PREFIX): return self._visit_ref_expr_of_puyapy(fullname, expr_loc, expr.node) match expr: + case mypy.nodes.RefExpr(node=mypy.nodes.TypeInfo() as typ) if ( + typ.has_base(constants.CLS_ARC4_CLIENT) + or typ.has_base(constants.ARC4_CONTRACT_BASE) + ): + # provides type info only + # TODO: need to do this only when resolving abi_call args + return ARC4ClientClassExpressionBuilder(self.context, expr_loc, typ.defn.info) case mypy.nodes.RefExpr(node=mypy.nodes.TypeInfo() as typ) if ( typ.has_base(constants.STRUCT_BASE) or typ.has_base(constants.CLS_ARC4_STRUCT) ): diff --git a/src/puya/awst_build/utils.py b/src/puya/awst_build/utils.py index 3493ee2f48..5e500e59c4 100644 --- a/src/puya/awst_build/utils.py +++ b/src/puya/awst_build/utils.py @@ -4,6 +4,7 @@ import mypy.build import mypy.nodes +import mypy.types import structlog from mypy.types import get_proper_type, is_named_instance @@ -180,12 +181,9 @@ def expect_operand_wtype( @typing.overload -def convert_literal(literal_or_expr: Literal, target_wtype: wtypes.WType) -> Expression: - ... - - -@typing.overload -def convert_literal(literal_or_expr: Expression, target_wtype: wtypes.WType) -> Expression: +def convert_literal( + literal_or_expr: Literal | Expression, target_wtype: wtypes.WType +) -> Expression: ... @@ -202,45 +200,36 @@ def convert_literal( if not isinstance(literal_or_expr, Literal): return literal_or_expr - literal_value: typing.Any = literal_or_expr.value loc = literal_or_expr.source_location - if not target_wtype.is_valid_literal(literal_value): - raise CodeError( - f"Cannot implicitly convert literal value {literal_value}" - f" to target type {target_wtype}", - loc, - ) - match target_wtype: - case wtypes.bool_wtype: - return BoolConstant(value=literal_value, source_location=loc) - case wtypes.uint64_wtype | wtypes.biguint_wtype | wtypes.ARC4UIntN(): - return IntegerConstant(value=literal_value, wtype=target_wtype, source_location=loc) - case wtypes.bytes_wtype: + match literal_or_expr.value, target_wtype: + case bool(bool_value), wtypes.bool_wtype: + return BoolConstant(value=bool_value, source_location=loc) + case int(int_value), wtypes.uint64_wtype | wtypes.biguint_wtype: + return IntegerConstant(value=int_value, wtype=target_wtype, source_location=loc) + case bytes(bytes_value), wtypes.bytes_wtype: try: - literal_value.decode("utf8") + # TODO: YEET ME + bytes_value.decode("utf8") except ValueError: encoding = BytesEncoding.unknown else: encoding = BytesEncoding.utf8 - return BytesConstant(value=literal_value, source_location=loc, encoding=encoding) - case wtypes.account_wtype: - return AddressConstant(value=literal_value, source_location=loc) - case wtypes.asset_wtype | wtypes.application_wtype: - return ReinterpretCast( - expr=UInt64Constant(value=literal_value, source_location=loc), - wtype=target_wtype, - source_location=loc, + return BytesConstant(value=bytes_value, encoding=encoding, source_location=loc) + case str(str_value), wtypes.bytes_wtype: + return BytesConstant( + value=str_value.encode("utf8"), encoding=BytesEncoding.utf8, source_location=loc ) - case wtypes.account_wtype: + case str(str_value), wtypes.account_wtype: + return AddressConstant(value=str_value, source_location=loc) + case int(int_value), wtypes.asset_wtype | wtypes.application_wtype: return ReinterpretCast( - expr=BytesConstant(value=literal_value, source_location=loc), + expr=UInt64Constant(value=int_value, source_location=loc), wtype=target_wtype, source_location=loc, ) - case _: - raise CodeError( - f"Can't construct {target_wtype} from Python literal {literal_value}", loc - ) + raise CodeError( + f"Can't construct {target_wtype} from Python literal {literal_or_expr.value!r}", loc + ) def convert_literal_to_expr( diff --git a/src/puya/awst_build/validation/inner_transactions.py b/src/puya/awst_build/validation/inner_transactions.py index 4623f6b353..824a1713ae 100644 --- a/src/puya/awst_build/validation/inner_transactions.py +++ b/src/puya/awst_build/validation/inner_transactions.py @@ -64,6 +64,7 @@ def visit_submit_inner_transaction(self, call: awst_nodes.SubmitInnerTransaction match itxn_params: case awst_nodes.VarExpression(name=var_name): self._current_loop_itxn_vars.append(var_name) + super().visit_submit_inner_transaction(call) def visit_update_inner_transaction(self, call: awst_nodes.UpdateInnerTransaction) -> None: super().visit_update_inner_transaction(call) @@ -131,7 +132,7 @@ def _check_inner_transaction_assignment(self, stmt: awst_nodes.AssignmentStateme ) case awst_nodes.Expression(wtype=wtype) if wtypes.is_inner_transaction_type(wtype): self.context.errors.error( - f"{stmt.value.wtype} cannot be aliased", + f"{stmt.value.wtype} cannot be reassigned", stmt.value.source_location, ) diff --git a/src/puya/client_gen.py b/src/puya/client_gen.py new file mode 100644 index 0000000000..5a87b196e7 --- /dev/null +++ b/src/puya/client_gen.py @@ -0,0 +1,195 @@ +import argparse +import json +import typing +from collections.abc import Iterable, Mapping, Sequence +from pathlib import Path + +import attrs +import structlog +from immutabledict import immutabledict + +from puya.arc32 import OCA_ARC32_MAPPING, write_arc32_client +from puya.errors import PuyaError +from puya.logging_config import LogLevel, configure_logging +from puya.models import ( + ARC4Method, + ARC4MethodArg, + ARC4MethodConfig, + ARC4Returns, + ARC32StructDef, + OnCompletionAction, +) + +logger = structlog.get_logger(__file__) +ARC32_OCA_MAPPING = {v: k for k, v in OCA_ARC32_MAPPING.items()} + + +@attrs.define(kw_only=True) +class PuyaGenOptions: + paths: Sequence[Path] = attrs.field(default=(), repr=lambda p: str(list(map(str, p)))) + log_level: LogLevel = LogLevel.info + + +def main() -> None: + parser = argparse.ArgumentParser( + prog="puya-gen", + formatter_class=argparse.ArgumentDefaultsHelpFormatter, + description="Output puyapy contract client for typed ARC4 ABI calls from an " + "ARC32 application.json spec", + ) + parser.add_argument("paths", type=Path, nargs="+", metavar="PATH") + options = PuyaGenOptions() + parser.parse_args(namespace=options) + configure_logging(min_log_level=options.log_level) + output_stubs(options.paths) + + +def output_stubs(paths: Sequence[Path]) -> None: + try: + app_spec_paths = resolve_app_specs(paths) + for app_spec_path in app_spec_paths: + name, methods = _parse_app_spec_methods(app_spec_path) + write_arc32_client(name, methods, app_spec_path.parent) + except PuyaError as ex: + logger.error(str(ex)) + + +def resolve_app_specs(paths: Sequence[Path]) -> Sequence[Path]: + app_specs = list[Path]() + for path in paths: + if not path.is_dir(): + app_specs.append(path) + else: + patterns = ["application.json", "*.arc32.json"] + + app_specs = [] + for pattern in patterns: + app_specs.extend(path.rglob(pattern)) + + app_specs = sorted(set(app_specs)) + if not app_specs: + raise PuyaError("No app specs found") + return app_specs + + +def _parse_app_spec_methods(path: Path) -> tuple[str, Sequence[ARC4Method]]: + app_spec = json.loads(path.read_text()) + contract = app_spec["contract"] + hints = app_spec["hints"] + contract_name = contract["name"] + methods = list[ARC4Method]() + arc4_methods = {m.signature: m for m in _parse_methods(contract["methods"])} + for arc4_method in arc4_methods.values(): + method_hints = hints[str(arc4_method.signature)] + allow_create, require_create, allowed_oca = _call_config(method_hints["call_config"]) + methods.append( + ARC4Method( + name=arc4_method.python_name, + desc=arc4_method.desc, + args=arc4_method.signature.args, + returns=arc4_method.signature.returns, + config=ARC4MethodConfig( + source_location=None, + name=arc4_method.signature.name, + is_bare=False, + allow_create=allow_create, + require_create=require_create, + readonly=bool(method_hints.get("read_only")), + allowed_completion_types=allowed_oca, + default_args=immutabledict( + _default_args(method_hints.get("default_arguments", {}), arc4_methods) + ), + structs=immutabledict(_structs(method_hints.get("structs", {}))), + ), + ) + ) + return contract_name, methods + + +@attrs.frozen(kw_only=True) +class _MethodSignature: + name: str + args: tuple[ARC4MethodArg, ...] + returns: ARC4Returns + + def __str__(self) -> str: + return f"{self.name}({','.join(a.type_ for a in self.args)}){self.returns.type_}" + + +@attrs.frozen(kw_only=True) +class _Method: + signature: _MethodSignature + python_name: str + desc: str | None + + +def _parse_methods(methods: list[dict[str, typing.Any]]) -> Iterable[_Method]: + arc4_names = dict[str, int]() + for method in methods: + signature = _parse_signature(method) + name_seen = arc4_names[signature.name] = arc4_names.get(signature.name, 0) + 1 + yield _Method( + signature=signature, + desc=method.get("desc"), + # de-duplicate potential collisions + python_name=signature.name if name_seen == 1 else f"{signature.name}{name_seen}", + ) + + +def _parse_signature(method: dict[str, typing.Any]) -> _MethodSignature: + returns = method["returns"] + return _MethodSignature( + name=method["name"], + args=tuple( + ARC4MethodArg( + name=arg["name"], + type_=arg["type"], + desc=arg.get("desc"), + ) + for arg in method["args"] + ), + returns=ARC4Returns( + type_=returns["type"], + desc=returns.get("desc"), + ), + ) + + +def _call_config( + method_call_config: dict[str, str] +) -> tuple[bool, bool, Sequence[OnCompletionAction]]: + try: + (call_config,) = set(method_call_config.values()) + except ValueError as ex: + raise PuyaError("Different call configs for a single method not supported") from ex + require_create = call_config == "CREATE" + allow_create = call_config == "ALL" + allowed_oca = [ARC32_OCA_MAPPING[a] for a in method_call_config] + return allow_create, require_create, allowed_oca + + +def _default_args( + default_args: dict[str, typing.Any], arc32_python_sig: Mapping[_MethodSignature, _Method] +) -> Iterable[tuple[str, str]]: + for param, default_arg_config in default_args.items(): + data = default_arg_config["data"] + source = default_arg_config["source"] + match source: + case "global-state": + yield param, data + case "local-state": + yield param, data + case "abi-method": + signature = _parse_signature(data) + yield param, arc32_python_sig[signature].python_name + case _: + raise PuyaError(f"Unsupported source '{source}' for default argument: {param}") + + +def _structs(structs: dict[str, dict[str, typing.Any]]) -> Iterable[tuple[str, ARC32StructDef]]: + for param, struct_config in structs.items(): + yield param, ARC32StructDef(name=struct_config["name"], elements=struct_config["elements"]) + + +if __name__ == "__main__": + main() diff --git a/src/puya/compile.py b/src/puya/compile.py index 03695634aa..ff24406234 100644 --- a/src/puya/compile.py +++ b/src/puya/compile.py @@ -14,7 +14,7 @@ import mypy.util import structlog -from puya.arc32 import create_arc32_json +from puya.arc32 import create_arc32_json, write_arc32_client from puya.awst_build.main import transform_ast from puya.context import CompileContext from puya.errors import ErrorExitCode, Errors, InternalError, ParseError, log_exceptions @@ -203,11 +203,16 @@ def write_artifacts( if context.options.output_teal: teal_path = out_dir / teal_file_stem write_contract_files(base_path=teal_path, compiled_contract=contract) - if contract.metadata.is_arc4 and context.options.output_arc32: - arc32_path = out_dir / arc32_file_stem - logger.info(f"Writing {make_path_relative_to_cwd(arc32_path)}") - json_text = create_arc32_json(contract) - arc32_path.write_text(json_text) + if contract.metadata.is_arc4: + if context.options.output_arc32: + arc32_path = out_dir / arc32_file_stem + logger.info(f"Writing {make_path_relative_to_cwd(arc32_path)}") + json_text = create_arc32_json(contract) + arc32_path.write_text(json_text) + if context.options.output_client: + write_arc32_client( + contract.metadata.name, contract.metadata.arc4_methods, out_dir + ) def write_contract_files(base_path: Path, compiled_contract: CompiledContract) -> None: diff --git a/src/puya/context.py b/src/puya/context.py index f3017753b5..42a8522343 100644 --- a/src/puya/context.py +++ b/src/puya/context.py @@ -1,4 +1,5 @@ -from collections.abc import Callable, Sequence +from collections.abc import Callable, Mapping, Sequence +from functools import cached_property import attrs @@ -23,6 +24,10 @@ class CompileContext: errors: Errors read_source: Callable[[str], Sequence[str] | None] + @cached_property + def module_paths(self) -> Mapping[str, str]: + return {m.fullname: m.path for m in self.parse_result.ordered_modules} + def try_get_source(self, location: SourceLocation | None) -> SourceMeta: if location is None: return _EmptyMeta @@ -39,7 +44,9 @@ def try_get_source(self, location: SourceLocation | None) -> SourceMeta: start_column = location.column end_column = location.end_column - if start_line == end_line and start_column is not None and end_column is not None: + if not src_content: + self.errors.warning(f"Could not locate source: {location}", None) + elif start_line == end_line and start_column is not None and end_column is not None: src_content[0] = src_content[0][start_column:end_column] else: if start_column is not None: diff --git a/src/puya/ir/arc4_router.py b/src/puya/ir/arc4_router.py index 39c26e8343..9c316e5622 100644 --- a/src/puya/ir/arc4_router.py +++ b/src/puya/ir/arc4_router.py @@ -7,12 +7,7 @@ nodes as awst_nodes, wtypes, ) -from puya.awst.nodes import ( - NumericComparison, - NumericComparisonExpression, - SingleEvaluation, - UInt64Constant, -) +from puya.awst_build.arc4_utils import arc4_decode, arc4_encode from puya.awst_build.eb.transaction import check_transaction_type from puya.errors import CodeError, InternalError from puya.models import ( @@ -84,125 +79,6 @@ def btoi(bytes_arg: awst_nodes.Expression, location: SourceLocation) -> awst_nod ) -def arc4_encode( - base: awst_nodes.Expression, target_wtype: wtypes.WType, location: SourceLocation -) -> awst_nodes.Expression: - match base.wtype: - case wtypes.bytes_wtype: - base_temp = SingleEvaluation(base) - - length = awst_nodes.IntrinsicCall( - source_location=location, - op_code="substring", - immediates=[6, 8], - wtype=wtypes.bytes_wtype, - stack_args=[ - awst_nodes.IntrinsicCall( - source_location=location, - op_code="itob", - stack_args=[awst_nodes.IntrinsicCall.bytes_len(base_temp, location)], - wtype=wtypes.bytes_wtype, - ) - ], - ) - return awst_nodes.ReinterpretCast( - source_location=location, - wtype=wtypes.ARC4DynamicArray.from_element_type( - wtypes.ARC4UIntN.from_scale(8, alias="byte") - ), - expr=awst_nodes.IntrinsicCall( - source_location=location, - op_code="concat", - stack_args=[length, base_temp], - wtype=wtypes.bytes_wtype, - ), - ) - case wtypes.WTuple(types=types): - base_temp = SingleEvaluation(base) - - return awst_nodes.ARC4Encode( - source_location=location, - value=awst_nodes.TupleExpression.from_items( - items=[ - arc4_encode( - awst_nodes.TupleItemExpression( - base=base_temp, - index=i, - source_location=location, - ), - wtypes.avm_to_arc4_equivalent_type(t), - location, - ) - for i, t in enumerate(types) - ], - location=location, - ), - wtype=target_wtype, - ) - - case _: - return awst_nodes.ARC4Encode( - source_location=location, - value=base, - wtype=target_wtype, - ) - - -def arc4_decode( - bytes_arg: awst_nodes.Expression, - target_wtype: wtypes.WType, - location: SourceLocation, - *, - decode_nested_items: bool = False, -) -> awst_nodes.Expression: - match bytes_arg.wtype: - case wtypes.ARC4DynamicArray( - element_type=wtypes.ARC4UIntN(n=8) - ) if target_wtype == wtypes.bytes_wtype: - return awst_nodes.IntrinsicCall( - wtype=wtypes.bytes_wtype, - op_code="extract", - immediates=[2, 0], - source_location=location, - stack_args=[ - awst_nodes.ReinterpretCast( - expr=bytes_arg, wtype=wtypes.bytes_wtype, source_location=location - ) - ], - ) - case wtypes.ARC4Tuple(types=tuple_types): - decode_expression = awst_nodes.ARC4Decode( - source_location=location, - wtype=wtypes.WTuple.from_types(tuple_types), - value=bytes_arg, - ) - if not decode_nested_items: - return decode_expression - decoded = SingleEvaluation(decode_expression) - return awst_nodes.TupleExpression.from_items( - items=[ - arc4_decode( - awst_nodes.TupleItemExpression( - base=decoded, - index=i, - source_location=location, - ), - wtypes.arc4_to_avm_equivalent_wtype(t), - location, - ) - for i, t in enumerate(tuple_types) - ], - location=location, - ) - - case _: - return awst_nodes.ARC4Decode( - source_location=location, - wtype=target_wtype, - value=bytes_arg, - ) - - def has_app_id(location: SourceLocation) -> awst_nodes.Expression: return awst_nodes.IntrinsicCall( source_location=location, @@ -290,7 +166,7 @@ def route_bare_methods( bare_block = create_block( bare_location, bare_method.name, - *assert_create_state(config), + *assert_create_state(config, config.source_location or bare_location), awst_nodes.ExpressionStatement(expr=call(bare_location, bare_method)), approve(bare_location), ) @@ -318,7 +194,8 @@ def route_bare_methods( *assert_create_state( ARC4MethodConfig( name="", source_location=location, is_bare=True, require_create=True - ) + ), + location, ), approve(location), ) @@ -367,10 +244,11 @@ def log_arc4_result( ) -def assert_create_state(config: ARC4MethodConfig) -> Sequence[awst_nodes.AssertStatement]: +def assert_create_state( + config: ARC4MethodConfig, location: SourceLocation +) -> Sequence[awst_nodes.AssertStatement]: if config.allow_create: # if create is allowed, we don't need to check anything return () - location = config.source_location existing_app = has_app_id(location) return ( awst_nodes.AssertStatement( @@ -449,25 +327,25 @@ def check_allowed_oca( ) match allowed_ocas, not_allowed_ocas: case [single_allowed], _: - condition: awst_nodes.Expression = NumericComparisonExpression( + condition: awst_nodes.Expression = awst_nodes.NumericComparisonExpression( lhs=on_completion(location), - rhs=UInt64Constant( + rhs=awst_nodes.UInt64Constant( source_location=location, value=single_allowed.value, teal_alias=single_allowed.name, ), - operator=NumericComparison.eq, + operator=awst_nodes.NumericComparison.eq, source_location=location, ) case _, [single_disallowed]: - condition = NumericComparisonExpression( + condition = awst_nodes.NumericComparisonExpression( lhs=on_completion(location), - rhs=UInt64Constant( + rhs=awst_nodes.UInt64Constant( source_location=location, value=single_disallowed.value, teal_alias=single_disallowed.name, ), - operator=NumericComparison.ne, + operator=awst_nodes.NumericComparison.ne, source_location=location, ) case _: @@ -552,7 +430,7 @@ def arc4_tuple_index( return awst_nodes.IndexExpression( source_location=location, - index=UInt64Constant(value=index, source_location=location), + index=awst_nodes.UInt64Constant(value=index, source_location=location), wtype=arc4_tuple_expression.wtype.types[index], base=arc4_tuple_expression, ) @@ -572,7 +450,7 @@ def map_param_wtype_to_arc4_tuple_type(wtype: wtypes.WType) -> wtypes.WType: if wtypes.has_arc4_equivalent_type(wtype): return wtypes.avm_to_arc4_equivalent_type(wtype) elif wtypes.is_reference_type(wtype): - return wtypes.ARC4UIntN.from_scale(8) + return wtypes.arc4_byte_type else: return wtype @@ -644,7 +522,7 @@ def route_abi_methods( method_routing_cases = dict[awst_nodes.Expression, awst_nodes.Block]() seen_signatures = set[str]() for method, config in methods.items(): - abi_loc = config.source_location + abi_loc = config.source_location or location method_result = call(abi_loc, method, *map_abi_args(method.args, location)) match method.return_type: case wtypes.void_wtype: @@ -662,7 +540,7 @@ def route_abi_methods( abi_loc, f"{config.name}_route", *check_allowed_oca(config.allowed_completion_types, abi_loc), - *assert_create_state(config), + *assert_create_state(config, config.source_location or abi_loc), call_and_maybe_log, approve(abi_loc), ) diff --git a/src/puya/ir/builder/arc4.py b/src/puya/ir/builder/arc4.py index 0166c0beeb..629b1a081e 100644 --- a/src/puya/ir/builder/arc4.py +++ b/src/puya/ir/builder/arc4.py @@ -61,7 +61,7 @@ def decode_expr(context: IRFunctionBuildContext, expr: awst_nodes.ARC4Decode) -> args=[value, UInt64Constant(value=0, source_location=None)], source_location=expr.source_location, ) - case wtypes.arc4_string_wtype: + case wtypes.arc4_string_wtype | wtypes.arc4_dynamic_bytes: return Intrinsic( op=AVMOp.extract, immediates=[2, 0], @@ -118,7 +118,7 @@ def encode_expr(context: IRFunctionBuildContext, expr: awst_nodes.ARC4Encode) -> return _itob_fixed(context, value, num_bytes, expr.source_location) case wtypes.ARC4Tuple(types=item_types) | wtypes.ARC4Struct(types=item_types): return _visit_arc4_tuple_encode(context, expr, item_types) - case wtypes.arc4_string_wtype: + case wtypes.arc4_string_wtype | wtypes.arc4_dynamic_bytes: if isinstance(expr.value, awst_nodes.BytesConstant): ir_const = context.visitor.visit_expr(expr.value) if not isinstance(ir_const, BytesConstant): diff --git a/src/puya/ir/builder/itxn.py b/src/puya/ir/builder/itxn.py index c9915a922b..70f5d6a401 100644 --- a/src/puya/ir/builder/itxn.py +++ b/src/puya/ir/builder/itxn.py @@ -8,9 +8,11 @@ nodes as awst_nodes, wtypes, ) +from puya.awst.to_code_visitor import ToCodeVisitor from puya.errors import CodeError, InternalError from puya.ir.avm_ops import AVMOp from puya.ir.builder._utils import assign, assign_intrinsic_op +from puya.ir.builder.assignment import handle_assignment from puya.ir.builder.blocks import BlocksBuilder from puya.ir.context import IRFunctionBuildContext from puya.ir.models import ( @@ -82,6 +84,7 @@ def __init__(self, context: IRFunctionBuildContext): self.context = context self._inner_txn_params_data = dict[str, CreateInnerTransactionData]() self._inner_txn_submit_data = dict[str, SubmitInnerTransactionData]() + self._evaluated_itxn_expr = dict[awst_nodes.SingleEvaluation, str]() self._last_submit_id = 0 @property @@ -92,36 +95,50 @@ def ssa(self) -> BraunSSA: def block_builder(self) -> BlocksBuilder: return self.context.block_builder - def handle_inner_transaction_assignments(self, stmt: awst_nodes.AssignmentStatement) -> bool: + def handle_inner_transaction_assignments( + self, + target: awst_nodes.Expression, + value: awst_nodes.Expression, + source_location: SourceLocation, + ) -> bool: """Performs special handling for inner transaction related assignments Returns True if assignment was handled, False otherwise""" - if isinstance(stmt.value, awst_nodes.SubmitInnerTransaction): - num_inner_txns = len(stmt.value.itxns) - match stmt.target: - case awst_nodes.VarExpression(name=var_name) if num_inner_txns == 1: - names = [var_name] - case awst_nodes.TupleExpression(items=items) if num_inner_txns == len( - items - ) and all(isinstance(i, awst_nodes.VarExpression) for i in items): - items = typing.cast(Sequence[awst_nodes.VarExpression], items) - names = [expr.name for expr in items] - case _: - raise CodeError( - "Inner Transactions can only be assigned to local variables", - stmt.source_location, - ) - self.handle_submit_inner_transaction(stmt.value, names) - elif isinstance(stmt.value.wtype, wtypes.WInnerTransactionFields): - match stmt.target: + # assign submit to unpacked tuples + if isinstance(value, awst_nodes.SubmitInnerTransaction): + num_inner_txns = len(value.itxns) + names = self._get_expression_names(target, num_inner_txns) + self.handle_submit_inner_transaction(value, names) + # assign a tuple expression containing inner transaction results + elif ( + isinstance(target, awst_nodes.TupleExpression) + and isinstance(value, awst_nodes.TupleExpression) + and any(isinstance(i.wtype, wtypes.WInnerTransaction) for i in value.items) + ): + for item_target, item_value in zip(target.items, value.items, strict=True): + if isinstance(item_value, awst_nodes.SubmitInnerTransaction): + names = self._get_expression_names(item_target, 1) + self.handle_submit_inner_transaction(item_value, names) + elif isinstance(item_value.wtype, wtypes.WInnerTransaction) and isinstance( + item_value, awst_nodes.SingleEvaluation + ): + (dst_name,) = self._get_expression_names(item_target, 1) + src_name = self._get_itxn_var_name(item_value) + self._inner_txn_submit_data[dst_name] = self._inner_txn_submit_data[src_name] + else: + value_provider = self.context.visitor.visit_expr(item_value) + handle_assignment(self.context, item_target, value_provider, source_location) + # assign itxn fields to local temporaries + elif isinstance(value.wtype, wtypes.WInnerTransactionFields): + match target: case awst_nodes.VarExpression(name=var_name, source_location=var_loc): pass case _: raise CodeError( "Inner Transaction params can only be assigned to (non-tuple) variables", - stmt.source_location, + source_location, ) - match stmt.value: + match value: case awst_nodes.CreateInnerTransaction(fields=fields): self._set_inner_transaction_fields(var_name, fields, var_loc) case awst_nodes.Copy(value=value): @@ -130,17 +147,21 @@ def handle_inner_transaction_assignments(self, stmt: awst_nodes.AssignmentStatem case _: raise CodeError( "Inner Transaction params can only be reassigned using copy()", - stmt.source_location, + source_location, ) - - elif isinstance( - stmt.value.wtype, (wtypes.WInnerTransaction, wtypes.WInnerTransactionFields) - ): - raise CodeError( - "Inner Transactions cannot be reassigned", - stmt.source_location, - ) + # reassigning itxn results is not allowed + elif isinstance(value.wtype, wtypes.WInnerTransaction): + if isinstance(value, awst_nodes.SingleEvaluation): + (dst_name,) = self._get_expression_names(target, 1) + src_name = self._get_itxn_var_name(value) + self._inner_txn_submit_data[dst_name] = self._inner_txn_submit_data[src_name] + else: + raise CodeError( + "Inner Transactions cannot be reassigned", + source_location, + ) else: + # not a itxn scenario return False return True @@ -442,6 +463,12 @@ def _resolve_itxn_group_index(self, expr: awst_nodes.Expression) -> SubmitInnerT return self._inner_txn_submit_data[var_name] except KeyError: pass + case awst_nodes.SingleEvaluation() as itxn_var: + var_name = self._get_itxn_var_name(itxn_var) + try: + return self._inner_txn_submit_data[var_name] + except KeyError: + pass case awst_nodes.SubmitInnerTransaction() as submit: submit_data = self.handle_submit_inner_transaction(submit) try: @@ -454,10 +481,22 @@ def _resolve_itxn_group_index(self, expr: awst_nodes.Expression) -> SubmitInnerT ) from ex return first_submit raise CodeError( - f"Could not resolve inner transaction group index for {expr}", + f"Could not resolve inner transaction group index for {expr.accept(ToCodeVisitor())}", expr.source_location, ) + def _get_itxn_var_name(self, expr: awst_nodes.SingleEvaluation) -> str: + try: + return self._evaluated_itxn_expr[expr] + except KeyError: + pass + if not isinstance(expr.source, awst_nodes.SubmitInnerTransaction): + raise CodeError("Could not resolve inner transaction", expr.source_location) + var_name = f"tmp_itxn_{len(self._evaluated_itxn_expr)}" + self._evaluated_itxn_expr[expr] = var_name + self.handle_submit_inner_transaction(expr.source, (var_name,)) + return var_name + def _resolve_inner_txn_params_var_name(self, params: awst_nodes.Expression) -> str: match params: case awst_nodes.CreateInnerTransaction() as itxn: @@ -501,6 +540,26 @@ def _assign_inner_txn_fields( source_location=source_location, ) + def _get_expression_names( + self, expr: awst_nodes.Expression, expected_number: int + ) -> list[str]: + match expr: + case awst_nodes.VarExpression(name=var_name) if expected_number == 1: + names = [var_name] + case awst_nodes.TupleExpression(items=items) if expected_number == len(items) and all( + isinstance(i, awst_nodes.VarExpression) for i in items + ): + items = typing.cast(Sequence[awst_nodes.VarExpression], items) + names = [expr.name for expr in items] + case awst_nodes.SingleEvaluation() as itxn: + names = [self._get_itxn_var_name(itxn)] + case _: + raise CodeError( + "Inner Transactions can only be assigned to local variables", + expr.source_location, + ) + return names + def get_inner_txn_field_name(var_name: str, field: str) -> str: return f"{var_name}%%{field}" diff --git a/src/puya/ir/builder/main.py b/src/puya/ir/builder/main.py index 7f424dd7da..19142bcf5f 100644 --- a/src/puya/ir/builder/main.py +++ b/src/puya/ir/builder/main.py @@ -127,7 +127,9 @@ def visit_arc4_encode(self, expr: awst_nodes.ARC4Encode) -> TExpression: return arc4.encode_expr(self.context, expr) def visit_assignment_statement(self, stmt: awst_nodes.AssignmentStatement) -> TStatement: - if not self._itxn.handle_inner_transaction_assignments(stmt): + if not self._itxn.handle_inner_transaction_assignments( + stmt.target, stmt.value, stmt.source_location + ): handle_assignment_expr( self.context, target=stmt.target, @@ -137,6 +139,10 @@ def visit_assignment_statement(self, stmt: awst_nodes.AssignmentStatement) -> TS return None def visit_assignment_expression(self, expr: awst_nodes.AssignmentExpression) -> TExpression: + if self._itxn.handle_inner_transaction_assignments( + expr.target, expr.value, expr.source_location + ): + return None result = handle_assignment_expr( self.context, target=expr.target, @@ -204,7 +210,8 @@ def visit_decimal_constant(self, expr: awst_nodes.DecimalConstant) -> TExpressio match expr.wtype: case wtypes.ARC4UFixedNxM(n=bit_size): num_bytes = bit_size // 8 - adjusted_int = int(str(expr.value).replace(".", "")) + _, digits, _ = expr.value.as_tuple() + adjusted_int = int("".join(map(str, digits))) return BytesConstant( source_location=expr.source_location, encoding=AVMBytesEncoding.base16, diff --git a/src/puya/mir/models.py b/src/puya/mir/models.py index a2cfe7d42b..5af875214d 100644 --- a/src/puya/mir/models.py +++ b/src/puya/mir/models.py @@ -488,7 +488,7 @@ def __str__(self) -> str: return f"{self.name}({params}) -> {returns or 'void'}:" -@attrs.define(slots=False) +@attrs.define class MemorySubroutine: """A lower form of IR that is concerned with memory assignment (both stack and scratch)""" diff --git a/src/puya/mir/vla.py b/src/puya/mir/vla.py index 26e964a04f..d146c3a53a 100644 --- a/src/puya/mir/vla.py +++ b/src/puya/mir/vla.py @@ -21,7 +21,7 @@ class _OpLifetime: live_out: StableSet[str] = attrs.field(factory=StableSet) -@attrs.define(slots=False) +@attrs.define class VariableLifetimeAnalysis: """Performs VLA analysis for a subroutine, providing a mapping of ops to sets of live local_ids see https://www.classes.cs.uchicago.edu/archive/2004/spring/22620-1/docs/liveness.pdf""" diff --git a/src/puya/models.py b/src/puya/models.py index b46f409a73..3ff64ea383 100644 --- a/src/puya/models.py +++ b/src/puya/models.py @@ -23,7 +23,7 @@ class OnCompletionAction(enum.IntEnum): @attrs.frozen(kw_only=True) class ARC4MethodConfig: - source_location: SourceLocation + source_location: SourceLocation | None name: str is_bare: bool = False allow_create: bool = False @@ -39,24 +39,24 @@ class ARC4MethodConfig: structs: immutabledict[str, ARC32StructDef] = immutabledict() -@attrs.define +@attrs.frozen class ARC4MethodArg: name: str type_: str - desc: str | None + desc: str | None = attrs.field(hash=False) -@attrs.define +@attrs.frozen class ARC4Returns: type_: str - desc: str | None + desc: str | None = attrs.field(hash=False) -@attrs.define +@attrs.frozen class ARC4Method: name: str - desc: str | None - args: list[ARC4MethodArg] + desc: str | None = attrs.field(hash=False) + args: Sequence[ARC4MethodArg] = attrs.field(converter=tuple[ARC4MethodArg, ...]) returns: ARC4Returns config: ARC4MethodConfig diff --git a/src/puya/options.py b/src/puya/options.py index d94932e742..dbc023699f 100644 --- a/src/puya/options.py +++ b/src/puya/options.py @@ -24,6 +24,7 @@ class PuyaOptions: paths: Sequence[Path] = attrs.field(default=(), repr=lambda p: str(list(map(str, p)))) output_teal: bool = True output_arc32: bool = True + output_client: bool = False output_awst: bool = False output_ssa_ir: bool = False output_optimization_ir: bool = False diff --git a/src/puyapy-stubs/_reference.pyi b/src/puyapy-stubs/_reference.pyi index a041b5f3ce..f1937b9611 100644 --- a/src/puyapy-stubs/_reference.pyi +++ b/src/puyapy-stubs/_reference.pyi @@ -291,7 +291,7 @@ class Application: ``` """ @property - def global_num_byte_slice(self) -> UInt64: + def global_num_bytes(self) -> UInt64: """Number of byte array values allowed in Global State ```{note} @@ -307,7 +307,7 @@ class Application: ``` """ @property - def local_num_byte_slice(self) -> UInt64: + def local_num_bytes(self) -> UInt64: """Number of byte array values allowed in Local State ```{note} diff --git a/src/puyapy-stubs/_transaction.pyi b/src/puyapy-stubs/_transaction.pyi index 3400f6de0a..78bc78ec75 100644 --- a/src/puyapy-stubs/_transaction.pyi +++ b/src/puyapy-stubs/_transaction.pyi @@ -127,13 +127,13 @@ class ApplicationProtocol(typing.Protocol): def global_num_uint(self) -> UInt64: """Number of global state integers in ApplicationCall""" @property - def global_num_byte_slice(self) -> UInt64: + def global_num_bytes(self) -> UInt64: """Number of global state byteslices in ApplicationCall""" @property def local_num_uint(self) -> UInt64: """Number of local state integers in ApplicationCall""" @property - def local_num_byte_slice(self) -> UInt64: + def local_num_bytes(self) -> UInt64: """Number of local state byteslices in ApplicationCall""" @property def extra_program_pages(self) -> UInt64: diff --git a/src/puyapy-stubs/_util.pyi b/src/puyapy-stubs/_util.pyi index 80009a6295..43ff26011c 100644 --- a/src/puyapy-stubs/_util.pyi +++ b/src/puyapy-stubs/_util.pyi @@ -1,4 +1,4 @@ -from puyapy import BigUInt, Bytes, UInt64 +from puyapy import BytesBacked, Bytes, UInt64 class OpUpFeeSource(UInt64): """Defines the source of fees for the OpUp utility.""" @@ -16,7 +16,7 @@ def ensure_budget( """Ensure the available op code budget is greater than or equal to required_budget""" def log( - *args: BigUInt | UInt64 | Bytes | str | bytes | int, sep: Bytes | bytes | str = b"" + *args: UInt64 | Bytes | BytesBacked | str | bytes | int, sep: Bytes | bytes | str = b"" ) -> None: """Concatenates and logs supplied args as a single bytes value. diff --git a/src/puyapy-stubs/arc4.pyi b/src/puyapy-stubs/arc4.pyi index e06a81245d..ba724cba2b 100644 --- a/src/puyapy-stubs/arc4.pyi +++ b/src/puyapy-stubs/arc4.pyi @@ -66,10 +66,10 @@ class _ABIEncoded(puyapy.BytesBacked, typing.Protocol[_T]): class String(_ABIEncoded[puyapy.Bytes]): """An ARC4 sequence of bytes containing a UTF8 string""" - def __init__(self, value: typing.LiteralString) -> None: ... - def __add__(self, other: String | str | bytes | puyapy.Bytes) -> String: ... - def __iadd__(self, other: String | str | bytes | puyapy.Bytes) -> String: ... - def __radd__(self, other: String | str | bytes | puyapy.Bytes) -> String: ... + def __init__(self, value: str | puyapy.Bytes) -> None: ... + def __add__(self, other: String | str) -> String: ... + def __iadd__(self, other: String | str) -> String: ... + def __radd__(self, other: String | str) -> String: ... def __eq__(self, other: String | str) -> bool: ... # type: ignore[override] def __bool__(self) -> bool: """Returns `True` if length is not zero""" @@ -379,8 +379,13 @@ class Address(StaticArray[Byte, typing.Literal[32]]): def __bool__(self) -> bool: """Returns `True` if not equal to the zero address""" -DynamicBytes: typing.TypeAlias = DynamicArray[Byte] -"""A variable sized array of bytes""" +class DynamicBytes(_ABIEncoded[puyapy.Bytes], DynamicArray[Byte]): + """A variable sized array of bytes""" + + @typing.overload + def __init__(self, *values: Byte | UInt8 | int): ... + @typing.overload + def __init__(self, value: puyapy.Bytes | bytes, /): ... class ARC4Contract(puyapy.Contract): """A contract that conforms to the ARC4 ABI specification, functions decorated with @@ -431,3 +436,106 @@ class Struct(metaclass=_StructMeta): """Construct an instance from the underlying bytes[] (no validation)""" def copy(self) -> typing.Self: """Create a copy of this struct""" + +class ARC4Client(typing.Protocol): ... + +_TABIResult_co = typing.TypeVar("_TABIResult_co", covariant=True) +_TABIArg = ( + puyapy.BytesBacked + | puyapy.UInt64 + | puyapy.Bytes + | puyapy.Asset + | puyapy.Account + | puyapy.Application + | int + | bool + | bytes + | str +) + +class _ABICallWithReturnProtocol(typing.Protocol[_TABIResult_co]): + def __call__( + self, + method: str, + /, + *args: _TABIArg, + app_id: puyapy.Application | puyapy.UInt64 | int = ..., + on_completion: puyapy.OnCompleteAction = ..., + approval_program: puyapy.Bytes | bytes | tuple[puyapy.Bytes, ...] = ..., + clear_state_program: puyapy.Bytes | bytes | tuple[puyapy.Bytes, ...] = ..., + global_num_uint: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., + local_num_uint: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., + extra_program_pages: UInt64 | int = ..., + fee: puyapy.UInt64 | int = ..., + sender: puyapy.Account | str = ..., + note: puyapy.Bytes | bytes | str = ..., + rekey_to: puyapy.Account | str = ..., + ) -> tuple[_TABIResult_co, puyapy.itxn.ApplicationCallInnerTransaction]: ... + +class _ABICallProtocolType(typing.Protocol): + @typing.overload + def __call__( # type: ignore[misc] + self, + method: Callable[..., None] | str, + /, + *args: _TABIArg, + app_id: puyapy.Application | puyapy.UInt64 | int = ..., + on_completion: puyapy.OnCompleteAction = ..., + approval_program: puyapy.Bytes | bytes | tuple[puyapy.Bytes, ...] = ..., + clear_state_program: puyapy.Bytes | bytes | tuple[puyapy.Bytes, ...] = ..., + global_num_uint: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., + local_num_uint: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., + extra_program_pages: UInt64 | int = ..., + fee: puyapy.UInt64 | int = ..., + sender: puyapy.Account | str = ..., + note: puyapy.Bytes | bytes | str = ..., + rekey_to: puyapy.Account | str = ..., + ) -> puyapy.itxn.ApplicationCallInnerTransaction: ... + @typing.overload + def __call__( # type: ignore[misc] + self, + method: Callable[..., _TABIResult_co], + /, + *args: _TABIArg, + app_id: puyapy.Application | puyapy.UInt64 | int = ..., + on_completion: puyapy.OnCompleteAction = ..., + approval_program: puyapy.Bytes | bytes | tuple[puyapy.Bytes, ...] = ..., + clear_state_program: puyapy.Bytes | bytes | tuple[puyapy.Bytes, ...] = ..., + global_num_uint: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., + local_num_uint: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., + extra_program_pages: UInt64 | int = ..., + fee: puyapy.UInt64 | int = ..., + sender: puyapy.Account | str = ..., + note: puyapy.Bytes | bytes | str = ..., + rekey_to: puyapy.Account | str = ..., + ) -> tuple[_TABIResult_co, puyapy.itxn.ApplicationCallInnerTransaction]: ... + def __getitem__( + self, _: type[_TABIResult_co] + ) -> _ABICallWithReturnProtocol[_TABIResult_co]: ... + +abi_call: _ABICallProtocolType = ... +"""Provides a typesafe way of calling ARC4 methods via an inner transaction + +Examples: +``` +# can reference another puyapy contract method +result, txn = abi_call(HelloWorldContract.hello, arc4.String("World"), app=...) +assert result == "Hello, World" + +# can reference a method selector +result, txn = abi_call[arc4.String]("hello(string)string", arc4.String("Algo"), app=...) +assert result == "Hello, Algo" + +# can reference a method name, the method selector is inferred from arguments and return type +result, txn = abi_call[arc4.String]("hello", "There", app=...) +assert result == "Hello, There" +``` + + +""" diff --git a/src/puyapy-stubs/itxn.pyi b/src/puyapy-stubs/itxn.pyi index 219985b6ba..5b4f9fee7a 100644 --- a/src/puyapy-stubs/itxn.pyi +++ b/src/puyapy-stubs/itxn.pyi @@ -100,11 +100,11 @@ class InnerTransaction(_InnerTransaction[InnerTransactionResult]): ## asset config config_asset: Asset | UInt64 | int = ..., total: UInt64 | int = ..., - unit_name: Bytes | bytes = ..., - asset_name: Bytes | bytes = ..., + unit_name: Bytes | bytes | str = ..., + asset_name: Bytes | bytes | str = ..., decimals: UInt64 | int = ..., default_frozen: bool = ..., - url: Bytes | bytes = ..., + url: Bytes | bytes | str = ..., metadata_hash: Bytes | bytes = ..., manager: Account | str = ..., reserve: Account | str = ..., @@ -125,9 +125,9 @@ class InnerTransaction(_InnerTransaction[InnerTransactionResult]): clear_state_program: Bytes | bytes = ..., on_completion: OnCompleteAction | UInt64 | int = ..., global_num_uint: UInt64 | int = ..., - global_num_byte_slice: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., local_num_uint: UInt64 | int = ..., - local_num_byte_slice: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., extra_program_pages: UInt64 | int = ..., app_args: tuple[Bytes, ...] = ..., accounts: tuple[Account, ...] = ..., @@ -136,7 +136,7 @@ class InnerTransaction(_InnerTransaction[InnerTransactionResult]): ## shared sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ): ... def set( @@ -158,11 +158,11 @@ class InnerTransaction(_InnerTransaction[InnerTransactionResult]): ## asset config config_asset: Asset | UInt64 | int = ..., total: UInt64 | int = ..., - unit_name: Bytes | bytes = ..., - asset_name: Bytes | bytes = ..., + unit_name: Bytes | bytes | str = ..., + asset_name: Bytes | bytes | str = ..., decimals: UInt64 | int = ..., default_frozen: bool = ..., - url: Bytes | bytes = ..., + url: Bytes | bytes | str = ..., metadata_hash: Bytes | bytes = ..., manager: Account | str = ..., reserve: Account | str = ..., @@ -183,9 +183,9 @@ class InnerTransaction(_InnerTransaction[InnerTransactionResult]): clear_state_program: Bytes | bytes = ..., on_completion: OnCompleteAction | UInt64 | int = ..., global_num_uint: UInt64 | int = ..., - global_num_byte_slice: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., local_num_uint: UInt64 | int = ..., - local_num_byte_slice: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., extra_program_pages: UInt64 | int = ..., app_args: tuple[Bytes, ...] = ..., accounts: tuple[Account, ...] = ..., @@ -194,7 +194,7 @@ class InnerTransaction(_InnerTransaction[InnerTransactionResult]): ## shared sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates inner transaction parameter values""" @@ -210,7 +210,7 @@ class Payment(_InnerTransaction[PaymentInnerTransaction]): close_remainder_to: Account | str = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ): ... def set( @@ -221,7 +221,7 @@ class Payment(_InnerTransaction[PaymentInnerTransaction]): close_remainder_to: Account | str = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates inner transaction parameter values""" @@ -241,7 +241,7 @@ class KeyRegistration(_InnerTransaction[KeyRegistrationInnerTransaction]): state_proof_key: Bytes | bytes = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ): ... def set( @@ -256,7 +256,7 @@ class KeyRegistration(_InnerTransaction[KeyRegistrationInnerTransaction]): state_proof_key: Bytes | bytes = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates inner transaction parameter values""" @@ -269,11 +269,11 @@ class AssetConfig(_InnerTransaction[AssetConfigInnerTransaction]): *, config_asset: Asset | UInt64 | int = ..., total: UInt64 | int = ..., - unit_name: Bytes | bytes = ..., - asset_name: Bytes | bytes = ..., + unit_name: Bytes | bytes | str = ..., + asset_name: Bytes | bytes | str = ..., decimals: UInt64 | int = ..., default_frozen: bool = ..., - url: Bytes | bytes = ..., + url: Bytes | bytes | str = ..., metadata_hash: Bytes | bytes = ..., manager: Account | str = ..., reserve: Account | str = ..., @@ -281,7 +281,7 @@ class AssetConfig(_InnerTransaction[AssetConfigInnerTransaction]): clawback: Account | str = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: ... def set( @@ -289,11 +289,11 @@ class AssetConfig(_InnerTransaction[AssetConfigInnerTransaction]): *, config_asset: Asset | UInt64 | int = ..., total: UInt64 | int = ..., - unit_name: Bytes | bytes = ..., - asset_name: Bytes | bytes = ..., + unit_name: Bytes | bytes | str = ..., + asset_name: Bytes | bytes | str = ..., decimals: UInt64 | int = ..., default_frozen: bool = ..., - url: Bytes | bytes = ..., + url: Bytes | bytes | str = ..., metadata_hash: Bytes | bytes = ..., manager: Account | str = ..., reserve: Account | str = ..., @@ -301,7 +301,7 @@ class AssetConfig(_InnerTransaction[AssetConfigInnerTransaction]): clawback: Account | str = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates inner transaction parameter values""" @@ -318,7 +318,7 @@ class AssetTransfer(_InnerTransaction[AssetTransferInnerTransaction]): asset_close_to: Account | str = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: ... def set( @@ -330,7 +330,7 @@ class AssetTransfer(_InnerTransaction[AssetTransferInnerTransaction]): asset_close_to: Account | str = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates transaction parameter values""" @@ -346,7 +346,7 @@ class AssetFreeze(_InnerTransaction[AssetFreezeInnerTransaction]): frozen: bool, sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: ... def set( @@ -357,7 +357,7 @@ class AssetFreeze(_InnerTransaction[AssetFreezeInnerTransaction]): frozen: bool = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates inner transaction parameter values""" @@ -373,9 +373,9 @@ class ApplicationCall(_InnerTransaction[ApplicationCallInnerTransaction]): clear_state_program: Bytes | bytes | tuple[Bytes, ...] = ..., on_completion: OnCompleteAction | UInt64 | int = ..., global_num_uint: UInt64 | int = ..., - global_num_byte_slice: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., local_num_uint: UInt64 | int = ..., - local_num_byte_slice: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., extra_program_pages: UInt64 | int = ..., app_args: tuple[Bytes | BytesBacked, ...] = ..., accounts: tuple[Account, ...] = ..., @@ -383,7 +383,7 @@ class ApplicationCall(_InnerTransaction[ApplicationCallInnerTransaction]): apps: tuple[Application, ...] = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: ... def set( @@ -394,9 +394,9 @@ class ApplicationCall(_InnerTransaction[ApplicationCallInnerTransaction]): clear_state_program: Bytes | bytes | tuple[Bytes, ...] = ..., on_completion: OnCompleteAction | UInt64 | int = ..., global_num_uint: UInt64 | int = ..., - global_num_byte_slice: UInt64 | int = ..., + global_num_bytes: UInt64 | int = ..., local_num_uint: UInt64 | int = ..., - local_num_byte_slice: UInt64 | int = ..., + local_num_bytes: UInt64 | int = ..., extra_program_pages: UInt64 | int = ..., app_args: tuple[Bytes | BytesBacked, ...] = ..., accounts: tuple[Account, ...] = ..., @@ -404,7 +404,7 @@ class ApplicationCall(_InnerTransaction[ApplicationCallInnerTransaction]): apps: tuple[Application, ...] = ..., sender: Account | str = ..., fee: UInt64 | int = ..., - note: Bytes | bytes = ..., + note: Bytes | bytes | str = ..., rekey_to: Account | str = ..., ) -> None: """Updates inner transaction parameter values""" diff --git a/test_cases/abi_routing/out/Reference.approval.mir b/test_cases/abi_routing/out/Reference.approval.mir index e010a1dbdd..524efbef26 100644 --- a/test_cases/abi_routing/out/Reference.approval.mir +++ b/test_cases/abi_routing/out/Reference.approval.mir @@ -812,7 +812,7 @@ get_asset: proto 0 1 // @arc4.abimethod(readonly=True)\ndef get_asset(self) -> arc4.UInt64: abi_routing/contract.py:116-117 get_asset_block@0: - byte 0x00000000000001c8 // 0x00000000000001c8 456 abi_routing/contract.py:118 + byte 0x00000000000001c8 // 0x00000000000001c8 arc4.UInt64(456) abi_routing/contract.py:118 retsub // 0x00000000000001c8 return arc4.UInt64(456) abi_routing/contract.py:118 @@ -821,7 +821,7 @@ get_app: proto 0 1 // @arc4.abimethod(readonly=True, name="get_application")\ndef get_app(self) -> arc4.UInt64: abi_routing/contract.py:120-121 get_app_block@0: - byte 0x00000000000001c8 // 0x00000000000001c8 456 abi_routing/contract.py:122 + byte 0x00000000000001c8 // 0x00000000000001c8 arc4.UInt64(456) abi_routing/contract.py:122 retsub // 0x00000000000001c8 return arc4.UInt64(456) abi_routing/contract.py:122 @@ -830,7 +830,7 @@ get_a_int: proto 0 1 // @arc4.abimethod(readonly=True, name="get_an_int")\ndef get_a_int(self) -> arc4.UInt64: abi_routing/contract.py:124-125 get_a_int_block@0: - byte 0x0000000000000003 // 0x0000000000000003 3 abi_routing/contract.py:126 + byte 0x0000000000000003 // 0x0000000000000003 arc4.UInt64(3) abi_routing/contract.py:126 retsub // 0x0000000000000003 return arc4.UInt64(3) abi_routing/contract.py:126 @@ -883,7 +883,7 @@ method_with_default_args_block@0: extract 0 1 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | {extract} bytes_from_storage[0] abi_routing/contract.py:159 // virtual: store tmp%9#0 to l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%9#0 bytes_from_storage[0] abi_routing/contract.py:159 // virtual: load tmp%9#0 from l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%9#0 bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" abi_routing/contract.py:159 - byte 0x07 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%9#0,0x07 7 abi_routing/contract.py:159 + byte 0x07 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%9#0,0x07 arc4.Byte(7) abi_routing/contract.py:159 b== // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | {b==} bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" abi_routing/contract.py:159 // virtual: store tmp%10#0 to l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%10#0 bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" abi_routing/contract.py:159 // virtual: load tmp%10#0 from l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%10#0 assert bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" abi_routing/contract.py:159 @@ -892,7 +892,7 @@ method_with_default_args_block@0: extract 1 1 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | {extract} bytes_from_storage[1] abi_routing/contract.py:160 // virtual: store tmp%12#0 to l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%12#0 bytes_from_storage[1] abi_routing/contract.py:160 // virtual: load tmp%12#0 from l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%12#0 bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" abi_routing/contract.py:160 - byte 0x08 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%12#0,0x08 8 abi_routing/contract.py:160 + byte 0x08 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%12#0,0x08 arc4.Byte(8) abi_routing/contract.py:160 b== // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | {b==} bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" abi_routing/contract.py:160 // virtual: store tmp%13#0 to l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%13#0 bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" abi_routing/contract.py:160 // virtual: load tmp%13#0 from l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%13#0 assert bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" abi_routing/contract.py:160 @@ -901,7 +901,7 @@ method_with_default_args_block@0: extract 2 1 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | {extract} bytes_from_storage[2] abi_routing/contract.py:161 // virtual: store tmp%15#0 to l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%15#0 bytes_from_storage[2] abi_routing/contract.py:161 // virtual: load tmp%15#0 from l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%15#0 bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" abi_routing/contract.py:161 - byte 0x09 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%15#0,0x09 9 abi_routing/contract.py:161 + byte 0x09 // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%15#0,0x09 arc4.Byte(9) abi_routing/contract.py:161 b== // (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | {b==} bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" abi_routing/contract.py:161 // virtual: store tmp%16#0 to l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%16#0 bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" abi_routing/contract.py:161 // virtual: load tmp%16#0 from l-stack (no copy) (𝕡) asset_from_storage#0,asset_from_function#0,account_from_storage#0,account_from_function#0,application_from_storage#0,application_from_function#0,bytes_from_storage#0,int_from_storage#0,int_from_function#0 | tmp%16#0 assert bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" abi_routing/contract.py:161 diff --git a/test_cases/abi_routing/out/client_Reference.py b/test_cases/abi_routing/out/client_Reference.py new file mode 100644 index 0000000000..18657daf5a --- /dev/null +++ b/test_cases/abi_routing/out/client_Reference.py @@ -0,0 +1,113 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Reference(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def noop_with_uint64( + self, + a: puyapy.arc4.UInt64, + ) -> puyapy.arc4.UInt8: ... + + @puyapy.arc4.abimethod(name='all_the_things', readonly=True, allow_actions=['NoOp', 'OptIn', 'CloseOut', 'UpdateApplication', 'DeleteApplication'], create='allow') + def full_abi_config( + self, + a: puyapy.arc4.UInt64, + ) -> puyapy.arc4.UInt8: ... + + @puyapy.arc4.abimethod(readonly=True, allow_actions=['NoOp', 'CloseOut', 'DeleteApplication']) + def mixed_oca( + self, + a: puyapy.arc4.UInt64, + ) -> puyapy.arc4.UInt8: ... + + @puyapy.arc4.abimethod + def opt_into_asset( + self, + asset: puyapy.Asset, + ) -> None: ... + + @puyapy.arc4.abimethod + def with_transactions( + self, + asset: puyapy.Asset, + an_int: puyapy.arc4.UInt64, + pay: puyapy.gtxn.PaymentTransaction, + another_int: puyapy.arc4.UInt64, + ) -> None: ... + + @puyapy.arc4.abimethod + def compare_assets( + self, + asset_a: puyapy.Asset, + asset_b: puyapy.Asset, + ) -> None: ... + + @puyapy.arc4.abimethod(readonly=True) + def get_address( + self, + ) -> puyapy.arc4.Address: ... + + @puyapy.arc4.abimethod(readonly=True) + def get_asset( + self, + ) -> puyapy.arc4.UInt64: ... + + @puyapy.arc4.abimethod(name='get_application', readonly=True) + def get_app( + self, + ) -> puyapy.arc4.UInt64: ... + + @puyapy.arc4.abimethod(name='get_an_int', readonly=True) + def get_a_int( + self, + ) -> puyapy.arc4.UInt64: ... + + @puyapy.arc4.abimethod(default_args={'asset_from_storage': 'asa', 'asset_from_function': 'get_asset', 'account_from_storage': 'creator', 'account_from_function': 'get_address', 'application_from_storage': 'app', 'application_from_function': 'get_app', 'bytes_from_storage': 'some_bytes', 'int_from_storage': 'an_int', 'int_from_function': 'get_a_int'}) + def method_with_default_args( + self, + asset_from_storage: puyapy.Asset, + asset_from_function: puyapy.Asset, + account_from_storage: puyapy.Account, + account_from_function: puyapy.Account, + application_from_storage: puyapy.Application, + application_from_function: puyapy.Application, + bytes_from_storage: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[3]], + int_from_storage: puyapy.arc4.UInt64, + int_from_function: puyapy.arc4.UInt64, + ) -> None: ... + + @puyapy.arc4.abimethod + def method_with_more_than_15_args( + self, + a: puyapy.arc4.UInt64, + b: puyapy.arc4.UInt64, + c: puyapy.arc4.UInt64, + d: puyapy.arc4.UInt64, + asset: puyapy.Asset, + e: puyapy.arc4.UInt64, + f: puyapy.arc4.UInt64, + pay: puyapy.gtxn.PaymentTransaction, + g: puyapy.arc4.UInt64, + h: puyapy.arc4.UInt64, + i: puyapy.arc4.UInt64, + j: puyapy.arc4.UInt64, + k: puyapy.arc4.UInt64, + l: puyapy.arc4.UInt64, + m: puyapy.arc4.UInt64, + n: puyapy.arc4.UInt64, + o: puyapy.arc4.UInt64, + p: puyapy.arc4.UInt64, + q: puyapy.arc4.UInt64, + r: puyapy.arc4.UInt64, + s: puyapy.arc4.DynamicBytes, + t: puyapy.arc4.DynamicBytes, + asset2: puyapy.Asset, + pay2: puyapy.gtxn.PaymentTransaction, + u: puyapy.arc4.UInt64, + v: puyapy.arc4.UInt64, + ) -> puyapy.arc4.UInt64: ... diff --git a/test_cases/abi_routing/out/contract.awst b/test_cases/abi_routing/out/contract.awst index 25a1baff49..13edf548ef 100644 --- a/test_cases/abi_routing/out/contract.awst +++ b/test_cases/abi_routing/out/contract.awst @@ -3,7 +3,7 @@ contract Reference globals { ['asa']: puyapy.Asset ['an_int']: puyapy.UInt64 - ['some_bytes']: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]] + ['some_bytes']: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[3]] ['creator']: puyapy.Account ['app']: puyapy.Application } @@ -12,28 +12,28 @@ contract Reference { this.asa: puyapy.Asset = reinterpret_cast(123u) this.an_int: puyapy.UInt64 = 2u - this.some_bytes: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]] = arc4_array_encode([7arc4u8, 8arc4u8, 9arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]]) + this.some_bytes: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[3]] = arc4_array_encode([7arc4u8, 8arc4u8, 9arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[3]]) this.creator: puyapy.Account = txn() this.app: puyapy.Application = reinterpret_cast(123u) assert(reinterpret_cast(len(Method("get(uint64,byte[])byte[]"))), comment="has method selector") } - abimethod noop_with_uint64(a: puyapy.arc4.UIntN[typing.Literal[64]]): puyapy.arc4.UIntN[typing.Literal[8]] + abimethod noop_with_uint64(a: puyapy.arc4.UInt64): puyapy.arc4.UInt8 { result: puyapy.UInt64 = 1u + arc4_decode(a, puyapy.UInt64) - return arc4_encode(result, puyapy.arc4.UIntN[typing.Literal[8]]) + return arc4_encode(result, puyapy.arc4.UInt8) } - abimethod[name_override=all_the_things] full_abi_config(a: puyapy.arc4.UIntN[typing.Literal[64]]): puyapy.arc4.UIntN[typing.Literal[8]] + abimethod[name_override=all_the_things] full_abi_config(a: puyapy.arc4.UInt64): puyapy.arc4.UInt8 { result: puyapy.UInt64 = 1u + arc4_decode(a, puyapy.UInt64) - return arc4_encode(result, puyapy.arc4.UIntN[typing.Literal[8]]) + return arc4_encode(result, puyapy.arc4.UInt8) } - abimethod mixed_oca(a: puyapy.arc4.UIntN[typing.Literal[64]]): puyapy.arc4.UIntN[typing.Literal[8]] + abimethod mixed_oca(a: puyapy.arc4.UInt64): puyapy.arc4.UInt8 { result: puyapy.UInt64 = 1u + arc4_decode(a, puyapy.UInt64) - return arc4_encode(result, puyapy.arc4.UIntN[typing.Literal[8]]) + return arc4_encode(result, puyapy.arc4.UInt8) } abimethod bare_abi_config(): None @@ -54,7 +54,7 @@ contract Reference itxn_submit() } - abimethod with_transactions(asset: puyapy.Asset, an_int: puyapy.arc4.UIntN[typing.Literal[64]], pay: puyapy.gtxn.PaymentTransaction, another_int: puyapy.arc4.UIntN[typing.Literal[64]]): None + abimethod with_transactions(asset: puyapy.Asset, an_int: puyapy.arc4.UInt64, pay: puyapy.gtxn.PaymentTransaction, another_int: puyapy.arc4.UInt64): None { assert(this.asa == asset, comment="is correct asset") assert(arc4_decode(an_int, puyapy.UInt64) == 1u, comment="is correct int") @@ -67,27 +67,27 @@ contract Reference assert(asset_a == asset_b, comment="asset a == b") } - abimethod get_address(): puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] + abimethod get_address(): puyapy.arc4.Address { - return reinterpret_cast(reinterpret_cast(global())) + return reinterpret_cast(reinterpret_cast(global())) } - abimethod get_asset(): puyapy.arc4.UIntN[typing.Literal[64]] + abimethod get_asset(): puyapy.arc4.UInt64 { return 456arc4u64 } - abimethod[name_override=get_application] get_app(): puyapy.arc4.UIntN[typing.Literal[64]] + abimethod[name_override=get_application] get_app(): puyapy.arc4.UInt64 { return 456arc4u64 } - abimethod[name_override=get_an_int] get_a_int(): puyapy.arc4.UIntN[typing.Literal[64]] + abimethod[name_override=get_an_int] get_a_int(): puyapy.arc4.UInt64 { return 3arc4u64 } - abimethod method_with_default_args(asset_from_storage: puyapy.Asset, asset_from_function: puyapy.Asset, account_from_storage: puyapy.Account, account_from_function: puyapy.Account, application_from_storage: puyapy.Application, application_from_function: puyapy.Application, bytes_from_storage: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]], int_from_storage: puyapy.arc4.UIntN[typing.Literal[64]], int_from_function: puyapy.arc4.UIntN[typing.Literal[64]]): None + abimethod method_with_default_args(asset_from_storage: puyapy.Asset, asset_from_function: puyapy.Asset, account_from_storage: puyapy.Account, account_from_function: puyapy.Account, application_from_storage: puyapy.Application, application_from_function: puyapy.Application, bytes_from_storage: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[3]], int_from_storage: puyapy.arc4.UInt64, int_from_function: puyapy.arc4.UInt64): None { assert(asset_from_storage == reinterpret_cast(123u), comment="wrong asset from storage") assert(asset_from_function == reinterpret_cast(456u), comment="wrong asset from function") @@ -102,7 +102,7 @@ contract Reference assert(arc4_decode(int_from_function, puyapy.UInt64) == 3u, comment="wrong int from function") } - abimethod method_with_more_than_15_args(a: puyapy.arc4.UIntN[typing.Literal[64]], b: puyapy.arc4.UIntN[typing.Literal[64]], c: puyapy.arc4.UIntN[typing.Literal[64]], d: puyapy.UInt64, asset: puyapy.Asset, e: puyapy.arc4.UIntN[typing.Literal[64]], f: puyapy.arc4.UIntN[typing.Literal[64]], pay: puyapy.gtxn.PaymentTransaction, g: puyapy.arc4.UIntN[typing.Literal[64]], h: puyapy.arc4.UIntN[typing.Literal[64]], i: puyapy.arc4.UIntN[typing.Literal[64]], j: puyapy.arc4.UIntN[typing.Literal[64]], k: puyapy.arc4.UIntN[typing.Literal[64]], l: puyapy.arc4.UIntN[typing.Literal[64]], m: puyapy.arc4.UIntN[typing.Literal[64]], n: puyapy.arc4.UIntN[typing.Literal[64]], o: puyapy.arc4.UIntN[typing.Literal[64]], p: puyapy.UInt64, q: puyapy.arc4.UIntN[typing.Literal[64]], r: puyapy.arc4.UIntN[typing.Literal[64]], s: puyapy.Bytes, t: puyapy.Bytes, asset2: puyapy.Asset, pay2: puyapy.gtxn.PaymentTransaction, u: puyapy.arc4.UIntN[typing.Literal[64]], v: puyapy.arc4.UIntN[typing.Literal[64]]): puyapy.arc4.UIntN[typing.Literal[64]] + abimethod method_with_more_than_15_args(a: puyapy.arc4.UInt64, b: puyapy.arc4.UInt64, c: puyapy.arc4.UInt64, d: puyapy.UInt64, asset: puyapy.Asset, e: puyapy.arc4.UInt64, f: puyapy.arc4.UInt64, pay: puyapy.gtxn.PaymentTransaction, g: puyapy.arc4.UInt64, h: puyapy.arc4.UInt64, i: puyapy.arc4.UInt64, j: puyapy.arc4.UInt64, k: puyapy.arc4.UInt64, l: puyapy.arc4.UInt64, m: puyapy.arc4.UInt64, n: puyapy.arc4.UInt64, o: puyapy.arc4.UInt64, p: puyapy.UInt64, q: puyapy.arc4.UInt64, r: puyapy.arc4.UInt64, s: puyapy.Bytes, t: puyapy.Bytes, asset2: puyapy.Asset, pay2: puyapy.gtxn.PaymentTransaction, u: puyapy.arc4.UInt64, v: puyapy.arc4.UInt64): puyapy.arc4.UInt64 { assert(txn() == 16u) assert(gtxns(pay) == 100000u) @@ -110,6 +110,6 @@ contract Reference assert(reinterpret_cast(reinterpret_cast(asset))) assert(reinterpret_cast(reinterpret_cast(asset2))) log(s + t) - return arc4_encode(arc4_decode(a, puyapy.UInt64) + arc4_decode(b, puyapy.UInt64) + arc4_decode(c, puyapy.UInt64) + d + arc4_decode(e, puyapy.UInt64) + arc4_decode(f, puyapy.UInt64) + arc4_decode(g, puyapy.UInt64) + arc4_decode(h, puyapy.UInt64) + arc4_decode(i, puyapy.UInt64) + arc4_decode(j, puyapy.UInt64) + arc4_decode(k, puyapy.UInt64) + arc4_decode(l, puyapy.UInt64) + arc4_decode(m, puyapy.UInt64) + arc4_decode(n, puyapy.UInt64) + arc4_decode(o, puyapy.UInt64) + p + arc4_decode(q, puyapy.UInt64) + arc4_decode(r, puyapy.UInt64) + arc4_decode(u, puyapy.UInt64) + arc4_decode(v, puyapy.UInt64), puyapy.arc4.UIntN[typing.Literal[64]]) + return arc4_encode(arc4_decode(a, puyapy.UInt64) + arc4_decode(b, puyapy.UInt64) + arc4_decode(c, puyapy.UInt64) + d + arc4_decode(e, puyapy.UInt64) + arc4_decode(f, puyapy.UInt64) + arc4_decode(g, puyapy.UInt64) + arc4_decode(h, puyapy.UInt64) + arc4_decode(i, puyapy.UInt64) + arc4_decode(j, puyapy.UInt64) + arc4_decode(k, puyapy.UInt64) + arc4_decode(l, puyapy.UInt64) + arc4_decode(m, puyapy.UInt64) + arc4_decode(n, puyapy.UInt64) + arc4_decode(o, puyapy.UInt64) + p + arc4_decode(q, puyapy.UInt64) + arc4_decode(r, puyapy.UInt64) + arc4_decode(u, puyapy.UInt64) + arc4_decode(v, puyapy.UInt64), puyapy.arc4.UInt64) } } \ No newline at end of file diff --git a/test_cases/abi_routing/puya.log b/test_cases/abi_routing/puya.log index c7a2504291..21bb0cd635 100644 --- a/test_cases/abi_routing/puya.log +++ b/test_cases/abi_routing/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['abi_routing'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['abi_routing'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1832,4 +1832,5 @@ debug: Inserted __init___block@0.ops[10]: 'store new_state_value%1#0 to l-stack debug: Replaced __init___block@0.ops[13]: 'load new_state_value%1#0' with 'load new_state_value%1#0 from l-stack (no copy)' info: Writing abi_routing/out/Reference.approval.teal info: Writing abi_routing/out/Reference.clear.teal -info: Writing abi_routing/out/Reference.arc32.json \ No newline at end of file +info: Writing abi_routing/out/Reference.arc32.json +info: Writing abi_routing/out/client_Reference.py \ No newline at end of file diff --git a/test_cases/application/contract.py b/test_cases/application/contract.py index d6bd408d91..4cb69397c3 100644 --- a/test_cases/application/contract.py +++ b/test_cases/application/contract.py @@ -39,9 +39,9 @@ def validate_asset(self, app: Application) -> None: assert not Txn.sender.is_opted_in(app), "app opted in" assert app.creator == op.Global.creator_address, "expected creator" assert app.global_num_uint == 1, "expected global_num_uint" - assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" + assert app.global_num_bytes == 2, "expected global_num_bytes" assert app.local_num_uint == 3, "expected local_num_uint" - assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" + assert app.local_num_bytes == 4, "expected local_num_bytes" assert app.approval_program, "expected approval_program" assert app.clear_state_program, "expected clear_state_program" assert app == op.Global.current_application_id, "expected current_application_id" diff --git a/test_cases/application/out/Reference.approval.mir b/test_cases/application/out/Reference.approval.mir index 06403c5d5d..0a607737c0 100644 --- a/test_cases/application/out/Reference.approval.mir +++ b/test_cases/application/out/Reference.approval.mir @@ -87,18 +87,18 @@ validate_asset_block@0: // virtual: store tmp%9#0 to l-stack (no copy) (𝕡) app#0 | tmp%9#0 app.global_num_uint == 1, "expected global_num_uint" application/contract.py:41 // virtual: load tmp%9#0 from l-stack (no copy) (𝕡) app#0 | tmp%9#0 assert app.global_num_uint == 1, "expected global_num_uint" application/contract.py:41 assert // expected global_num_uint // (𝕡) app#0 | assert app.global_num_uint == 1, "expected global_num_uint" application/contract.py:41 - frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app.global_num_byte_slice application/contract.py:42 - app_params_get AppGlobalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.global_num_byte_slice application/contract.py:42 - // virtual: store check%11#0 to l-stack (no copy) (𝕡) app#0 | check%11#0,{app_params_get}.0 app.global_num_byte_slice application/contract.py:42 - // virtual: store value%10#0 to l-stack (no copy) (𝕡) app#0 | value%10#0,check%11#0 app.global_num_byte_slice application/contract.py:42 - // virtual: load check%11#0 from l-stack (no copy) (𝕡) app#0 | value%10#0,check%11#0 app.global_num_byte_slice application/contract.py:42 - assert // application exists // (𝕡) app#0 | value%10#0 app.global_num_byte_slice application/contract.py:42 - // virtual: load value%10#0 from l-stack (no copy) (𝕡) app#0 | value%10#0 app.global_num_byte_slice == 2, "expected global_num_byte_slice" application/contract.py:42 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app.global_num_bytes application/contract.py:42 + app_params_get AppGlobalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.global_num_bytes application/contract.py:42 + // virtual: store check%11#0 to l-stack (no copy) (𝕡) app#0 | check%11#0,{app_params_get}.0 app.global_num_bytes application/contract.py:42 + // virtual: store value%10#0 to l-stack (no copy) (𝕡) app#0 | value%10#0,check%11#0 app.global_num_bytes application/contract.py:42 + // virtual: load check%11#0 from l-stack (no copy) (𝕡) app#0 | value%10#0,check%11#0 app.global_num_bytes application/contract.py:42 + assert // application exists // (𝕡) app#0 | value%10#0 app.global_num_bytes application/contract.py:42 + // virtual: load value%10#0 from l-stack (no copy) (𝕡) app#0 | value%10#0 app.global_num_bytes == 2, "expected global_num_bytes" application/contract.py:42 int 2 // (𝕡) app#0 | value%10#0,2 2 application/contract.py:42 - == // (𝕡) app#0 | {==} app.global_num_byte_slice == 2, "expected global_num_byte_slice" application/contract.py:42 - // virtual: store tmp%12#0 to l-stack (no copy) (𝕡) app#0 | tmp%12#0 app.global_num_byte_slice == 2, "expected global_num_byte_slice" application/contract.py:42 - // virtual: load tmp%12#0 from l-stack (no copy) (𝕡) app#0 | tmp%12#0 assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" application/contract.py:42 - assert // expected global_num_byte_slice // (𝕡) app#0 | assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" application/contract.py:42 + == // (𝕡) app#0 | {==} app.global_num_bytes == 2, "expected global_num_bytes" application/contract.py:42 + // virtual: store tmp%12#0 to l-stack (no copy) (𝕡) app#0 | tmp%12#0 app.global_num_bytes == 2, "expected global_num_bytes" application/contract.py:42 + // virtual: load tmp%12#0 from l-stack (no copy) (𝕡) app#0 | tmp%12#0 assert app.global_num_bytes == 2, "expected global_num_bytes" application/contract.py:42 + assert // expected global_num_bytes // (𝕡) app#0 | assert app.global_num_bytes == 2, "expected global_num_bytes" application/contract.py:42 frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app.local_num_uint application/contract.py:43 app_params_get AppLocalNumUint // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_uint application/contract.py:43 // virtual: store check%14#0 to l-stack (no copy) (𝕡) app#0 | check%14#0,{app_params_get}.0 app.local_num_uint application/contract.py:43 @@ -111,18 +111,18 @@ validate_asset_block@0: // virtual: store tmp%15#0 to l-stack (no copy) (𝕡) app#0 | tmp%15#0 app.local_num_uint == 3, "expected local_num_uint" application/contract.py:43 // virtual: load tmp%15#0 from l-stack (no copy) (𝕡) app#0 | tmp%15#0 assert app.local_num_uint == 3, "expected local_num_uint" application/contract.py:43 assert // expected local_num_uint // (𝕡) app#0 | assert app.local_num_uint == 3, "expected local_num_uint" application/contract.py:43 - frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app.local_num_byte_slice application/contract.py:44 - app_params_get AppLocalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_byte_slice application/contract.py:44 - // virtual: store check%17#0 to l-stack (no copy) (𝕡) app#0 | check%17#0,{app_params_get}.0 app.local_num_byte_slice application/contract.py:44 - // virtual: store value%16#0 to l-stack (no copy) (𝕡) app#0 | value%16#0,check%17#0 app.local_num_byte_slice application/contract.py:44 - // virtual: load check%17#0 from l-stack (no copy) (𝕡) app#0 | value%16#0,check%17#0 app.local_num_byte_slice application/contract.py:44 - assert // application exists // (𝕡) app#0 | value%16#0 app.local_num_byte_slice application/contract.py:44 - // virtual: load value%16#0 from l-stack (no copy) (𝕡) app#0 | value%16#0 app.local_num_byte_slice == 4, "expected local_num_byte_slice" application/contract.py:44 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app.local_num_bytes application/contract.py:44 + app_params_get AppLocalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_bytes application/contract.py:44 + // virtual: store check%17#0 to l-stack (no copy) (𝕡) app#0 | check%17#0,{app_params_get}.0 app.local_num_bytes application/contract.py:44 + // virtual: store value%16#0 to l-stack (no copy) (𝕡) app#0 | value%16#0,check%17#0 app.local_num_bytes application/contract.py:44 + // virtual: load check%17#0 from l-stack (no copy) (𝕡) app#0 | value%16#0,check%17#0 app.local_num_bytes application/contract.py:44 + assert // application exists // (𝕡) app#0 | value%16#0 app.local_num_bytes application/contract.py:44 + // virtual: load value%16#0 from l-stack (no copy) (𝕡) app#0 | value%16#0 app.local_num_bytes == 4, "expected local_num_bytes" application/contract.py:44 int 4 // (𝕡) app#0 | value%16#0,4 4 application/contract.py:44 - == // (𝕡) app#0 | {==} app.local_num_byte_slice == 4, "expected local_num_byte_slice" application/contract.py:44 - // virtual: store tmp%18#0 to l-stack (no copy) (𝕡) app#0 | tmp%18#0 app.local_num_byte_slice == 4, "expected local_num_byte_slice" application/contract.py:44 - // virtual: load tmp%18#0 from l-stack (no copy) (𝕡) app#0 | tmp%18#0 assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" application/contract.py:44 - assert // expected local_num_byte_slice // (𝕡) app#0 | assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" application/contract.py:44 + == // (𝕡) app#0 | {==} app.local_num_bytes == 4, "expected local_num_bytes" application/contract.py:44 + // virtual: store tmp%18#0 to l-stack (no copy) (𝕡) app#0 | tmp%18#0 app.local_num_bytes == 4, "expected local_num_bytes" application/contract.py:44 + // virtual: load tmp%18#0 from l-stack (no copy) (𝕡) app#0 | tmp%18#0 assert app.local_num_bytes == 4, "expected local_num_bytes" application/contract.py:44 + assert // expected local_num_bytes // (𝕡) app#0 | assert app.local_num_bytes == 4, "expected local_num_bytes" application/contract.py:44 frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app.approval_program application/contract.py:45 app_params_get AppApprovalProgram // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.approval_program application/contract.py:45 // virtual: store check%20#0 to l-stack (no copy) (𝕡) app#0 | check%20#0,{app_params_get}.0 app.approval_program application/contract.py:45 diff --git a/test_cases/application/out/Reference.approval.teal b/test_cases/application/out/Reference.approval.teal index 46b6610258..38bab00db2 100644 --- a/test_cases/application/out/Reference.approval.teal +++ b/test_cases/application/out/Reference.approval.teal @@ -60,13 +60,13 @@ validate_asset: == assert // expected global_num_uint // application/contract.py:42 - // assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" + // assert app.global_num_bytes == 2, "expected global_num_bytes" frame_dig -1 app_params_get AppGlobalNumByteSlice assert // application exists int 2 == - assert // expected global_num_byte_slice + assert // expected global_num_bytes // application/contract.py:43 // assert app.local_num_uint == 3, "expected local_num_uint" frame_dig -1 @@ -76,13 +76,13 @@ validate_asset: == assert // expected local_num_uint // application/contract.py:44 - // assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" + // assert app.local_num_bytes == 4, "expected local_num_bytes" frame_dig -1 app_params_get AppLocalNumByteSlice assert // application exists int 4 == - assert // expected local_num_byte_slice + assert // expected local_num_bytes // application/contract.py:45 // assert app.approval_program, "expected approval_program" frame_dig -1 diff --git a/test_cases/application/out/Reference.destructured.ir b/test_cases/application/out/Reference.destructured.ir index 50aae1bf4d..91547b0b95 100644 --- a/test_cases/application/out/Reference.destructured.ir +++ b/test_cases/application/out/Reference.destructured.ir @@ -39,7 +39,7 @@ contract test_cases.application.contract.Reference: let (value%10#0: uint64, check%11#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) (assert check%11#0) // application exists let tmp%12#0: uint64 = (== value%10#0 2u) - (assert tmp%12#0) // expected global_num_byte_slice + (assert tmp%12#0) // expected global_num_bytes let (value%13#0: uint64, check%14#0: uint64) = ((app_params_get AppLocalNumUint) app#0) (assert check%14#0) // application exists let tmp%15#0: uint64 = (== value%13#0 3u) @@ -47,7 +47,7 @@ contract test_cases.application.contract.Reference: let (value%16#0: uint64, check%17#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) (assert check%17#0) // application exists let tmp%18#0: uint64 = (== value%16#0 4u) - (assert tmp%18#0) // expected local_num_byte_slice + (assert tmp%18#0) // expected local_num_bytes let (value%19#0: bytes, check%20#0: uint64) = ((app_params_get AppApprovalProgram) app#0) (assert check%20#0) // application exists let tmp%21#0: uint64 = (len value%19#0) diff --git a/test_cases/application/out/Reference.ssa.ir b/test_cases/application/out/Reference.ssa.ir index 9410d3ae21..e22e627fff 100644 --- a/test_cases/application/out/Reference.ssa.ir +++ b/test_cases/application/out/Reference.ssa.ir @@ -44,7 +44,7 @@ contract test_cases.application.contract.Reference: let (value%10#0: uint64, check%11#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) (assert check%11#0) // application exists let tmp%12#0: uint64 = (== value%10#0 2u) - (assert tmp%12#0) // expected global_num_byte_slice + (assert tmp%12#0) // expected global_num_bytes let (value%13#0: uint64, check%14#0: uint64) = ((app_params_get AppLocalNumUint) app#0) (assert check%14#0) // application exists let tmp%15#0: uint64 = (== value%13#0 3u) @@ -52,7 +52,7 @@ contract test_cases.application.contract.Reference: let (value%16#0: uint64, check%17#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) (assert check%17#0) // application exists let tmp%18#0: uint64 = (== value%16#0 4u) - (assert tmp%18#0) // expected local_num_byte_slice + (assert tmp%18#0) // expected local_num_bytes let (value%19#0: bytes, check%20#0: uint64) = ((app_params_get AppApprovalProgram) app#0) (assert check%20#0) // application exists let tmp%21#0: uint64 = (len value%19#0) diff --git a/test_cases/application/out/Reference.ssa.opt_pass_1.ir b/test_cases/application/out/Reference.ssa.opt_pass_1.ir index 50aae1bf4d..91547b0b95 100644 --- a/test_cases/application/out/Reference.ssa.opt_pass_1.ir +++ b/test_cases/application/out/Reference.ssa.opt_pass_1.ir @@ -39,7 +39,7 @@ contract test_cases.application.contract.Reference: let (value%10#0: uint64, check%11#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) (assert check%11#0) // application exists let tmp%12#0: uint64 = (== value%10#0 2u) - (assert tmp%12#0) // expected global_num_byte_slice + (assert tmp%12#0) // expected global_num_bytes let (value%13#0: uint64, check%14#0: uint64) = ((app_params_get AppLocalNumUint) app#0) (assert check%14#0) // application exists let tmp%15#0: uint64 = (== value%13#0 3u) @@ -47,7 +47,7 @@ contract test_cases.application.contract.Reference: let (value%16#0: uint64, check%17#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) (assert check%17#0) // application exists let tmp%18#0: uint64 = (== value%16#0 4u) - (assert tmp%18#0) // expected local_num_byte_slice + (assert tmp%18#0) // expected local_num_bytes let (value%19#0: bytes, check%20#0: uint64) = ((app_params_get AppApprovalProgram) app#0) (assert check%20#0) // application exists let tmp%21#0: uint64 = (len value%19#0) diff --git a/test_cases/application/out/contract.awst b/test_cases/application/out/contract.awst index 6f5707f45e..f06e022eab 100644 --- a/test_cases/application/out/contract.awst +++ b/test_cases/application/out/contract.awst @@ -44,9 +44,9 @@ contract Reference assert(!(app_opted_in(txn(), app)), comment="app opted in") assert(checked_maybe(app_params_get(app)) == global(), comment="expected creator") assert(checked_maybe(app_params_get(app)) == 1u, comment="expected global_num_uint") - assert(checked_maybe(app_params_get(app)) == 2u, comment="expected global_num_byte_slice") + assert(checked_maybe(app_params_get(app)) == 2u, comment="expected global_num_bytes") assert(checked_maybe(app_params_get(app)) == 3u, comment="expected local_num_uint") - assert(checked_maybe(app_params_get(app)) == 4u, comment="expected local_num_byte_slice") + assert(checked_maybe(app_params_get(app)) == 4u, comment="expected local_num_bytes") assert(reinterpret_cast(len(checked_maybe(app_params_get(app)))), comment="expected approval_program") assert(reinterpret_cast(len(checked_maybe(app_params_get(app)))), comment="expected clear_state_program") assert(app == global(), comment="expected current_application_id") diff --git a/test_cases/application/out_O2/Reference.approval.teal b/test_cases/application/out_O2/Reference.approval.teal index 8320a9289d..735ae20168 100644 --- a/test_cases/application/out_O2/Reference.approval.teal +++ b/test_cases/application/out_O2/Reference.approval.teal @@ -47,7 +47,7 @@ validate_asset: assert // application exists int 2 == - assert // expected global_num_byte_slice + assert // expected global_num_bytes frame_dig -1 app_params_get AppLocalNumUint assert // application exists @@ -59,7 +59,7 @@ validate_asset: assert // application exists int 4 == - assert // expected local_num_byte_slice + assert // expected local_num_bytes frame_dig -1 app_params_get AppApprovalProgram assert // application exists diff --git a/test_cases/application/out_O2/Reference.destructured.ir b/test_cases/application/out_O2/Reference.destructured.ir index 50aae1bf4d..91547b0b95 100644 --- a/test_cases/application/out_O2/Reference.destructured.ir +++ b/test_cases/application/out_O2/Reference.destructured.ir @@ -39,7 +39,7 @@ contract test_cases.application.contract.Reference: let (value%10#0: uint64, check%11#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) (assert check%11#0) // application exists let tmp%12#0: uint64 = (== value%10#0 2u) - (assert tmp%12#0) // expected global_num_byte_slice + (assert tmp%12#0) // expected global_num_bytes let (value%13#0: uint64, check%14#0: uint64) = ((app_params_get AppLocalNumUint) app#0) (assert check%14#0) // application exists let tmp%15#0: uint64 = (== value%13#0 3u) @@ -47,7 +47,7 @@ contract test_cases.application.contract.Reference: let (value%16#0: uint64, check%17#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) (assert check%17#0) // application exists let tmp%18#0: uint64 = (== value%16#0 4u) - (assert tmp%18#0) // expected local_num_byte_slice + (assert tmp%18#0) // expected local_num_bytes let (value%19#0: bytes, check%20#0: uint64) = ((app_params_get AppApprovalProgram) app#0) (assert check%20#0) // application exists let tmp%21#0: uint64 = (len value%19#0) diff --git a/test_cases/application/out_unoptimized/Reference.approval.teal b/test_cases/application/out_unoptimized/Reference.approval.teal index 7c31e45e04..5213a55abc 100644 --- a/test_cases/application/out_unoptimized/Reference.approval.teal +++ b/test_cases/application/out_unoptimized/Reference.approval.teal @@ -68,13 +68,13 @@ validate_asset: == assert // expected global_num_uint // application/contract.py:42 - // assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" + // assert app.global_num_bytes == 2, "expected global_num_bytes" frame_dig -1 app_params_get AppGlobalNumByteSlice assert // application exists int 2 == - assert // expected global_num_byte_slice + assert // expected global_num_bytes // application/contract.py:43 // assert app.local_num_uint == 3, "expected local_num_uint" frame_dig -1 @@ -84,13 +84,13 @@ validate_asset: == assert // expected local_num_uint // application/contract.py:44 - // assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" + // assert app.local_num_bytes == 4, "expected local_num_bytes" frame_dig -1 app_params_get AppLocalNumByteSlice assert // application exists int 4 == - assert // expected local_num_byte_slice + assert // expected local_num_bytes // application/contract.py:45 // assert app.approval_program, "expected approval_program" frame_dig -1 diff --git a/test_cases/application/out_unoptimized/Reference.destructured.ir b/test_cases/application/out_unoptimized/Reference.destructured.ir index 9410d3ae21..e22e627fff 100644 --- a/test_cases/application/out_unoptimized/Reference.destructured.ir +++ b/test_cases/application/out_unoptimized/Reference.destructured.ir @@ -44,7 +44,7 @@ contract test_cases.application.contract.Reference: let (value%10#0: uint64, check%11#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) (assert check%11#0) // application exists let tmp%12#0: uint64 = (== value%10#0 2u) - (assert tmp%12#0) // expected global_num_byte_slice + (assert tmp%12#0) // expected global_num_bytes let (value%13#0: uint64, check%14#0: uint64) = ((app_params_get AppLocalNumUint) app#0) (assert check%14#0) // application exists let tmp%15#0: uint64 = (== value%13#0 3u) @@ -52,7 +52,7 @@ contract test_cases.application.contract.Reference: let (value%16#0: uint64, check%17#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) (assert check%17#0) // application exists let tmp%18#0: uint64 = (== value%16#0 4u) - (assert tmp%18#0) // expected local_num_byte_slice + (assert tmp%18#0) // expected local_num_bytes let (value%19#0: bytes, check%20#0: uint64) = ((app_params_get AppApprovalProgram) app#0) (assert check%20#0) // application exists let tmp%21#0: uint64 = (len value%19#0) diff --git a/test_cases/application/puya.log b/test_cases/application/puya.log index 6d416df5b7..4cd609fa1c 100644 --- a/test_cases/application/puya.log +++ b/test_cases/application/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['application'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['application'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/arc4_numeric_comparisons/out/UIntNOrdering.approval.mir b/test_cases/arc4_numeric_comparisons/out/UIntNOrdering.approval.mir index acdb338c64..ff62f84bf4 100644 --- a/test_cases/arc4_numeric_comparisons/out/UIntNOrdering.approval.mir +++ b/test_cases/arc4_numeric_comparisons/out/UIntNOrdering.approval.mir @@ -4,14 +4,14 @@ // test_cases.arc4_numeric_comparisons.uint_n.UIntNOrdering.approval_program() -> uint64: main_block@0: - byte 0x01 // 0x01 1 arc4_numeric_comparisons/uint_n.py:9 - byte 0x0000000000000002 // 0x01,0x0000000000000002 2 arc4_numeric_comparisons/uint_n.py:9 + byte 0x01 // 0x01 arc4.Byte(1) arc4_numeric_comparisons/uint_n.py:9 + byte 0x0000000000000002 // 0x01,0x0000000000000002 arc4.UInt64(2) arc4_numeric_comparisons/uint_n.py:9 callsub check_both_uint_n // check_both_uint_n(arc4.Byte(1), arc4.UInt64(2)) arc4_numeric_comparisons/uint_n.py:9 - byte 0x01 // 0x01 1 arc4_numeric_comparisons/uint_n.py:10 - byte 0x000000000000000000000000000000000000000000000000000000000000000002 // 0x01,0x000000000000000000000000000000000000000000000000000000000000000002 2 arc4_numeric_comparisons/uint_n.py:10 + byte 0x01 // 0x01 arc4.Byte(1) arc4_numeric_comparisons/uint_n.py:10 + byte 0x000000000000000000000000000000000000000000000000000000000000000002 // 0x01,0x000000000000000000000000000000000000000000000000000000000000000002 arc4.BigUIntN[t.Literal[264]](2) arc4_numeric_comparisons/uint_n.py:10 callsub check_mixed // check_mixed(arc4.Byte(1), arc4.BigUIntN[t.Literal[264]](2)) arc4_numeric_comparisons/uint_n.py:10 - byte 0x0000000000000000000000000000000000000000000000000000000000000001 // 0x0000000000000000000000000000000000000000000000000000000000000001 1 arc4_numeric_comparisons/uint_n.py:11 - byte 0x000000000000000000000000000000000000000000000000000000000000000002 // 0x0000000000000000000000000000000000000000000000000000000000000001,0x000000000000000000000000000000000000000000000000000000000000000002 2 arc4_numeric_comparisons/uint_n.py:11 + byte 0x0000000000000000000000000000000000000000000000000000000000000001 // 0x0000000000000000000000000000000000000000000000000000000000000001 arc4.UInt256(1) arc4_numeric_comparisons/uint_n.py:11 + byte 0x000000000000000000000000000000000000000000000000000000000000000002 // 0x0000000000000000000000000000000000000000000000000000000000000001,0x000000000000000000000000000000000000000000000000000000000000000002 arc4.BigUIntN[t.Literal[264]](2) arc4_numeric_comparisons/uint_n.py:11 callsub check_both_big_uint_n // check_both_big_uint_n(arc4.UInt256(1), arc4.BigUIntN[t.Literal[264]](2)) arc4_numeric_comparisons/uint_n.py:11 int 1 // 1 True arc4_numeric_comparisons/uint_n.py:12 return // return True arc4_numeric_comparisons/uint_n.py:12 diff --git a/test_cases/arc4_numeric_comparisons/out/uint_n.awst b/test_cases/arc4_numeric_comparisons/out/uint_n.awst index b59269f52a..c44a483536 100644 --- a/test_cases/arc4_numeric_comparisons/out/uint_n.awst +++ b/test_cases/arc4_numeric_comparisons/out/uint_n.awst @@ -14,7 +14,7 @@ contract UIntNOrdering } } -subroutine check_both_uint_n(one: puyapy.arc4.UIntN[typing.Literal[8]], two: puyapy.arc4.UIntN[typing.Literal[64]]): None +subroutine check_both_uint_n(one: puyapy.arc4.Byte, two: puyapy.arc4.UInt64): None { one_uint64: puyapy.UInt64 = 1u one_biguint: puyapy.BigUInt = 1n @@ -76,7 +76,7 @@ subroutine check_both_uint_n(one: puyapy.arc4.UIntN[typing.Literal[8]], two: puy assert(!(reinterpret_cast(one) > two_biguint)) } -subroutine check_mixed(one: puyapy.arc4.UIntN[typing.Literal[8]], two: puyapy.arc4.BigUIntN[typing.Literal[264]]): None +subroutine check_mixed(one: puyapy.arc4.Byte, two: puyapy.arc4.BigUIntN[typing.Literal[264]]): None { one_uint64: puyapy.UInt64 = 1u one_biguint: puyapy.BigUInt = 1n @@ -138,7 +138,7 @@ subroutine check_mixed(one: puyapy.arc4.UIntN[typing.Literal[8]], two: puyapy.ar assert(!(reinterpret_cast(one) > two_biguint)) } -subroutine check_both_big_uint_n(one: puyapy.arc4.BigUIntN[typing.Literal[256]], two: puyapy.arc4.BigUIntN[typing.Literal[264]]): None +subroutine check_both_big_uint_n(one: puyapy.arc4.UInt256, two: puyapy.arc4.BigUIntN[typing.Literal[264]]): None { one_uint64: puyapy.UInt64 = 1u one_biguint: puyapy.BigUInt = 1n diff --git a/test_cases/arc4_numeric_comparisons/puya.log b/test_cases/arc4_numeric_comparisons/puya.log index 5e9b9e9048..8ff571de1b 100644 --- a/test_cases/arc4_numeric_comparisons/puya.log +++ b/test_cases/arc4_numeric_comparisons/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['arc4_numeric_comparisons'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['arc4_numeric_comparisons'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/arc4_types/dynamic_bytes.py b/test_cases/arc4_types/dynamic_bytes.py new file mode 100644 index 0000000000..47deafe7bf --- /dev/null +++ b/test_cases/arc4_types/dynamic_bytes.py @@ -0,0 +1,39 @@ +from puyapy import Contract, UInt64 +from puyapy.arc4 import ( + Byte, + DynamicBytes, + UInt8, +) + + +class Arc4DynamicBytesContract(Contract): + def approval_program(self) -> bool: + total = UInt64(0) + dynamic_bytes = DynamicBytes(Byte(2), UInt8(3), 1) + assert dynamic_bytes.decode() == b"\x02\x03\x01" + assert dynamic_bytes.bytes == b"\x00\x03\x02\x03\x01" + + for uint8_item in dynamic_bytes: + total += uint8_item.decode() + + assert total == 6, "Total should be of dynamic_bytes items" + + dynamic_bytes2 = DynamicBytes(b"\x03\x04") + assert dynamic_bytes2.decode() == b"\x03\x04" + assert dynamic_bytes2.bytes == b"\x00\x02\x03\x04" + + for uint8_item in dynamic_bytes2: + total += uint8_item.decode() + + dynamic_bytes3 = DynamicBytes(dynamic_bytes2.decode()) + assert dynamic_bytes3.decode() == b"\x03\x04" + assert dynamic_bytes3.bytes == b"\x00\x02\x03\x04" + + for uint8_item in dynamic_bytes2: + total += uint8_item.decode() + + assert total == 20, "Total should now include sum of dynamic_bytes3 items" + return True + + def clear_state_program(self) -> bool: + return True diff --git a/test_cases/arc4_types/numeric.py b/test_cases/arc4_types/numeric.py index 646516d919..c5282efbb6 100644 --- a/test_cases/arc4_types/numeric.py +++ b/test_cases/arc4_types/numeric.py @@ -43,6 +43,47 @@ def approval_program(self) -> bool: decimals = Decimal("145.6853943940") assert decimals.bytes.length == (64 // 8) + assert decimals.decode() == 145_6853943940 + + decimals_from_truncated_str = Decimal("145.0") + + assert decimals_from_truncated_str.bytes.length == (64 // 8) + assert decimals_from_truncated_str.decode() == 145_0000000000 + + thousand = Decimal("1e3") + + assert thousand.bytes.length == 8 + assert thousand.decode() == 1000_0000000000 + + one_decimal = Decimal("1.0") + + assert one_decimal.bytes.length == (64 // 8) + assert one_decimal.decode() == 1_0000000000 + + zero_decimal = Decimal("0.0") + + assert zero_decimal.bytes.length == (64 // 8) + assert zero_decimal.decode() == 0 + + small_decimal = Decimal("0.00000001") + + assert small_decimal.bytes.length == (64 // 8) + assert small_decimal.decode() == 100 + + smaller_decimal = Decimal("1E-9") + + assert smaller_decimal.bytes.length == (64 // 8) + assert smaller_decimal.decode() == 10 + + smallest_decimal = Decimal("0.0000000001") + + assert smallest_decimal.bytes.length == (64 // 8) + assert smallest_decimal.decode() == 1 + + sixty_four_decimal = Decimal("1844674407.3709551615") + + assert sixty_four_decimal.bytes.length == (64 // 8) + assert sixty_four_decimal.decode() == 1844674407_3709551615 really_big_int = BigUIntN[t.Literal[512]](sixty_four_byte_num) diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.mir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.mir new file mode 100644 index 0000000000..e31d587749 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.mir @@ -0,0 +1,132 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 10 + +// test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: +main: + byte "" + dup // allocate 2 to stack (𝕗) item_index_internal%17#0,item_index_internal%31#0 | + +main_block@0: + int 0 // (𝕗) item_index_internal%17#0,item_index_internal%31#0 | 0 0 arc4_types/dynamic_bytes.py:11 + // virtual: store total#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0 | total = UInt64(0) arc4_types/dynamic_bytes.py:11 + int 0 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0 | 0 + // virtual: store item_index_internal%6#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + // Implicit fall through to main_for_header@1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + +main_for_header@1: + dup // load item_index_internal%6#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0 for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + int 3 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,3 for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + < // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {<} for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + // virtual: store continue_looping%8#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | continue_looping%8#0 for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + // virtual: load continue_looping%8#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | continue_looping%8#0 for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + bz main_after_for@4 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + // Implicit fall through to main_for_body@2 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + +main_for_body@2: + byte 0x020301 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0x020301 dynamic_bytes.decode() arc4_types/dynamic_bytes.py:13 + dig 1 // load item_index_internal%6#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0x020301,item_index_internal%6#0 uint8_item arc4_types/dynamic_bytes.py:16 + dup + cover 2 // store item_index_internal%6#0 to l-stack (copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,0x020301,item_index_internal%6#0 uint8_item arc4_types/dynamic_bytes.py:16 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,0x020301,item_index_internal%6#0,1 for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + extract3 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,{extract3} for uint8_item in dynamic_bytes: arc4_types/dynamic_bytes.py:16 + // virtual: store uint8_item#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,uint8_item#0 uint8_item arc4_types/dynamic_bytes.py:16 + // virtual: load uint8_item#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,uint8_item#0 uint8_item.decode() arc4_types/dynamic_bytes.py:17 + btoi // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,{btoi} uint8_item.decode() arc4_types/dynamic_bytes.py:17 + // virtual: store tmp%10#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,tmp%10#0 uint8_item.decode() arc4_types/dynamic_bytes.py:17 + dig 3 // load total#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,tmp%10#0,total#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:17 + swap // load tmp%10#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,total#0,tmp%10#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:17 + + // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,{+} total += uint8_item.decode() arc4_types/dynamic_bytes.py:17 + bury 3 // store total#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:17 + // virtual: load item_index_internal%6#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%6#0,1 + + // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {+} + bury 1 // store item_index_internal%6#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + b main_for_header@1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + +main_after_for@4: + dig 1 // load total#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | total#0 total == 6, "Total should be of dynamic_bytes items" arc4_types/dynamic_bytes.py:19 + int 6 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | total#0,6 6 arc4_types/dynamic_bytes.py:19 + == // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {==} total == 6, "Total should be of dynamic_bytes items" arc4_types/dynamic_bytes.py:19 + // virtual: store tmp%11#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | tmp%11#0 total == 6, "Total should be of dynamic_bytes items" arc4_types/dynamic_bytes.py:19 + // virtual: load tmp%11#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | tmp%11#0 assert total == 6, "Total should be of dynamic_bytes items" arc4_types/dynamic_bytes.py:19 + assert // Total should be of dynamic_bytes items // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | assert total == 6, "Total should be of dynamic_bytes items" arc4_types/dynamic_bytes.py:19 + int 0 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0 + bury 4 // store item_index_internal%17#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + // Implicit fall through to main_for_header@5 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + +main_for_header@5: + dig 3 // load item_index_internal%17#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + int 2 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,2 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + < // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {<} for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + // virtual: store continue_looping%19#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | continue_looping%19#0 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + // virtual: load continue_looping%19#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | continue_looping%19#0 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + bz main_after_for@8 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + // Implicit fall through to main_for_body@6 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + +main_for_body@6: + byte 0x0304 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0x0304 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + dig 4 // load item_index_internal%17#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0x0304,item_index_internal%17#0 uint8_item arc4_types/dynamic_bytes.py:25 + dup + cover 2 // store item_index_internal%17#0 to l-stack (copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,0x0304,item_index_internal%17#0 uint8_item arc4_types/dynamic_bytes.py:25 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,0x0304,item_index_internal%17#0,1 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + extract3 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,{extract3} for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:25 + // virtual: store uint8_item#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,uint8_item#0 uint8_item arc4_types/dynamic_bytes.py:25 + // virtual: load uint8_item#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,uint8_item#0 uint8_item.decode() arc4_types/dynamic_bytes.py:26 + btoi // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,{btoi} uint8_item.decode() arc4_types/dynamic_bytes.py:26 + // virtual: store tmp%21#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,tmp%21#0 uint8_item.decode() arc4_types/dynamic_bytes.py:26 + dig 3 // load total#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,tmp%21#0,total#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:26 + swap // load tmp%21#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,total#0,tmp%21#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:26 + + // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,{+} total += uint8_item.decode() arc4_types/dynamic_bytes.py:26 + bury 3 // store total#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:26 + // virtual: load item_index_internal%17#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%17#0,1 + + // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {+} + bury 4 // store item_index_internal%17#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + b main_for_header@5 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + +main_after_for@8: + int 0 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0 + bury 3 // store item_index_internal%31#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + // Implicit fall through to main_for_header@9 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + +main_for_header@9: + dig 2 // load item_index_internal%31#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + int 2 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,2 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + < // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {<} for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + // virtual: store continue_looping%33#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | continue_looping%33#0 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + // virtual: load continue_looping%33#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | continue_looping%33#0 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + bz main_after_for@12 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + // Implicit fall through to main_for_body@10 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + +main_for_body@10: + byte 0x0304 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0x0304 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + dig 3 // load item_index_internal%31#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 0x0304,item_index_internal%31#0 uint8_item arc4_types/dynamic_bytes.py:32 + dup + cover 2 // store item_index_internal%31#0 to l-stack (copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,0x0304,item_index_internal%31#0 uint8_item arc4_types/dynamic_bytes.py:32 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,0x0304,item_index_internal%31#0,1 for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + extract3 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,{extract3} for uint8_item in dynamic_bytes2: arc4_types/dynamic_bytes.py:32 + // virtual: store uint8_item#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,uint8_item#0 uint8_item arc4_types/dynamic_bytes.py:32 + // virtual: load uint8_item#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,uint8_item#0 uint8_item.decode() arc4_types/dynamic_bytes.py:33 + btoi // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,{btoi} uint8_item.decode() arc4_types/dynamic_bytes.py:33 + // virtual: store tmp%35#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,tmp%35#0 uint8_item.decode() arc4_types/dynamic_bytes.py:33 + dig 3 // load total#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,tmp%35#0,total#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:33 + swap // load tmp%35#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,total#0,tmp%35#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:33 + + // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,{+} total += uint8_item.decode() arc4_types/dynamic_bytes.py:33 + bury 3 // store total#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0 total += uint8_item.decode() arc4_types/dynamic_bytes.py:33 + // virtual: load item_index_internal%31#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | item_index_internal%31#0,1 + + // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {+} + bury 3 // store item_index_internal%31#0 to f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + b main_for_header@9 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | + +main_after_for@12: + dig 1 // load total#0 from f-stack (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | total#0 total == 20, "Total should now include sum of dynamic_bytes3 items" arc4_types/dynamic_bytes.py:35 + int 20 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | total#0,20 20 arc4_types/dynamic_bytes.py:35 + == // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | {==} total == 20, "Total should now include sum of dynamic_bytes3 items" arc4_types/dynamic_bytes.py:35 + // virtual: store tmp%36#0 to l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | tmp%36#0 total == 20, "Total should now include sum of dynamic_bytes3 items" arc4_types/dynamic_bytes.py:35 + // virtual: load tmp%36#0 from l-stack (no copy) (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | tmp%36#0 assert total == 20, "Total should now include sum of dynamic_bytes3 items" arc4_types/dynamic_bytes.py:35 + assert // Total should now include sum of dynamic_bytes3 items // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | assert total == 20, "Total should now include sum of dynamic_bytes3 items" arc4_types/dynamic_bytes.py:35 + int 1 // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | 1 True arc4_types/dynamic_bytes.py:36 + return // (𝕗) item_index_internal%17#0,item_index_internal%31#0,total#0,item_index_internal%6#0 | return True arc4_types/dynamic_bytes.py:36 + diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.teal b/test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.teal new file mode 100644 index 0000000000..7708cdb392 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.approval.teal @@ -0,0 +1,111 @@ +#pragma version 10 + +test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program: + byte "" + dup + // arc4_types/dynamic_bytes.py:11 + // total = UInt64(0) + int 0 + int 0 + +main_for_header@1: + // arc4_types/dynamic_bytes.py:16 + // for uint8_item in dynamic_bytes: + dup + int 3 + < + bz main_after_for@4 + // arc4_types/dynamic_bytes.py:13 + // assert dynamic_bytes.decode() == b"\x02\x03\x01" + byte 0x020301 + // arc4_types/dynamic_bytes.py:16 + // for uint8_item in dynamic_bytes: + dig 1 + dup + cover 2 + int 1 + extract3 + // arc4_types/dynamic_bytes.py:17 + // total += uint8_item.decode() + btoi + dig 3 + + + bury 3 + int 1 + + + bury 1 + b main_for_header@1 + +main_after_for@4: + // arc4_types/dynamic_bytes.py:19 + // assert total == 6, "Total should be of dynamic_bytes items" + dig 1 + int 6 + == + assert // Total should be of dynamic_bytes items + int 0 + bury 4 + +main_for_header@5: + // arc4_types/dynamic_bytes.py:25 + // for uint8_item in dynamic_bytes2: + dig 3 + int 2 + < + bz main_after_for@8 + byte 0x0304 + dig 4 + dup + cover 2 + int 1 + extract3 + // arc4_types/dynamic_bytes.py:26 + // total += uint8_item.decode() + btoi + dig 3 + + + bury 3 + int 1 + + + bury 4 + b main_for_header@5 + +main_after_for@8: + int 0 + bury 3 + +main_for_header@9: + // arc4_types/dynamic_bytes.py:32 + // for uint8_item in dynamic_bytes2: + dig 2 + int 2 + < + bz main_after_for@12 + byte 0x0304 + dig 3 + dup + cover 2 + int 1 + extract3 + // arc4_types/dynamic_bytes.py:33 + // total += uint8_item.decode() + btoi + dig 3 + + + bury 3 + int 1 + + + bury 3 + b main_for_header@9 + +main_after_for@12: + // arc4_types/dynamic_bytes.py:35 + // assert total == 20, "Total should now include sum of dynamic_bytes3 items" + dig 1 + int 20 + == + assert // Total should now include sum of dynamic_bytes3 items + // arc4_types/dynamic_bytes.py:36 + // return True + int 1 + return diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.mir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.mir new file mode 100644 index 0000000000..796b4d4f10 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.mir @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 10 + +// test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True arc4_types/dynamic_bytes.py:39 + return // return True arc4_types/dynamic_bytes.py:39 + diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.teal b/test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.teal new file mode 100644 index 0000000000..cba04ad698 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 + +test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program: + // arc4_types/dynamic_bytes.py:39 + // return True + int 1 + return diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.destructured.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.destructured.ir new file mode 100644 index 0000000000..d8db7bdd50 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.destructured.ir @@ -0,0 +1,51 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let continue_looping%8#0: uint64 = (< item_index_internal%6#0 3u) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 0x020301 item_index_internal%6#0 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%10#0) + let item_index_internal%6#0: uint64 = (+ item_index_internal%6#0 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#0 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let continue_looping%19#0: uint64 = (< item_index_internal%17#0 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#0: bytes = (extract3 0x0304 item_index_internal%17#0 1u) + let tmp%21#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%21#0) + let item_index_internal%17#0: uint64 = (+ item_index_internal%17#0 1u) + goto block@5 + block@8: // after_for_L25 + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let continue_looping%33#0: uint64 = (< item_index_internal%31#0 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#0: bytes = (extract3 0x0304 item_index_internal%31#0 1u) + let tmp%35#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%35#0) + let item_index_internal%31#0: uint64 = (+ item_index_internal%31#0 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#0 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.ir new file mode 100644 index 0000000000..a0899c227b --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.ir @@ -0,0 +1,101 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let array_data%0#0: bytes = 0x0003 + let array_data%0#1: bytes = (concat array_data%0#0 0x02) + let array_data%0#2: bytes = (concat array_data%0#1 0x03) + let array_data%0#3: bytes = (concat array_data%0#2 0x01) + let dynamic_bytes#0: bytes = array_data%0#3 + let tmp%1#0: bytes = ((extract 2 0) dynamic_bytes#0) + let tmp%2#0: uint64 = (== tmp%1#0 "\x02\x03\x01") + (assert tmp%2#0) + let tmp%3#0: uint64 = (== dynamic_bytes#0 "\x00\x03\x02\x03\x01") + (assert tmp%3#0) + let array_length%4#0: uint64 = (extract_uint16 dynamic_bytes#0 0u) + let array_value%5#0: bytes = ((extract 2 0) dynamic_bytes#0) + let item_index_internal%6#0: uint64 = 0u + let reverse_index_internal%7#0: uint64 = array_length%4#0 + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@3) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@3) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 array_length%4#0) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let item_index%9#0: uint64 = (* item_index_internal%6#1 1u) + let uint8_item#0: bytes = (extract3 array_value%5#0 item_index%9#0 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + goto block@3 + block@3: // for_footer_L16 + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let dynamic_bytes2#0: bytes = 0x00020304 + let tmp%12#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let tmp%13#0: uint64 = (== tmp%12#0 "\x03\x04") + (assert tmp%13#0) + let tmp%14#0: uint64 = (== dynamic_bytes2#0 "\x00\x02\x03\x04") + (assert tmp%14#0) + let array_length%15#0: uint64 = (extract_uint16 dynamic_bytes2#0 0u) + let array_value%16#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let item_index_internal%17#0: uint64 = 0u + let reverse_index_internal%18#0: uint64 = array_length%15#0 + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@7) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@7) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 array_length%15#0) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let item_index%20#0: uint64 = (* item_index_internal%17#1 1u) + let uint8_item#1: bytes = (extract3 array_value%16#0 item_index%20#0 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + goto block@7 + block@7: // for_footer_L25 + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let tmp%22#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let length%23#0: uint64 = (len tmp%22#0) + let value_as_bytes%24#0: bytes = (itob length%23#0) + let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) + let dynamic_bytes3#0: bytes = (concat value_as_uint16%25#0 tmp%22#0) + let tmp%26#0: bytes = ((extract 2 0) dynamic_bytes3#0) + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = (== dynamic_bytes3#0 "\x00\x02\x03\x04") + (assert tmp%28#0) + let array_length%29#0: uint64 = (extract_uint16 dynamic_bytes2#0 0u) + let array_value%30#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let item_index_internal%31#0: uint64 = 0u + let reverse_index_internal%32#0: uint64 = array_length%29#0 + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@11) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@11) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 array_length%29#0) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let item_index%34#0: uint64 = (* item_index_internal%31#1 1u) + let uint8_item#2: bytes = (extract3 array_value%30#0 item_index%34#0 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + goto block@11 + block@11: // for_footer_L32 + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_1.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..cf3ae1aa86 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_1.ir @@ -0,0 +1,85 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let array_data%0#1: bytes = 0x000302 + let array_data%0#2: bytes = (concat array_data%0#1 0x03) + let dynamic_bytes#0: bytes = (concat array_data%0#2 0x01) + let tmp%1#0: bytes = ((extract 2 0) dynamic_bytes#0) + let tmp%2#0: uint64 = (== tmp%1#0 "\x02\x03\x01") + (assert tmp%2#0) + let tmp%3#0: uint64 = (== dynamic_bytes#0 "\x00\x03\x02\x03\x01") + (assert tmp%3#0) + let array_length%4#0: uint64 = (extract_uint16 dynamic_bytes#0 0u) + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 array_length%4#0) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 tmp%1#0 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let tmp%12#0: bytes = 0x0304 + let tmp%13#0: uint64 = (== tmp%12#0 "\x03\x04") + (assert tmp%13#0) + let tmp%14#0: uint64 = 1u + (assert tmp%14#0) + let array_length%15#0: uint64 = 2u + let array_value%16#0: bytes = 0x0304 + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 array_length%15#0) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 array_value%16#0 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let tmp%22#0: bytes = 0x0304 + let length%23#0: uint64 = (len tmp%22#0) + let value_as_bytes%24#0: bytes = (itob length%23#0) + let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) + let dynamic_bytes3#0: bytes = (concat value_as_uint16%25#0 tmp%22#0) + let tmp%26#0: bytes = ((extract 2 0) dynamic_bytes3#0) + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = (== dynamic_bytes3#0 "\x00\x02\x03\x04") + (assert tmp%28#0) + let array_length%29#0: uint64 = 2u + let array_value%30#0: bytes = 0x0304 + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 array_length%29#0) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 array_value%30#0 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_2.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..f5094e3283 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_2.ir @@ -0,0 +1,76 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let array_data%0#2: bytes = 0x00030203 + let dynamic_bytes#0: bytes = (concat array_data%0#2 0x01) + let tmp%1#0: bytes = ((extract 2 0) dynamic_bytes#0) + let tmp%2#0: uint64 = (== tmp%1#0 "\x02\x03\x01") + (assert tmp%2#0) + let tmp%3#0: uint64 = (== dynamic_bytes#0 "\x00\x03\x02\x03\x01") + (assert tmp%3#0) + let array_length%4#0: uint64 = (extract_uint16 dynamic_bytes#0 0u) + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 array_length%4#0) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 tmp%1#0 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let tmp%13#0: uint64 = 1u + (assert tmp%13#0) + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 0x0304 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let length%23#0: uint64 = 2u + let value_as_bytes%24#0: bytes = (itob length%23#0) + let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) + let dynamic_bytes3#0: bytes = (concat value_as_uint16%25#0 0x0304) + let tmp%26#0: bytes = ((extract 2 0) dynamic_bytes3#0) + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = (== dynamic_bytes3#0 "\x00\x02\x03\x04") + (assert tmp%28#0) + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 0x0304 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_3.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..ee649c0f5a --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_3.ir @@ -0,0 +1,71 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let dynamic_bytes#0: bytes = 0x0003020301 + let tmp%1#0: bytes = ((extract 2 0) dynamic_bytes#0) + let tmp%2#0: uint64 = (== tmp%1#0 "\x02\x03\x01") + (assert tmp%2#0) + let tmp%3#0: uint64 = (== dynamic_bytes#0 "\x00\x03\x02\x03\x01") + (assert tmp%3#0) + let array_length%4#0: uint64 = (extract_uint16 dynamic_bytes#0 0u) + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 array_length%4#0) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 tmp%1#0 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 0x0304 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let value_as_uint16%25#0: bytes = 0x0002 + let dynamic_bytes3#0: bytes = (concat value_as_uint16%25#0 0x0304) + let tmp%26#0: bytes = ((extract 2 0) dynamic_bytes3#0) + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = (== dynamic_bytes3#0 "\x00\x02\x03\x04") + (assert tmp%28#0) + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 0x0304 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_4.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..6cac980f4c --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_4.ir @@ -0,0 +1,69 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let tmp%1#0: bytes = 0x020301 + let tmp%2#0: uint64 = (== tmp%1#0 "\x02\x03\x01") + (assert tmp%2#0) + let tmp%3#0: uint64 = 1u + (assert tmp%3#0) + let array_length%4#0: uint64 = 3u + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 array_length%4#0) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 tmp%1#0 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 0x0304 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let dynamic_bytes3#0: bytes = 0x00020304 + let tmp%26#0: bytes = ((extract 2 0) dynamic_bytes3#0) + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = (== dynamic_bytes3#0 "\x00\x02\x03\x04") + (assert tmp%28#0) + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 0x0304 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_5.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..38cca7ead0 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_5.ir @@ -0,0 +1,64 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let tmp%2#0: uint64 = 1u + (assert tmp%2#0) + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 3u) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 0x020301 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 0x0304 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let tmp%26#0: bytes = 0x0304 + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = 1u + (assert tmp%28#0) + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 0x0304 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_6.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..42ea949373 --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_6.ir @@ -0,0 +1,59 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 3u) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 0x020301 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 0x0304 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let tmp%27#0: uint64 = 1u + (assert tmp%27#0) + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 0x0304 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_7.ir b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_7.ir new file mode 100644 index 0000000000..5da1bdecfb --- /dev/null +++ b/test_cases/arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_7.ir @@ -0,0 +1,57 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%8#0: uint64 = (< item_index_internal%6#1 3u) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 0x020301 item_index_internal%6#1 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%10#0) + let item_index_internal%6#2: uint64 = (+ item_index_internal%6#1 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#1 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%19#0: uint64 = (< item_index_internal%17#1 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#1: bytes = (extract3 0x0304 item_index_internal%17#1 1u) + let tmp%21#0: uint64 = (btoi uint8_item#1) + let total#4: uint64 = (+ total#3 tmp%21#0) + let item_index_internal%17#2: uint64 = (+ item_index_internal%17#1 1u) + goto block@5 + block@8: // after_for_L25 + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@10) + let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@10) + let continue_looping%33#0: uint64 = (< item_index_internal%31#1 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#2: bytes = (extract3 0x0304 item_index_internal%31#1 1u) + let tmp%35#0: uint64 = (btoi uint8_item#2) + let total#6: uint64 = (+ total#5 tmp%35#0) + let item_index_internal%31#2: uint64 = (+ item_index_internal%31#1 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#5 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir b/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir index 1ff9af7cbf..effdff74df 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir @@ -15,14 +15,14 @@ mutating_copies: mutating_copies_block@0: byte 0x01020304 // 0x01020304 StaticArray(UInt8(1), UInt8(2), UInt8(3), UInt8(4)) arc4_types/mutable_params.py:35 - byte 0x05 // 0x01020304,0x05 5 arc4_types/mutable_params.py:46 + byte 0x05 // 0x01020304,0x05 UInt8(5) arc4_types/mutable_params.py:46 replace2 2 // {replace2} my_array[2] = UInt8(5) arc4_types/mutable_params.py:46 // virtual: store my_array#1 to l-stack (no copy) my_array#1 my_array[2] = UInt8(5) arc4_types/mutable_params.py:46 dup // load my_array#1 from l-stack (copy) my_array#1,my_array#1 my_array[2] arc4_types/mutable_params.py:49 extract 2 1 // my_array#1,{extract} my_array[2] arc4_types/mutable_params.py:49 // virtual: store tmp%18#0 to l-stack (no copy) my_array#1,tmp%18#0 my_array[2] arc4_types/mutable_params.py:49 // virtual: load tmp%18#0 from l-stack (no copy) my_array#1,tmp%18#0 my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 - byte 0x05 // my_array#1,tmp%18#0,0x05 5 arc4_types/mutable_params.py:49 + byte 0x05 // my_array#1,tmp%18#0,0x05 UInt8(5) arc4_types/mutable_params.py:49 b== // my_array#1,{b==} my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 // virtual: store tmp%19#0 to l-stack (no copy) my_array#1,tmp%19#0 my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 // virtual: load tmp%19#0 from l-stack (no copy) my_array#1,tmp%19#0 assert my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 @@ -45,7 +45,7 @@ mutating_copies_block@0: extract 1 1 // my_struct#1,my_array#1,{extract} my_array[1] arc4_types/mutable_params.py:56 // virtual: store tmp%26#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%26#0 my_array[1] arc4_types/mutable_params.py:56 // virtual: load tmp%26#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%26#0 my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 - byte 0x05 // my_struct#1,my_array#1,tmp%26#0,0x05 5 arc4_types/mutable_params.py:56 + byte 0x05 // my_struct#1,my_array#1,tmp%26#0,0x05 UInt8(5) arc4_types/mutable_params.py:56 b== // my_struct#1,my_array#1,{b==} my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 // virtual: store tmp%27#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%27#0 my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 // virtual: load tmp%27#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%27#0 assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 @@ -88,7 +88,7 @@ mutating_copies_block@0: extract 0 1 // my_array#1,my_array_copy_2#2,{extract} my_array_copy_2[0] arc4_types/mutable_params.py:77 // virtual: store tmp%51#0 to l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%51#0 my_array_copy_2[0] arc4_types/mutable_params.py:77 // virtual: load tmp%51#0 from l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%51#0 my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 - byte 0x01 // my_array#1,my_array_copy_2#2,tmp%51#0,0x01 1 arc4_types/mutable_params.py:77 + byte 0x01 // my_array#1,my_array_copy_2#2,tmp%51#0,0x01 UInt8(1) arc4_types/mutable_params.py:77 b== // my_array#1,my_array_copy_2#2,{b==} my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 // virtual: store tmp%52#0 to l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%52#0 my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 // virtual: load tmp%52#0 from l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%52#0 assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 @@ -101,7 +101,7 @@ mutating_copies_block@0: extract 0 1 // my_array#1,{extract} my_array_copy_2[0] arc4_types/mutable_params.py:80 // virtual: store tmp%56#0 to l-stack (no copy) my_array#1,tmp%56#0 my_array_copy_2[0] arc4_types/mutable_params.py:80 // virtual: load tmp%56#0 from l-stack (no copy) my_array#1,tmp%56#0 my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 - byte 0x0a // my_array#1,tmp%56#0,0x0a 10 arc4_types/mutable_params.py:80 + byte 0x0a // my_array#1,tmp%56#0,0x0a UInt8(10) arc4_types/mutable_params.py:80 b== // my_array#1,{b==} my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 // virtual: store tmp%57#0 to l-stack (no copy) my_array#1,tmp%57#0 my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 // virtual: load tmp%57#0 from l-stack (no copy) my_array#1,tmp%57#0 assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 @@ -122,7 +122,7 @@ other_routine: other_routine_block@0: frame_dig -2 // load array#0 from parameters (𝕡) array#0,struct#0 | array#0 array[1] = UInt8(5) arc4_types/mutable_params.py:94 - byte 0x05 // (𝕡) array#0,struct#0 | array#0,0x05 5 arc4_types/mutable_params.py:94 + byte 0x05 // (𝕡) array#0,struct#0 | array#0,0x05 UInt8(5) arc4_types/mutable_params.py:94 replace2 1 // (𝕡) array#0,struct#0 | {replace2} array[1] = UInt8(5) arc4_types/mutable_params.py:94 frame_bury -2 // store array#0 to parameters (no copy) (𝕡) array#0,struct#0 | array[1] = UInt8(5) arc4_types/mutable_params.py:94 frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 @@ -181,7 +181,7 @@ other_routine_2: other_routine_2_block@0: frame_dig -1 // load array#0 from parameters (𝕡) array#0 | array#0 array[0] = UInt8(10) arc4_types/mutable_params.py:101 - byte 0x0a // (𝕡) array#0 | array#0,0x0a 10 arc4_types/mutable_params.py:101 + byte 0x0a // (𝕡) array#0 | array#0,0x0a UInt8(10) arc4_types/mutable_params.py:101 replace2 0 // (𝕡) array#0 | {replace2} array[0] = UInt8(10) arc4_types/mutable_params.py:101 // virtual: store array#1 to l-stack (no copy) (𝕡) array#0 | array#1 array[0] = UInt8(10) arc4_types/mutable_params.py:101 frame_dig -1 // load array#0 from parameters (𝕡) array#0 | array#1,array#0 return copy arc4_types/mutable_params.py:102 diff --git a/test_cases/arc4_types/out/Arc4MutationContract.approval.mir b/test_cases/arc4_types/out/Arc4MutationContract.approval.mir index 5386208845..f82e26e052 100644 --- a/test_cases/arc4_types/out/Arc4MutationContract.approval.mir +++ b/test_cases/arc4_types/out/Arc4MutationContract.approval.mir @@ -27,7 +27,7 @@ dynamic_array_fixed_size_block@0: swap // store dynamic_uint8_array#4 to l-stack (no copy) dynamic_uint8_array#4,{dynamic_array_pop_fixed_size}.0 dynamic_uint8_array.pop() arc4_types/mutation.py:159 // virtual: store popped#0 to l-stack (no copy) dynamic_uint8_array#4,popped#0 dynamic_uint8_array.pop() arc4_types/mutation.py:159 // virtual: load popped#0 from l-stack (no copy) dynamic_uint8_array#4,popped#0 popped == UInt8(90) arc4_types/mutation.py:160 - byte 0x5a // dynamic_uint8_array#4,popped#0,0x5a 90 arc4_types/mutation.py:160 + byte 0x5a // dynamic_uint8_array#4,popped#0,0x5a UInt8(90) arc4_types/mutation.py:160 b== // dynamic_uint8_array#4,{b==} popped == UInt8(90) arc4_types/mutation.py:160 // virtual: store tmp%30#0 to l-stack (no copy) dynamic_uint8_array#4,tmp%30#0 popped == UInt8(90) arc4_types/mutation.py:160 // virtual: load tmp%30#0 from l-stack (no copy) dynamic_uint8_array#4,tmp%30#0 assert popped == UInt8(90) arc4_types/mutation.py:160 @@ -271,7 +271,7 @@ array_of_array_dynamic_block@0: extract 2 0 // array_of_array#1,{extract} array_of_array[0].append(UInt8(255)) arc4_types/mutation.py:78 // virtual: store expr_value_trimmed%17#0 to l-stack (no copy) array_of_array#1,expr_value_trimmed%17#0 array_of_array[0].append(UInt8(255)) arc4_types/mutation.py:78 // virtual: load expr_value_trimmed%17#0 from l-stack (no copy) array_of_array#1,expr_value_trimmed%17#0 array_of_array[0].append(UInt8(255)) arc4_types/mutation.py:78 - byte 0xff // array_of_array#1,expr_value_trimmed%17#0,0xff 255 arc4_types/mutation.py:78 + byte 0xff // array_of_array#1,expr_value_trimmed%17#0,0xff UInt8(255) arc4_types/mutation.py:78 concat // array_of_array#1,{concat} array_of_array[0].append(UInt8(255)) arc4_types/mutation.py:78 // virtual: store concatenated%19#0 to l-stack (no copy) array_of_array#1,concatenated%19#0 array_of_array[0].append(UInt8(255)) arc4_types/mutation.py:78 dup // load concatenated%19#0 from l-stack (copy) array_of_array#1,concatenated%19#0,concatenated%19#0 array_of_array[0].append(UInt8(255)) arc4_types/mutation.py:78 @@ -339,7 +339,7 @@ array_of_array_dynamic_block@0: // virtual: load index_is_in_bounds%37#0 from l-stack (no copy) array_of_array#1,tmp%34#0,index_is_in_bounds%37#0 array_of_array[0][1] = UInt8(0) arc4_types/mutation.py:82 assert // Index access is out of bounds // array_of_array#1,tmp%34#0 array_of_array[0][1] = UInt8(0) arc4_types/mutation.py:82 // virtual: load tmp%34#0 from l-stack (no copy) array_of_array#1,tmp%34#0 array_of_array[0][1] = UInt8(0) arc4_types/mutation.py:82 - byte 0x00 // array_of_array#1,tmp%34#0,0x00 0 arc4_types/mutation.py:82 + byte 0x00 // array_of_array#1,tmp%34#0,0x00 UInt8(0) arc4_types/mutation.py:82 replace2 3 // array_of_array#1,{replace2} array_of_array[0][1] = UInt8(0) arc4_types/mutation.py:82 // virtual: store updated_target%38#0 to l-stack (no copy) array_of_array#1,updated_target%38#0 array_of_array[0][1] = UInt8(0) arc4_types/mutation.py:82 // virtual: load array_of_array#1 from l-stack (no copy) updated_target%38#0,array_of_array#1 array_of_array[0][1] = UInt8(0) arc4_types/mutation.py:82 @@ -375,7 +375,7 @@ array_of_array_static_block@0: extract 2 2 // array_of_array#1,{extract} array_of_array[1] arc4_types/mutation.py:97 // virtual: store tmp%9#0 to l-stack (no copy) array_of_array#1,tmp%9#0 array_of_array[1] arc4_types/mutation.py:97 // virtual: load tmp%9#0 from l-stack (no copy) array_of_array#1,tmp%9#0 array_of_array[1][0] = UInt8(1) arc4_types/mutation.py:97 - byte 0x01 // array_of_array#1,tmp%9#0,0x01 1 arc4_types/mutation.py:97 + byte 0x01 // array_of_array#1,tmp%9#0,0x01 UInt8(1) arc4_types/mutation.py:97 replace2 0 // array_of_array#1,{replace2} array_of_array[1][0] = UInt8(1) arc4_types/mutation.py:97 // virtual: store updated_target%11#0 to l-stack (no copy) array_of_array#1,updated_target%11#0 array_of_array[1][0] = UInt8(1) arc4_types/mutation.py:97 // virtual: load array_of_array#1 from l-stack (no copy) updated_target%11#0,array_of_array#1 array_of_array[1][0] = UInt8(1) arc4_types/mutation.py:97 @@ -397,7 +397,7 @@ index_assign: index_assign_block@0: byte 0x00020102 // 0x00020102 DynamicArray[UInt8](UInt8(1), UInt8(2)) arc4_types/mutation.py:102 - byte 0xff // 0x00020102,0xff 255 arc4_types/mutation.py:103 + byte 0xff // 0x00020102,0xff UInt8(255) arc4_types/mutation.py:103 replace2 2 // {replace2} dynamic_uint8_array[0] = UInt8(255) arc4_types/mutation.py:103 // virtual: store dynamic_uint8_array#1 to l-stack (no copy) dynamic_uint8_array#1 dynamic_uint8_array[0] = UInt8(255) arc4_types/mutation.py:103 // virtual: load dynamic_uint8_array#1 from l-stack (no copy) dynamic_uint8_array#1 dynamic_uint8_array.bytes == Bytes.from_hex("0002ff02") arc4_types/mutation.py:104 @@ -407,7 +407,7 @@ index_assign_block@0: // virtual: load tmp%5#0 from l-stack (no copy) tmp%5#0 assert dynamic_uint8_array.bytes == Bytes.from_hex("0002ff02") arc4_types/mutation.py:104 assert // assert dynamic_uint8_array.bytes == Bytes.from_hex("0002ff02") arc4_types/mutation.py:104 byte 0x0102 // 0x0102 StaticArray(UInt8(1), UInt8(2)) arc4_types/mutation.py:105 - byte 0xff // 0x0102,0xff 255 arc4_types/mutation.py:106 + byte 0xff // 0x0102,0xff UInt8(255) arc4_types/mutation.py:106 replace2 1 // {replace2} static_uint8_array[1] = UInt8(255) arc4_types/mutation.py:106 // virtual: store static_uint8_array#1 to l-stack (no copy) static_uint8_array#1 static_uint8_array[1] = UInt8(255) arc4_types/mutation.py:106 // virtual: load static_uint8_array#1 from l-stack (no copy) static_uint8_array#1 static_uint8_array.bytes == Bytes.from_hex("01ff") arc4_types/mutation.py:107 @@ -425,7 +425,7 @@ struct_assign: struct_assign_block@0: byte 0x00320006000d00054861707079000444617973 // 0x00320006000d00054861707079000444617973 test_struct.b_val = Bool(False) arc4_types/mutation.py:125 - byte 0x0c // 0x00320006000d00054861707079000444617973,0x0c 12 arc4_types/mutation.py:126 + byte 0x0c // 0x00320006000d00054861707079000444617973,0x0c UInt8(12) arc4_types/mutation.py:126 replace2 1 // {replace2} test_struct.u_val = UInt8(12) arc4_types/mutation.py:126 // virtual: store test_struct#2 to l-stack (no copy) test_struct#2 test_struct.u_val = UInt8(12) arc4_types/mutation.py:126 dup // load test_struct#2 from l-stack (copy) test_struct#2,test_struct#2 test_struct == TestStruct(\nb_val=Bool(False),\nu_val=UInt8(12),\ns_val_1=String("Happy"),\ns_val... arc4_types/mutation.py:127-132 diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.mir b/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.mir index 9b161058c2..83ab5d60d7 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.mir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.mir @@ -4,6 +4,6 @@ // test_cases.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: main_block@0: - int 1 // 1 True arc4_types/numeric.py:66 - return // return True arc4_types/numeric.py:66 + int 1 // 1 True arc4_types/numeric.py:107 + return // return True arc4_types/numeric.py:107 diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.teal b/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.teal index 0dbaaaedf5..bea93fd11f 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.teal +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.approval.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.arc4_types.numeric.Arc4NumericTypesContract.approval_program: - // arc4_types/numeric.py:66 + // arc4_types/numeric.py:107 // return True int 1 return diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.mir b/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.mir index 29e32a3a47..430ab38263 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.mir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.mir @@ -4,6 +4,6 @@ // test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: main_block@0: - int 1 // 1 True arc4_types/numeric.py:69 - return // return True arc4_types/numeric.py:69 + int 1 // 1 True arc4_types/numeric.py:110 + return // return True arc4_types/numeric.py:110 diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.teal b/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.teal index 541d500fea..876cf97b5c 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.teal +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.clear.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program: - // arc4_types/numeric.py:69 + // arc4_types/numeric.py:110 // return True int 1 return diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.destructured.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.destructured.ir index 1f8cd89c66..3a368c1d03 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.destructured.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.destructured.ir @@ -6,5 +6,5 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.ir index f138d07cb8..cc8a69175e 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.ir @@ -58,41 +58,100 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: let tmp%42#0: uint64 = (len decimals#0) let tmp%43#0: uint64 = (== tmp%42#0 8u) (assert tmp%43#0) - let really_big_int#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - let tmp%44#0: uint64 = (len really_big_int#0) - let tmp%45#0: uint64 = (== tmp%44#0 64u) + let tmp%44#0: uint64 = (btoi decimals#0) + let tmp%45#0: uint64 = (== tmp%44#0 1456853943940u) (assert tmp%45#0) - let len_%46#0: uint64 = (len really_big_int#0) - let no_overflow%47#0: uint64 = (<= len_%46#0 64u) - (assert no_overflow%47#0) // overflow - let b_zeros%48#0: bytes = (bzero 64u) - let tmp%49#0: bytes = (b| really_big_int#0 b_zeros%48#0) - let tmp%50#0: uint64 = (b== really_big_int#0 tmp%49#0) - (assert tmp%50#0) - let len_%51#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) - let no_overflow%52#0: uint64 = (<= len_%51#0 64u) - (assert no_overflow%52#0) // overflow - let b_zeros%53#0: bytes = (bzero 64u) - let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%53#0) + let decimals_from_truncated_str#0: bytes = 0x000001519abc2400 + let tmp%46#0: uint64 = (len decimals_from_truncated_str#0) + let tmp%47#0: uint64 = (== tmp%46#0 8u) + (assert tmp%47#0) + let tmp%48#0: uint64 = (btoi decimals_from_truncated_str#0) + let tmp%49#0: uint64 = (== tmp%48#0 1450000000000u) + (assert tmp%49#0) + let thousand#0: bytes = 0x000009184e72a000 + let tmp%50#0: uint64 = (len thousand#0) + let tmp%51#0: uint64 = (== tmp%50#0 8u) + (assert tmp%51#0) + let tmp%52#0: uint64 = (btoi thousand#0) + let tmp%53#0: uint64 = (== tmp%52#0 10000000000000u) + (assert tmp%53#0) + let one_decimal#0: bytes = 0x00000002540be400 + let tmp%54#0: uint64 = (len one_decimal#0) + let tmp%55#0: uint64 = (== tmp%54#0 8u) + (assert tmp%55#0) + let tmp%56#0: uint64 = (btoi one_decimal#0) + let tmp%57#0: uint64 = (== tmp%56#0 10000000000u) + (assert tmp%57#0) + let zero_decimal#0: bytes = 0x0000000000000000 + let tmp%58#0: uint64 = (len zero_decimal#0) + let tmp%59#0: uint64 = (== tmp%58#0 8u) + (assert tmp%59#0) + let tmp%60#0: uint64 = (btoi zero_decimal#0) + let tmp%61#0: uint64 = (== tmp%60#0 0u) + (assert tmp%61#0) + let small_decimal#0: bytes = 0x0000000000000064 + let tmp%62#0: uint64 = (len small_decimal#0) + let tmp%63#0: uint64 = (== tmp%62#0 8u) + (assert tmp%63#0) + let tmp%64#0: uint64 = (btoi small_decimal#0) + let tmp%65#0: uint64 = (== tmp%64#0 100u) + (assert tmp%65#0) + let smaller_decimal#0: bytes = 0x000000000000000a + let tmp%66#0: uint64 = (len smaller_decimal#0) + let tmp%67#0: uint64 = (== tmp%66#0 8u) + (assert tmp%67#0) + let tmp%68#0: uint64 = (btoi smaller_decimal#0) + let tmp%69#0: uint64 = (== tmp%68#0 10u) + (assert tmp%69#0) + let smallest_decimal#0: bytes = 0x0000000000000001 + let tmp%70#0: uint64 = (len smallest_decimal#0) + let tmp%71#0: uint64 = (== tmp%70#0 8u) + (assert tmp%71#0) + let tmp%72#0: uint64 = (btoi smallest_decimal#0) + let tmp%73#0: uint64 = (== tmp%72#0 1u) + (assert tmp%73#0) + let sixty_four_decimal#0: bytes = 0xffffffffffffffff + let tmp%74#0: uint64 = (len sixty_four_decimal#0) + let tmp%75#0: uint64 = (== tmp%74#0 8u) + (assert tmp%75#0) + let tmp%76#0: uint64 = (btoi sixty_four_decimal#0) + let tmp%77#0: uint64 = (== tmp%76#0 18446744073709551615u) + (assert tmp%77#0) + let really_big_int#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + let tmp%78#0: uint64 = (len really_big_int#0) + let tmp%79#0: uint64 = (== tmp%78#0 64u) + (assert tmp%79#0) + let len_%80#0: uint64 = (len really_big_int#0) + let no_overflow%81#0: uint64 = (<= len_%80#0 64u) + (assert no_overflow%81#0) // overflow + let b_zeros%82#0: bytes = (bzero 64u) + let tmp%83#0: bytes = (b| really_big_int#0 b_zeros%82#0) + let tmp%84#0: uint64 = (b== really_big_int#0 tmp%83#0) + (assert tmp%84#0) + let len_%85#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%86#0: uint64 = (<= len_%85#0 64u) + (assert no_overflow%86#0) // overflow + let b_zeros%87#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%87#0) let biguint#0: bytes = 1b let arc4_biguint_const#0: bytes = 0x00000000000000000000000000000001 - let tmp%54#0: bytes = (b+ biguint#0 1b) - let len_%55#0: uint64 = (len tmp%54#0) - let no_overflow%56#0: uint64 = (<= len_%55#0 16u) - (assert no_overflow%56#0) // overflow - let b_zeros%57#0: bytes = (bzero 16u) - let arc4_biguint_dynamic#0: bytes = (b| tmp%54#0 b_zeros%57#0) - let tmp%58#0: uint64 = (b== biguint#0 arc4_biguint_const#0) - (assert tmp%58#0) - let tmp%59#0: uint64 = (len arc4_biguint_dynamic#0) - let tmp%60#0: uint64 = (== tmp%59#0 16u) - (assert tmp%60#0) - let tmp%61#0: uint64 = (len really_big_decimal#0) - let tmp%62#0: uint64 = (== tmp%61#0 64u) - (assert tmp%62#0) + let tmp%88#0: bytes = (b+ biguint#0 1b) + let len_%89#0: uint64 = (len tmp%88#0) + let no_overflow%90#0: uint64 = (<= len_%89#0 16u) + (assert no_overflow%90#0) // overflow + let b_zeros%91#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| tmp%88#0 b_zeros%91#0) + let tmp%92#0: uint64 = (b== biguint#0 arc4_biguint_const#0) + (assert tmp%92#0) + let tmp%93#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%94#0: uint64 = (== tmp%93#0 16u) + (assert tmp%94#0) + let tmp%95#0: uint64 = (len really_big_decimal#0) + let tmp%96#0: uint64 = (== tmp%95#0 64u) + (assert tmp%96#0) return 1u program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_1.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_1.ir index cbe9dbd185..5793f1e84b 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_1.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_1.ir @@ -49,36 +49,87 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: let tmp%42#0: uint64 = 8u let tmp%43#0: uint64 = (== tmp%42#0 8u) (assert tmp%43#0) - let tmp%44#0: uint64 = 64u - let tmp%45#0: uint64 = (== tmp%44#0 64u) + let tmp%44#0: uint64 = 1456853943940u + let tmp%45#0: uint64 = (== tmp%44#0 1456853943940u) (assert tmp%45#0) - let len_%46#0: uint64 = 64u - let no_overflow%47#0: uint64 = (<= len_%46#0 64u) - (assert no_overflow%47#0) // overflow - let tmp%49#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - let tmp%50#0: uint64 = (b== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%49#0) - (assert tmp%50#0) - let len_%51#0: uint64 = 64u - let no_overflow%52#0: uint64 = (<= len_%51#0 64u) - (assert no_overflow%52#0) // overflow + let tmp%46#0: uint64 = 8u + let tmp%47#0: uint64 = (== tmp%46#0 8u) + (assert tmp%47#0) + let tmp%48#0: uint64 = 1450000000000u + let tmp%49#0: uint64 = (== tmp%48#0 1450000000000u) + (assert tmp%49#0) + let tmp%50#0: uint64 = 8u + let tmp%51#0: uint64 = (== tmp%50#0 8u) + (assert tmp%51#0) + let tmp%52#0: uint64 = 10000000000000u + let tmp%53#0: uint64 = (== tmp%52#0 10000000000000u) + (assert tmp%53#0) + let tmp%54#0: uint64 = 8u + let tmp%55#0: uint64 = (== tmp%54#0 8u) + (assert tmp%55#0) + let tmp%56#0: uint64 = 10000000000u + let tmp%57#0: uint64 = (== tmp%56#0 10000000000u) + (assert tmp%57#0) + let tmp%58#0: uint64 = 8u + let tmp%59#0: uint64 = (== tmp%58#0 8u) + (assert tmp%59#0) + let tmp%60#0: uint64 = 0u + let tmp%61#0: uint64 = (! tmp%60#0) + (assert tmp%61#0) + let tmp%62#0: uint64 = 8u + let tmp%63#0: uint64 = (== tmp%62#0 8u) + (assert tmp%63#0) + let tmp%64#0: uint64 = 100u + let tmp%65#0: uint64 = (== tmp%64#0 100u) + (assert tmp%65#0) + let tmp%66#0: uint64 = 8u + let tmp%67#0: uint64 = (== tmp%66#0 8u) + (assert tmp%67#0) + let tmp%68#0: uint64 = 10u + let tmp%69#0: uint64 = (== tmp%68#0 10u) + (assert tmp%69#0) + let tmp%70#0: uint64 = 8u + let tmp%71#0: uint64 = (== tmp%70#0 8u) + (assert tmp%71#0) + let tmp%72#0: uint64 = 1u + let tmp%73#0: uint64 = (== tmp%72#0 1u) + (assert tmp%73#0) + let tmp%74#0: uint64 = 8u + let tmp%75#0: uint64 = (== tmp%74#0 8u) + (assert tmp%75#0) + let tmp%76#0: uint64 = 18446744073709551615u + let tmp%77#0: uint64 = (== tmp%76#0 18446744073709551615u) + (assert tmp%77#0) + let tmp%78#0: uint64 = 64u + let tmp%79#0: uint64 = (== tmp%78#0 64u) + (assert tmp%79#0) + let len_%80#0: uint64 = 64u + let no_overflow%81#0: uint64 = (<= len_%80#0 64u) + (assert no_overflow%81#0) // overflow + let tmp%83#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + let tmp%84#0: uint64 = (b== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%83#0) + (assert tmp%84#0) + let len_%85#0: uint64 = 64u + let no_overflow%86#0: uint64 = (<= len_%85#0 64u) + (assert no_overflow%86#0) // overflow let really_big_decimal#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - let tmp%54#0: bytes = 2b - let len_%55#0: uint64 = (len tmp%54#0) - let no_overflow%56#0: uint64 = (<= len_%55#0 16u) - (assert no_overflow%56#0) // overflow - let b_zeros%57#0: bytes = (bzero 16u) - let arc4_biguint_dynamic#0: bytes = (b| tmp%54#0 b_zeros%57#0) - let tmp%58#0: uint64 = 1u - (assert tmp%58#0) - let tmp%59#0: uint64 = (len arc4_biguint_dynamic#0) - let tmp%60#0: uint64 = (== tmp%59#0 16u) - (assert tmp%60#0) - let tmp%61#0: uint64 = (len really_big_decimal#0) - let tmp%62#0: uint64 = (== tmp%61#0 64u) - (assert tmp%62#0) + let tmp%88#0: bytes = 2b + let len_%89#0: uint64 = (len tmp%88#0) + let no_overflow%90#0: uint64 = (<= len_%89#0 16u) + (assert no_overflow%90#0) // overflow + let b_zeros%91#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| tmp%88#0 b_zeros%91#0) + let tmp%92#0: uint64 = 1u + (assert tmp%92#0) + let tmp%93#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%94#0: uint64 = (== tmp%93#0 16u) + (assert tmp%94#0) + let tmp%95#0: uint64 = (len really_big_decimal#0) + let tmp%96#0: uint64 = (== tmp%95#0 64u) + (assert tmp%96#0) return 1u program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_2.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_2.ir index 874957410b..f12de90692 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_2.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_2.ir @@ -39,25 +39,59 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: (assert tmp%43#0) let tmp%45#0: uint64 = 1u (assert tmp%45#0) - let no_overflow%47#0: uint64 = 1u - (assert no_overflow%47#0) // overflow - let tmp%50#0: uint64 = 1u - (assert tmp%50#0) - let no_overflow%52#0: uint64 = 1u - (assert no_overflow%52#0) // overflow - let len_%55#0: uint64 = 1u - let no_overflow%56#0: uint64 = (<= len_%55#0 16u) - (assert no_overflow%56#0) // overflow + let tmp%47#0: uint64 = 1u + (assert tmp%47#0) + let tmp%49#0: uint64 = 1u + (assert tmp%49#0) + let tmp%51#0: uint64 = 1u + (assert tmp%51#0) + let tmp%53#0: uint64 = 1u + (assert tmp%53#0) + let tmp%55#0: uint64 = 1u + (assert tmp%55#0) + let tmp%57#0: uint64 = 1u + (assert tmp%57#0) + let tmp%59#0: uint64 = 1u + (assert tmp%59#0) + let tmp%61#0: uint64 = 1u + (assert tmp%61#0) + let tmp%63#0: uint64 = 1u + (assert tmp%63#0) + let tmp%65#0: uint64 = 1u + (assert tmp%65#0) + let tmp%67#0: uint64 = 1u + (assert tmp%67#0) + let tmp%69#0: uint64 = 1u + (assert tmp%69#0) + let tmp%71#0: uint64 = 1u + (assert tmp%71#0) + let tmp%73#0: uint64 = 1u + (assert tmp%73#0) + let tmp%75#0: uint64 = 1u + (assert tmp%75#0) + let tmp%77#0: uint64 = 1u + (assert tmp%77#0) + let tmp%79#0: uint64 = 1u + (assert tmp%79#0) + let no_overflow%81#0: uint64 = 1u + (assert no_overflow%81#0) // overflow + let tmp%84#0: uint64 = 1u + (assert tmp%84#0) + let no_overflow%86#0: uint64 = 1u + (assert no_overflow%86#0) // overflow + let len_%89#0: uint64 = 1u + let no_overflow%90#0: uint64 = (<= len_%89#0 16u) + (assert no_overflow%90#0) // overflow let arc4_biguint_dynamic#0: bytes = 0x00000000000000000000000000000002 - let tmp%59#0: uint64 = (len arc4_biguint_dynamic#0) - let tmp%60#0: uint64 = (== tmp%59#0 16u) - (assert tmp%60#0) - let tmp%61#0: uint64 = 64u - let tmp%62#0: uint64 = (== tmp%61#0 64u) - (assert tmp%62#0) + let tmp%93#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%94#0: uint64 = (== tmp%93#0 16u) + (assert tmp%94#0) + let tmp%95#0: uint64 = 64u + let tmp%96#0: uint64 = (== tmp%95#0 64u) + (assert tmp%96#0) return 1u program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_3.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_3.ir index 5cd391691c..58557d7cc6 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_3.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_3.ir @@ -29,16 +29,16 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: let tmp%40#0: uint64 = (btoi tmp%39#0) let tmp%41#0: uint64 = (== tmp%40#0 9223372036854775807u) (assert tmp%41#0) - let no_overflow%56#0: uint64 = 1u - (assert no_overflow%56#0) // overflow - let tmp%59#0: uint64 = 16u - let tmp%60#0: uint64 = (== tmp%59#0 16u) - (assert tmp%60#0) - let tmp%62#0: uint64 = 1u - (assert tmp%62#0) + let no_overflow%90#0: uint64 = 1u + (assert no_overflow%90#0) // overflow + let tmp%93#0: uint64 = 16u + let tmp%94#0: uint64 = (== tmp%93#0 16u) + (assert tmp%94#0) + let tmp%96#0: uint64 = 1u + (assert tmp%96#0) return 1u program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_4.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_4.ir index e746ef294d..a7e818a5da 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_4.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_4.ir @@ -22,11 +22,11 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: let tmp%40#0: uint64 = (btoi tmp%39#0) let tmp%41#0: uint64 = (== tmp%40#0 9223372036854775807u) (assert tmp%41#0) - let tmp%60#0: uint64 = 1u - (assert tmp%60#0) + let tmp%94#0: uint64 = 1u + (assert tmp%94#0) return 1u program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_5.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_5.ir index 0450a3da9e..e0a12c899e 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_5.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_5.ir @@ -21,5 +21,5 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_6.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_6.ir index a143c5ea10..3e8a0858e0 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_6.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_6.ir @@ -16,5 +16,5 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_7.ir b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_7.ir index 1f8cd89c66..3a368c1d03 100644 --- a/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_7.ir +++ b/test_cases/arc4_types/out/Arc4NumericTypesContract.ssa.opt_pass_7.ir @@ -6,5 +6,5 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.ir index f1883f79ae..bbfd676af9 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.ir @@ -59,46 +59,39 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let len_16_bit%41#0: bytes = ((extract 6 0) len_bytes%40#0) let concat_result%42#0: bytes = (concat len_16_bit%41#0 concatenated%38#0) let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let expr_value_trimmed%44#0: bytes = ((extract 2 0) "\x00\x01c") + let expr_value_trimmed%44#0: bytes = ((extract 2 0) "\x00\x02cd") let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 expr_value_trimmed%44#0) let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let expr_value_trimmed%51#0: bytes = ((extract 2 0) "\x00\x01d") + let value#0: bytes = concat_result%49#0 + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let expr_value_trimmed%51#0: bytes = ((extract 2 0) "\x00\x01e") let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 expr_value_trimmed%51#0) let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) let concat_result%56#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let value#0: bytes = concat_result%56#0 - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let expr_value_trimmed%58#0: bytes = ((extract 2 0) "\x00\x01e") + let value#1: bytes = concat_result%56#0 + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let expr_value_trimmed%58#0: bytes = ((extract 2 0) "\x00\x01f") let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 expr_value_trimmed%58#0) let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) let concat_result%63#0: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let value#1: bytes = concat_result%63#0 - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let expr_value_trimmed%65#0: bytes = ((extract 2 0) "\x00\x01f") + let value#2: bytes = concat_result%63#0 + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let expr_value_trimmed%65#0: bytes = ((extract 2 0) "\x00\x01g") let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 expr_value_trimmed%65#0) let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) let concat_result%70#0: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let value#2: bytes = concat_result%70#0 - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let expr_value_trimmed%72#0: bytes = ((extract 2 0) "\x00\x01g") - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 expr_value_trimmed%72#0) - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let concat_result%77#0: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let value#3: bytes = concat_result%77#0 - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = concat_result%70#0 + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_1.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_1.ir index da7239310e..64e51da3b8 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_1.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_1.ir @@ -50,42 +50,35 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let len_16_bit%41#0: bytes = ((extract 6 0) len_bytes%40#0) let concat_result%42#0: bytes = (concat len_16_bit%41#0 concatenated%38#0) let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let expr_value_trimmed%44#0: bytes = "c" + let expr_value_trimmed%44#0: bytes = "cd" let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 expr_value_trimmed%44#0) let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let expr_value_trimmed%51#0: bytes = "d" + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let expr_value_trimmed%51#0: bytes = "e" let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 expr_value_trimmed%51#0) let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let expr_value_trimmed%58#0: bytes = "e" + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let expr_value_trimmed%58#0: bytes = "f" let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 expr_value_trimmed%58#0) let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let expr_value_trimmed%65#0: bytes = "f" + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let expr_value_trimmed%65#0: bytes = "g" let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 expr_value_trimmed%65#0) let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let expr_value_trimmed%72#0: bytes = "g" - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 expr_value_trimmed%72#0) - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_10.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_10.ir index 32b378e63f..f3c89a6edc 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_10.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_10.ir @@ -5,33 +5,27 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let concat_result%26#0: bytes = 0x000c48656c6c6f20576f726c6421 let tmp%27#0: uint64 = (== "\x00\x0cHello World!" concat_result%26#0) (assert tmp%27#0) - let concat_result%49#0: bytes = 0x0003616263 - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = 0x000461626364 + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_11.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_11.ir index 6ad1817f85..86ba0665ce 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_11.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_11.ir @@ -4,32 +4,26 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: block@0: // L8 let tmp%27#0: uint64 = 1u (assert tmp%27#0) - let expr_value_trimmed%50#0: bytes = 0x616263 - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let expr_value_trimmed%50#0: bytes = 0x61626364 + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_12.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_12.ir index e4baecbdc5..2f4c647065 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_12.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_12.ir @@ -2,31 +2,25 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let concatenated%52#0: bytes = 0x61626364 + let concatenated%52#0: bytes = 0x6162636465 let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_13.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_13.ir index f81ddc6308..ff20ed93e2 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_13.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_13.ir @@ -2,30 +2,24 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let len_%53#0: uint64 = 4u + let len_%53#0: uint64 = 5u let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 0x61626364) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 0x6162636465) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_14.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_14.ir index 1ea08fb84f..8460b26777 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_14.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_14.ir @@ -2,28 +2,22 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let len_16_bit%55#0: bytes = 0x0004 - let value#0: bytes = (concat len_16_bit%55#0 0x61626364) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let len_16_bit%55#0: bytes = 0x0005 + let value#1: bytes = (concat len_16_bit%55#0 0x6162636465) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_15.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_15.ir index 653d901ef7..5098c105d7 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_15.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_15.ir @@ -2,27 +2,21 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let value#0: bytes = 0x000461626364 - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = 0x00056162636465 + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_16.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_16.ir index 3081926587..fefb40c40b 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_16.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_16.ir @@ -2,26 +2,20 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let expr_value_trimmed%57#0: bytes = 0x61626364 - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let expr_value_trimmed%57#0: bytes = 0x6162636465 + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_17.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_17.ir index 1330f3e737..712c0c6936 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_17.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_17.ir @@ -2,25 +2,19 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let concatenated%59#0: bytes = 0x6162636465 + let concatenated%59#0: bytes = 0x616263646566 let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_18.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_18.ir index 27503e4a8d..232f28f1ce 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_18.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_18.ir @@ -2,24 +2,18 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let len_%60#0: uint64 = 5u + let len_%60#0: uint64 = 6u let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 0x6162636465) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 0x616263646566) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_19.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_19.ir index 5fda796774..77d455f62c 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_19.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_19.ir @@ -2,22 +2,16 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let len_16_bit%62#0: bytes = 0x0005 - let value#1: bytes = (concat len_16_bit%62#0 0x6162636465) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let len_16_bit%62#0: bytes = 0x0006 + let value#2: bytes = (concat len_16_bit%62#0 0x616263646566) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_2.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_2.ir index 07ab29f9b8..ec6aa8c0c5 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_2.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_2.ir @@ -41,37 +41,31 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let len_16_bit%41#0: bytes = ((extract 6 0) len_bytes%40#0) let concat_result%42#0: bytes = (concat len_16_bit%41#0 concatenated%38#0) let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "c") + let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "cd") let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_20.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_20.ir index 10f59dc218..42e408cb23 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_20.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_20.ir @@ -2,21 +2,15 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let value#1: bytes = 0x00056162636465 - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = 0x0006616263646566 + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_21.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_21.ir index 3bc345ad5c..e727a4af81 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_21.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_21.ir @@ -2,20 +2,14 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let expr_value_trimmed%64#0: bytes = 0x6162636465 - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let expr_value_trimmed%64#0: bytes = 0x616263646566 + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_22.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_22.ir index 8367d84d48..0f1110ae2f 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_22.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_22.ir @@ -2,19 +2,13 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let concatenated%66#0: bytes = 0x616263646566 + let concatenated%66#0: bytes = 0x61626364656667 let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_23.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_23.ir index 1130ef4091..9cc7f9ac72 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_23.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_23.ir @@ -2,18 +2,12 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let len_%67#0: uint64 = 6u + let len_%67#0: uint64 = 7u let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 0x616263646566) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 0x61626364656667) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_24.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_24.ir index 215c489ecf..e5fa6951c3 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_24.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_24.ir @@ -2,16 +2,10 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let len_16_bit%69#0: bytes = 0x0006 - let value#2: bytes = (concat len_16_bit%69#0 0x616263646566) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let len_16_bit%69#0: bytes = 0x0007 + let value#3: bytes = (concat len_16_bit%69#0 0x61626364656667) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_25.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_25.ir index e8189cefd5..ab1138dfc2 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_25.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_25.ir @@ -2,15 +2,9 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let value#2: bytes = 0x0006616263646566 - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = 0x000761626364656667 + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_26.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_26.ir index ae4ae068a7..b46fb59dc2 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_26.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_26.ir @@ -2,14 +2,8 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let expr_value_trimmed%71#0: bytes = 0x616263646566 - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let tmp%71#0: uint64 = 1u + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_27.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_27.ir index f4757a5fe3..48534ea066 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_27.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_27.ir @@ -2,13 +2,6 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: program approval: subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: block@0: // L8 - let concatenated%73#0: bytes = 0x61626364656667 - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_28.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_28.ir deleted file mode 100644 index 072f18b070..0000000000 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_28.ir +++ /dev/null @@ -1,16 +0,0 @@ -contract test_cases.arc4_types.string.Arc4StringTypesContract: - program approval: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: - block@0: // L8 - let len_%74#0: uint64 = 7u - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 0x61626364656667) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) - return 1u - - program clear-state: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: - block@0: // L42 - return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_29.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_29.ir deleted file mode 100644 index 0e7bd71e42..0000000000 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_29.ir +++ /dev/null @@ -1,14 +0,0 @@ -contract test_cases.arc4_types.string.Arc4StringTypesContract: - program approval: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: - block@0: // L8 - let len_16_bit%76#0: bytes = 0x0007 - let value#3: bytes = (concat len_16_bit%76#0 0x61626364656667) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) - return 1u - - program clear-state: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: - block@0: // L42 - return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_3.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_3.ir index 9af50b31c2..9a613a8f8b 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_3.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_3.ir @@ -37,37 +37,31 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let len_16_bit%41#0: bytes = ((extract 6 0) len_bytes%40#0) let concat_result%42#0: bytes = (concat len_16_bit%41#0 "ab") let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "c") + let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "cd") let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_30.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_30.ir deleted file mode 100644 index e535b1ee04..0000000000 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_30.ir +++ /dev/null @@ -1,13 +0,0 @@ -contract test_cases.arc4_types.string.Arc4StringTypesContract: - program approval: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: - block@0: // L8 - let value#3: bytes = 0x000761626364656667 - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) - return 1u - - program clear-state: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: - block@0: // L42 - return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_31.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_31.ir deleted file mode 100644 index 4b21b145a6..0000000000 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_31.ir +++ /dev/null @@ -1,12 +0,0 @@ -contract test_cases.arc4_types.string.Arc4StringTypesContract: - program approval: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: - block@0: // L8 - let tmp%78#0: uint64 = 1u - (assert tmp%78#0) - return 1u - - program clear-state: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: - block@0: // L42 - return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_32.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_32.ir deleted file mode 100644 index 48534ea066..0000000000 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_32.ir +++ /dev/null @@ -1,10 +0,0 @@ -contract test_cases.arc4_types.string.Arc4StringTypesContract: - program approval: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: - block@0: // L8 - return 1u - - program clear-state: - subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: - block@0: // L42 - return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_4.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_4.ir index f971cdc211..38e1238c48 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_4.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_4.ir @@ -30,37 +30,31 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let len_16_bit%41#0: bytes = 0x0002 let concat_result%42#0: bytes = (concat len_16_bit%41#0 "ab") let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "c") + let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "cd") let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_5.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_5.ir index 11d01ccc6c..62c5a48e39 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_5.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_5.ir @@ -23,37 +23,31 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: (assert tmp%35#0) let concat_result%42#0: bytes = 0x00026162 let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "c") + let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "cd") let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_6.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_6.ir index fa8ee63e8b..3cf98cbf18 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_6.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_6.ir @@ -17,37 +17,31 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let tmp%35#0: uint64 = 1u (assert tmp%35#0) let expr_value_trimmed%43#0: bytes = 0x6162 - let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "c") + let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 "cd") let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_7.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_7.ir index 0cea6fdb6a..077d00a56b 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_7.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_7.ir @@ -12,37 +12,31 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let concat_result%26#0: bytes = (concat len_16_bit%25#0 concatenated%22#0) let tmp%27#0: uint64 = (== "\x00\x0cHello World!" concat_result%26#0) (assert tmp%27#0) - let concatenated%45#0: bytes = 0x616263 + let concatenated%45#0: bytes = 0x61626364 let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_8.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_8.ir index 96b4736d3b..969c6504db 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_8.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_8.ir @@ -10,36 +10,30 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let concat_result%26#0: bytes = (concat len_16_bit%25#0 0x48656c6c6f20576f726c6421) let tmp%27#0: uint64 = (== "\x00\x0cHello World!" concat_result%26#0) (assert tmp%27#0) - let len_%46#0: uint64 = 3u + let len_%46#0: uint64 = 4u let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) - let concat_result%49#0: bytes = (concat len_16_bit%48#0 0x616263) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let value#0: bytes = (concat len_16_bit%48#0 0x61626364) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_9.ir b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_9.ir index 07414d9843..a0a2baf259 100644 --- a/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_9.ir +++ b/test_cases/arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_9.ir @@ -6,34 +6,28 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let concat_result%26#0: bytes = (concat len_16_bit%25#0 0x48656c6c6f20576f726c6421) let tmp%27#0: uint64 = (== "\x00\x0cHello World!" concat_result%26#0) (assert tmp%27#0) - let len_16_bit%48#0: bytes = 0x0003 - let concat_result%49#0: bytes = (concat len_16_bit%48#0 0x616263) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "d") + let len_16_bit%48#0: bytes = 0x0004 + let value#0: bytes = (concat len_16_bit%48#0 0x61626364) + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 "e") let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) let len_16_bit%55#0: bytes = ((extract 6 0) len_bytes%54#0) - let value#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) - let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "e") + let value#1: bytes = (concat len_16_bit%55#0 concatenated%52#0) + let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#1) + let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 "f") let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) let len_16_bit%62#0: bytes = ((extract 6 0) len_bytes%61#0) - let value#1: bytes = (concat len_16_bit%62#0 concatenated%59#0) - let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#1) - let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "f") + let value#2: bytes = (concat len_16_bit%62#0 concatenated%59#0) + let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#2) + let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 "g") let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) - let value#2: bytes = (concat len_16_bit%69#0 concatenated%66#0) - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#2) - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 "g") - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let value#3: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#3) - (assert tmp%78#0) + let value#3: bytes = (concat len_16_bit%69#0 concatenated%66#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#3) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/out/array.awst b/test_cases/arc4_types/out/array.awst index 3bb6949a58..5d9264c35a 100644 --- a/test_cases/arc4_types/out/array.awst +++ b/test_cases/arc4_types/out/array.awst @@ -2,13 +2,13 @@ contract Arc4ArraysContract { approval_program(): bool { - dynamic_uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]) + dynamic_uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]) total: puyapy.UInt64 = 0u for uint8_item in dynamic_uint8_array { total += arc4_decode(uint8_item, puyapy.UInt64) } assert(total == 3u, comment="Total should be sum of dynamic_uint8_array items") - aliased_dynamic: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[16]]] = arc4_array_encode([1arc4u16], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[16]]]) + aliased_dynamic: puyapy.arc4.DynamicArray[puyapy.arc4.UInt16] = arc4_array_encode([1arc4u16], puyapy.arc4.DynamicArray[puyapy.arc4.UInt16]) for uint16_item in aliased_dynamic { total += arc4_decode(uint16_item, puyapy.UInt64) } @@ -25,12 +25,12 @@ contract Arc4ArraysContract } } assert(result == 'Hello World') - static_uint32_array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[32]], typing.Literal[4]] = arc4_array_encode([1arc4u32, 10arc4u32, 255arc4u32, 128arc4u32], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[32]], typing.Literal[4]]) + static_uint32_array: puyapy.arc4.StaticArray[puyapy.arc4.UInt32, typing.Literal[4]] = arc4_array_encode([1arc4u32, 10arc4u32, 255arc4u32, 128arc4u32], puyapy.arc4.StaticArray[puyapy.arc4.UInt32, typing.Literal[4]]) for uint32_item in static_uint32_array { total += arc4_decode(uint32_item, puyapy.UInt64) } assert(total == 398u) - aliased_static: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[1]] = arc4_array_encode([101arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[1]]) + aliased_static: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[1]] = arc4_array_encode([101arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[1]]) index: puyapy.UInt64 = 0u assert(arc4_decode(aliased_static[0u], puyapy.UInt64) + arc4_decode(aliased_static[index], puyapy.UInt64) == 202u) static_string_array: puyapy.arc4.StaticArray[puyapy.arc4.String, typing.Literal[2]] = arc4_array_encode([arc4_encode('Ping', puyapy.arc4.String), arc4_encode('Pong', puyapy.arc4.String)], puyapy.arc4.StaticArray[puyapy.arc4.String, typing.Literal[2]]) @@ -52,8 +52,8 @@ contract Arc4ArraysContract return true } - subroutine hash_as_array(commitment_args_concat: puyapy.Bytes): puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] + subroutine hash_as_array(commitment_args_concat: puyapy.Bytes): puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]] { - return reinterpret_cast(sha3_256(commitment_args_concat)) + return reinterpret_cast(sha3_256(commitment_args_concat)) } } \ No newline at end of file diff --git a/test_cases/arc4_types/out/bool_eval.awst b/test_cases/arc4_types/out/bool_eval.awst index 67a2c99210..1ffd2562f8 100644 --- a/test_cases/arc4_types/out/bool_eval.awst +++ b/test_cases/arc4_types/out/bool_eval.awst @@ -1,5 +1,5 @@ struct MyStruct { - x: puyapy.arc4.BigUIntN[typing.Literal[512]] + x: puyapy.arc4.UInt512 } contract Arc4BoolEvalContract @@ -10,8 +10,8 @@ contract Arc4BoolEvalContract assert(reinterpret_cast(arc4_encode(true, puyapy.arc4.Bool)) != hex<"00">) assert(reinterpret_cast(arc4_encode('', puyapy.arc4.String)) == hex<"0000">) assert(reinterpret_cast(arc4_encode('.', puyapy.arc4.String)) != hex<"0000">) - assert(reinterpret_cast(reinterpret_cast(reinterpret_cast(global()))) == global()) - assert(reinterpret_cast(reinterpret_cast(reinterpret_cast(txn()))) != global()) + assert(reinterpret_cast(reinterpret_cast(reinterpret_cast(global()))) == global()) + assert(reinterpret_cast(reinterpret_cast(reinterpret_cast(txn()))) != global()) assert(reinterpret_cast(0arc4u8) == hex<"00">) assert(reinterpret_cast(1arc4u8) != hex<"00">) assert(reinterpret_cast(0arc4u16) == hex<"0000">) @@ -34,7 +34,7 @@ contract Arc4BoolEvalContract assert(true) assert(true) assert(true) - dynamic_arr: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[64]]] = arc4_array_encode([], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[64]]]) + dynamic_arr: puyapy.arc4.DynamicArray[puyapy.arc4.UInt64] = arc4_array_encode([], puyapy.arc4.DynamicArray[puyapy.arc4.UInt64]) assert(reinterpret_cast(dynamic_arr) == hex<"0000">) dynamic_arr.extend((0arc4u64)) assert(reinterpret_cast(dynamic_arr) != hex<"0000">) diff --git a/test_cases/arc4_types/out/client_Arc4DynamicStringArrayContract.py b/test_cases/arc4_types/out/client_Arc4DynamicStringArrayContract.py new file mode 100644 index 0000000000..932da12e42 --- /dev/null +++ b/test_cases/arc4_types/out/client_Arc4DynamicStringArrayContract.py @@ -0,0 +1,18 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Arc4DynamicStringArrayContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def xyz( + self, + ) -> puyapy.arc4.DynamicArray[puyapy.arc4.String]: ... + + @puyapy.arc4.abimethod + def xyz_raw( + self, + ) -> puyapy.arc4.DynamicArray[puyapy.arc4.String]: ... diff --git a/test_cases/arc4_types/out/dynamic_bytes.awst b/test_cases/arc4_types/out/dynamic_bytes.awst new file mode 100644 index 0000000000..5ee1539818 --- /dev/null +++ b/test_cases/arc4_types/out/dynamic_bytes.awst @@ -0,0 +1,33 @@ +contract Arc4DynamicBytesContract +{ + approval_program(): bool + { + total: puyapy.UInt64 = 0u + dynamic_bytes: puyapy.arc4.DynamicBytes = arc4_array_encode([2arc4u8, reinterpret_cast(3arc4u8), 1arc4u8], puyapy.arc4.DynamicBytes) + assert(arc4_decode(dynamic_bytes, puyapy.Bytes) == '\x02\x03\x01') + assert(reinterpret_cast(dynamic_bytes) == '\x00\x03\x02\x03\x01') + for uint8_item in dynamic_bytes { + total += arc4_decode(uint8_item, puyapy.UInt64) + } + assert(total == 6u, comment="Total should be of dynamic_bytes items") + dynamic_bytes2: puyapy.arc4.DynamicBytes = arc4_encode(hex<"0304">, puyapy.arc4.DynamicBytes) + assert(arc4_decode(dynamic_bytes2, puyapy.Bytes) == '\x03\x04') + assert(reinterpret_cast(dynamic_bytes2) == '\x00\x02\x03\x04') + for uint8_item in dynamic_bytes2 { + total += arc4_decode(uint8_item, puyapy.UInt64) + } + dynamic_bytes3: puyapy.arc4.DynamicBytes = arc4_encode(arc4_decode(dynamic_bytes2, puyapy.Bytes), puyapy.arc4.DynamicBytes) + assert(arc4_decode(dynamic_bytes3, puyapy.Bytes) == '\x03\x04') + assert(reinterpret_cast(dynamic_bytes3) == '\x00\x02\x03\x04') + for uint8_item in dynamic_bytes2 { + total += arc4_decode(uint8_item, puyapy.UInt64) + } + assert(total == 20u, comment="Total should now include sum of dynamic_bytes3 items") + return true + } + + clear_state_program(): bool + { + return true + } +} \ No newline at end of file diff --git a/test_cases/arc4_types/out/dynamic_string_array.awst b/test_cases/arc4_types/out/dynamic_string_array.awst index e8dcfe6955..f213e8d1f6 100644 --- a/test_cases/arc4_types/out/dynamic_string_array.awst +++ b/test_cases/arc4_types/out/dynamic_string_array.awst @@ -7,7 +7,7 @@ contract Arc4DynamicStringArrayContract abimethod xyz_raw(): puyapy.arc4.DynamicArray[puyapy.arc4.String] { - raw: puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]] = arc4_array_encode([arc4_array_encode([88arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]), arc4_array_encode([89arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]), arc4_array_encode([90arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]])], puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]]) + raw: puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.Byte]] = arc4_array_encode([arc4_array_encode([88arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.Byte]), arc4_array_encode([89arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.Byte]), arc4_array_encode([90arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.Byte])], puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.Byte]]) return reinterpret_cast(reinterpret_cast(raw)) } } \ No newline at end of file diff --git a/test_cases/arc4_types/out/mutable_params.awst b/test_cases/arc4_types/out/mutable_params.awst index 8909bd472c..3b221a0ccc 100644 --- a/test_cases/arc4_types/out/mutable_params.awst +++ b/test_cases/arc4_types/out/mutable_params.awst @@ -1,12 +1,12 @@ struct TestStruct { b_val: puyapy.arc4.Bool - u_val: puyapy.arc4.UIntN[typing.Literal[8]] + u_val: puyapy.arc4.UInt8 s_val_1: puyapy.arc4.String s_val_2: puyapy.arc4.String } struct StructWithArray { - test_array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] + test_array: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] } contract Arc4MutableParamsContract @@ -24,11 +24,11 @@ contract Arc4MutableParamsContract subroutine mutating_copies(): None { - my_array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] = arc4_array_encode([1arc4u8, 2arc4u8, 3arc4u8, 4arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]]) + my_array: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] = arc4_array_encode([1arc4u8, 2arc4u8, 3arc4u8, 4arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]]) my_struct: test_cases.arc4_types.mutable_params.TestStruct = arc4_encode((arc4_encode(true, puyapy.arc4.Bool), 50arc4u8, arc4_encode('Happy', puyapy.arc4.String), arc4_encode('Days', puyapy.arc4.String)), test_cases.arc4_types.mutable_params.TestStruct) - my_array_copy: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] = my_array.copy() + my_array_copy: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] = my_array.copy() my_struct_copy: test_cases.arc4_types.mutable_params.TestStruct = my_struct.copy() - my_array[2u]: puyapy.arc4.UIntN[typing.Literal[8]] = 5arc4u8 + my_array[2u]: puyapy.arc4.UInt8 = 5arc4u8 assert(reinterpret_cast(my_array_copy[2u]) == reinterpret_cast(3arc4u8), comment="my_array_copy should be unchanged") assert(reinterpret_cast(my_array[2u]) == reinterpret_cast(5arc4u8), comment="my_array should be mutated") (t, f): tuple[bool, bool] = this::other_routine(my_array, my_struct) @@ -39,8 +39,8 @@ contract Arc4MutableParamsContract this::other_routine(my_array_copy.copy(), my_struct_copy.copy()) assert(reinterpret_cast(my_array_copy[1u]) == reinterpret_cast(2arc4u8), comment="my_array_copy should not be mutated by the subroutine") assert(reinterpret_cast(my_struct_copy[2u]) == reinterpret_cast(arc4_encode('Happy', puyapy.arc4.String)), comment="my_struct_copy should not be mutated by the subroutine") - my_array_copy_2: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] = my_array_copy.copy() - my_array_copy_2: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] = this::other_routine_2(my_array_copy_2) + my_array_copy_2: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] = my_array_copy.copy() + my_array_copy_2: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] = this::other_routine_2(my_array_copy_2) assert(reinterpret_cast(my_array_copy_2[0u]) == reinterpret_cast(1arc4u8), comment="my_array_copy_2 should have original value") this::other_routine_2(my_array_copy_2) assert(reinterpret_cast(my_array_copy_2[0u]) == reinterpret_cast(10arc4u8), comment="my_array_copy_2 should have mutated value") @@ -48,31 +48,31 @@ contract Arc4MutableParamsContract this::other_routine_2(nested[0u].copy()) } - subroutine other_routine(array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], struct: test_cases.arc4_types.mutable_params.TestStruct): tuple[bool, bool] + subroutine other_routine(array: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]], struct: test_cases.arc4_types.mutable_params.TestStruct): tuple[bool, bool] { - array[1u]: puyapy.arc4.UIntN[typing.Literal[8]] = 5arc4u8 + array[1u]: puyapy.arc4.UInt8 = 5arc4u8 struct[2u]: puyapy.arc4.String = arc4_encode('AARRGH!', puyapy.arc4.String) return (true, false) } - subroutine other_routine_2(array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]]): puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] + subroutine other_routine_2(array: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]]): puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] { - copy: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] = array.copy() - array[0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 10arc4u8 + copy: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] = array.copy() + array[0u]: puyapy.arc4.UInt8 = 10arc4u8 return copy } - subroutine other_routine_3(arrays: tuple[puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]]]): None + subroutine other_routine_3(arrays: tuple[puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]]]): None { for array in arrays { - array[0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 + array[0u]: puyapy.arc4.UInt8 = 99arc4u8 } - arrays[0][0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 - arrays[1][0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 - arrays[2][0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 - (one, two, three): tuple[puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]]] = arrays - one[0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 - two[0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 - three[0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 99arc4u8 + arrays[0][0u]: puyapy.arc4.UInt8 = 99arc4u8 + arrays[1][0u]: puyapy.arc4.UInt8 = 99arc4u8 + arrays[2][0u]: puyapy.arc4.UInt8 = 99arc4u8 + (one, two, three): tuple[puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]]] = arrays + one[0u]: puyapy.arc4.UInt8 = 99arc4u8 + two[0u]: puyapy.arc4.UInt8 = 99arc4u8 + three[0u]: puyapy.arc4.UInt8 = 99arc4u8 } } \ No newline at end of file diff --git a/test_cases/arc4_types/out/mutation.awst b/test_cases/arc4_types/out/mutation.awst index 527e81d942..67eb6e9664 100644 --- a/test_cases/arc4_types/out/mutation.awst +++ b/test_cases/arc4_types/out/mutation.awst @@ -1,6 +1,6 @@ struct TestStruct { b_val: puyapy.arc4.Bool - u_val: puyapy.arc4.UIntN[typing.Literal[8]] + u_val: puyapy.arc4.UInt8 s_val_1: puyapy.arc4.String s_val_2: puyapy.arc4.String } @@ -39,11 +39,11 @@ contract Arc4MutationContract subroutine array_concat(): None { - uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]) - array_concat_tuple: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] = uint8_array + (3arc4u8, 4arc4u8) - assert(reinterpret_cast(array_concat_tuple) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 3arc4u8, 4arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]) + array_concat_tuple: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] = uint8_array + (3arc4u8, 4arc4u8) + assert(reinterpret_cast(array_concat_tuple) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 3arc4u8, 4arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) array_concat_tuple.extend((5arc4u8)) - assert(reinterpret_cast(array_concat_tuple) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 3arc4u8, 4arc4u8, 5arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + assert(reinterpret_cast(array_concat_tuple) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 3arc4u8, 4arc4u8, 5arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) hello_world: puyapy.arc4.DynamicArray[puyapy.arc4.String] = arc4_array_encode([arc4_encode('Hello', puyapy.arc4.String), arc4_encode('World', puyapy.arc4.String)], puyapy.arc4.DynamicArray[puyapy.arc4.String]) hello_world_concat: puyapy.arc4.DynamicArray[puyapy.arc4.String] = arc4_array_encode([arc4_encode('Hello', puyapy.arc4.String)], puyapy.arc4.DynamicArray[puyapy.arc4.String]) + arc4_array_encode([arc4_encode('World', puyapy.arc4.String)], puyapy.arc4.DynamicArray[puyapy.arc4.String]) assert(reinterpret_cast(hello_world) == reinterpret_cast(hello_world_concat)) @@ -51,35 +51,35 @@ contract Arc4MutationContract subroutine array_of_array_dynamic(): None { - array_of_array: puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]] = arc4_array_encode([], puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]]) + array_of_array: puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]] = arc4_array_encode([], puyapy.arc4.DynamicArray[puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]]) assert(reinterpret_cast(array_of_array) == hex<"0000">) - array_of_array.extend((arc4_array_encode([10arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + array_of_array.extend((arc4_array_encode([10arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) assert(reinterpret_cast(array_of_array) == hex<"0001000200010A">) - array_of_array.extend((arc4_array_encode([16arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + array_of_array.extend((arc4_array_encode([16arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) assert(reinterpret_cast(array_of_array) == hex<"00020004000700010A000110">) array_of_array[0u].extend((255arc4u8)) assert(reinterpret_cast(array_of_array) == hex<"00020004000800020AFF000110">) - array_of_array[0u][1u]: puyapy.arc4.UIntN[typing.Literal[8]] = 0arc4u8 + array_of_array[0u][1u]: puyapy.arc4.UInt8 = 0arc4u8 assert(reinterpret_cast(array_of_array) == hex<"00020004000800020A00000110">) } subroutine array_of_array_static(): None { - array_of_array: puyapy.arc4.StaticArray[puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]], typing.Literal[2]] = arc4_array_encode([arc4_array_encode([10arc4u8, 9arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]]), arc4_array_encode([64arc4u8, 128arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]])], puyapy.arc4.StaticArray[puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]], typing.Literal[2]]) + array_of_array: puyapy.arc4.StaticArray[puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]], typing.Literal[2]] = arc4_array_encode([arc4_array_encode([10arc4u8, 9arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]]), arc4_array_encode([64arc4u8, 128arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]])], puyapy.arc4.StaticArray[puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]], typing.Literal[2]]) assert(reinterpret_cast(array_of_array) == hex<"0A094080">) - array_of_array[0u]: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]] = arc4_array_encode([255arc4u8, 254arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]]) + array_of_array[0u]: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]] = arc4_array_encode([255arc4u8, 254arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]]) assert(reinterpret_cast(array_of_array) == hex<"FFFE4080">) - array_of_array[1u][0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 1arc4u8 + array_of_array[1u][0u]: puyapy.arc4.UInt8 = 1arc4u8 assert(reinterpret_cast(array_of_array) == hex<"FFFE0180">) } subroutine index_assign(): None { - dynamic_uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]) - dynamic_uint8_array[0u]: puyapy.arc4.UIntN[typing.Literal[8]] = 255arc4u8 + dynamic_uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]) + dynamic_uint8_array[0u]: puyapy.arc4.UInt8 = 255arc4u8 assert(reinterpret_cast(dynamic_uint8_array) == hex<"0002FF02">) - static_uint8_array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[2]]) - static_uint8_array[1u]: puyapy.arc4.UIntN[typing.Literal[8]] = 255arc4u8 + static_uint8_array: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[2]]) + static_uint8_array[1u]: puyapy.arc4.UInt8 = 255arc4u8 assert(reinterpret_cast(static_uint8_array) == hex<"01FF">) dynamic_bool_array: puyapy.arc4.DynamicArray[puyapy.arc4.Bool] = arc4_array_encode([arc4_encode(true, puyapy.arc4.Bool), arc4_encode(false, puyapy.arc4.Bool)], puyapy.arc4.DynamicArray[puyapy.arc4.Bool]) dynamic_bool_array[0u]: puyapy.arc4.Bool = arc4_encode(false, puyapy.arc4.Bool) @@ -93,7 +93,7 @@ contract Arc4MutationContract { test_struct: test_cases.arc4_types.mutation.TestStruct = arc4_encode((arc4_encode(true, puyapy.arc4.Bool), 50arc4u8, arc4_encode('Happy', puyapy.arc4.String), arc4_encode('Days', puyapy.arc4.String)), test_cases.arc4_types.mutation.TestStruct) test_struct[0u]: puyapy.arc4.Bool = arc4_encode(false, puyapy.arc4.Bool) - test_struct[1u]: puyapy.arc4.UIntN[typing.Literal[8]] = 12arc4u8 + test_struct[1u]: puyapy.arc4.UInt8 = 12arc4u8 assert(reinterpret_cast(test_struct) == reinterpret_cast(arc4_encode((arc4_encode(false, puyapy.arc4.Bool), 12arc4u8, arc4_encode('Happy', puyapy.arc4.String), arc4_encode('Days', puyapy.arc4.String)), test_cases.arc4_types.mutation.TestStruct))) test_struct[2u]: puyapy.arc4.String = arc4_encode('Hmmmm', puyapy.arc4.String) test_struct[3u]: puyapy.arc4.String = arc4_encode('Oh well', puyapy.arc4.String) @@ -102,16 +102,16 @@ contract Arc4MutationContract subroutine dynamic_array_fixed_size(): None { - dynamic_uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]) + dynamic_uint8_array: puyapy.arc4.DynamicArray[puyapy.arc4.UInt8] = arc4_array_encode([1arc4u8, 2arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]) dynamic_uint8_array.extend((50arc4u8)) - assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) dynamic_uint8_array.extend(dynamic_uint8_array) - assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8, 1arc4u8, 2arc4u8, 50arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8, 1arc4u8, 2arc4u8, 50arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) dynamic_uint8_array.extend((4arc4u8, 90arc4u8)) - assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8, 1arc4u8, 2arc4u8, 50arc4u8, 4arc4u8, 90arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) - popped: puyapy.arc4.UIntN[typing.Literal[8]] = dynamic_uint8_array.pop() + assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8, 1arc4u8, 2arc4u8, 50arc4u8, 4arc4u8, 90arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) + popped: puyapy.arc4.UInt8 = dynamic_uint8_array.pop() assert(reinterpret_cast(popped) == reinterpret_cast(90arc4u8)) - assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8, 1arc4u8, 2arc4u8, 50arc4u8, 4arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UIntN[typing.Literal[8]]]))) + assert(reinterpret_cast(dynamic_uint8_array) == reinterpret_cast(arc4_array_encode([1arc4u8, 2arc4u8, 50arc4u8, 1arc4u8, 2arc4u8, 50arc4u8, 4arc4u8], puyapy.arc4.DynamicArray[puyapy.arc4.UInt8]))) } subroutine dynamic_array_bool(): None diff --git a/test_cases/arc4_types/out/numeric.O0.log b/test_cases/arc4_types/out/numeric.O0.log index fe6517e93e..bebd65cbd8 100644 --- a/test_cases/arc4_types/out/numeric.O0.log +++ b/test_cases/arc4_types/out/numeric.O0.log @@ -114,63 +114,148 @@ PC Teal 247 == 1 248 assert 249 byte 0x0000015333430684 0x0000015333430684 -259 len 8 -260 int 8 8, 8 -261 == 1 -262 assert -263 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -264 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -265 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 -266 int 64 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64, 64 -267 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 -268 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -269 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -270 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 -271 int 64 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64, 64 -272 <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 -273 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -274 int 64 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 -275 bzero 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -276 dig 1 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -278 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -279 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -280 b== 1 -281 assert -282 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -283 len 64 -284 int 64 64, 64 -285 <= 1 -286 assert -287 int 64 64 -288 bzero 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -289 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -290 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -291 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -292 byte 0x01 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x01 -293 byte 0x00000000000000000000000000000001 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x01, 0x00000000000000000000000000000001 -311 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01 -312 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x01 -313 byte 0x01 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x01, 0x01 -314 b+ 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02 -315 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 0x02 -316 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1 -317 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1, 16 -319 <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1 -320 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02 -321 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 16 -323 bzero 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 0x00000000000000000000000000000000 -324 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x00000000000000000000000000000002 -325 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x00000000000000000000000000000002, 0x01 -326 uncover 2 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01, 0x00000000000000000000000000000001 -328 b== 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 1 -329 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 -330 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 -331 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16, 16 -333 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 -334 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -335 len 64 -336 int 64 64, 64 -337 == 1 -338 assert -339 int 1 1 -340 return 1 \ No newline at end of file +259 dup 0x0000015333430684, 0x0000015333430684 +260 len 0x0000015333430684, 8 +261 int 8 0x0000015333430684, 8, 8 +262 == 0x0000015333430684, 1 +263 assert 0x0000015333430684 +264 btoi 1456853943940 +265 int 1456853943940 1456853943940, 1456853943940 +272 == 1 +273 assert +274 byte 0x000001519abc2400 0x000001519ABC2400 +284 dup 0x000001519ABC2400, 0x000001519ABC2400 +285 len 0x000001519ABC2400, 8 +286 int 8 0x000001519ABC2400, 8, 8 +287 == 0x000001519ABC2400, 1 +288 assert 0x000001519ABC2400 +289 btoi 1450000000000 +290 int 1450000000000 1450000000000, 1450000000000 +297 == 1 +298 assert +299 byte 0x000009184e72a000 0x000009184E72A000 +309 dup 0x000009184E72A000, 0x000009184E72A000 +310 len 0x000009184E72A000, 8 +311 int 8 0x000009184E72A000, 8, 8 +312 == 0x000009184E72A000, 1 +313 assert 0x000009184E72A000 +314 btoi 10000000000000 +315 int 10000000000000 10000000000000, 10000000000000 +323 == 1 +324 assert +325 byte 0x00000002540be400 0x00000002540BE400 +335 dup 0x00000002540BE400, 0x00000002540BE400 +336 len 0x00000002540BE400, 8 +337 int 8 0x00000002540BE400, 8, 8 +338 == 0x00000002540BE400, 1 +339 assert 0x00000002540BE400 +340 btoi 10000000000 +341 int 10000000000 10000000000, 10000000000 +347 == 1 +348 assert +349 byte 0x0000000000000000 0x0000000000000000 +359 dup 0x0000000000000000, 0x0000000000000000 +360 len 0x0000000000000000, 8 +361 int 8 0x0000000000000000, 8, 8 +362 == 0x0000000000000000, 1 +363 assert 0x0000000000000000 +364 btoi 0 +365 int 0 0, 0 +366 == 1 +367 assert +368 byte 0x0000000000000064 0x0000000000000064 +378 dup 0x0000000000000064, 0x0000000000000064 +379 len 0x0000000000000064, 8 +380 int 8 0x0000000000000064, 8, 8 +381 == 0x0000000000000064, 1 +382 assert 0x0000000000000064 +383 btoi 100 +384 int 100 100, 100 +386 == 1 +387 assert +388 byte 0x000000000000000a 0x000000000000000A +398 dup 0x000000000000000A, 0x000000000000000A +399 len 0x000000000000000A, 8 +400 int 8 0x000000000000000A, 8, 8 +401 == 0x000000000000000A, 1 +402 assert 0x000000000000000A +403 btoi 10 +404 int 10 10, 10 +406 == 1 +407 assert +408 byte 0x0000000000000001 0x0000000000000001 +418 dup 0x0000000000000001, 0x0000000000000001 +419 len 0x0000000000000001, 8 +420 int 8 0x0000000000000001, 8, 8 +421 == 0x0000000000000001, 1 +422 assert 0x0000000000000001 +423 btoi 1 +424 int 1 1, 1 +425 == 1 +426 assert +427 byte 0xffffffffffffffff 0xFFFFFFFFFFFFFFFF +437 dup 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF +438 len 0xFFFFFFFFFFFFFFFF, 8 +439 int 8 0xFFFFFFFFFFFFFFFF, 8, 8 +440 == 0xFFFFFFFFFFFFFFFF, 1 +441 assert 0xFFFFFFFFFFFFFFFF +442 btoi 18446744073709551615 +443 int 18446744073709551615 18446744073709551615, 18446744073709551615 +454 == 1 +455 assert +456 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +457 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +458 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 +459 int 64 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64, 64 +460 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +461 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +462 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +463 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 +464 int 64 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64, 64 +465 <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +466 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +467 int 64 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 +468 bzero 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +469 dig 1 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +471 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +472 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +473 b== 1 +474 assert +475 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +476 len 64 +477 int 64 64, 64 +478 <= 1 +479 assert +480 int 64 64 +481 bzero 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +482 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +483 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +484 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +485 byte 0x01 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x01 +486 byte 0x00000000000000000000000000000001 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x01, 0x00000000000000000000000000000001 +504 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01 +505 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x01 +506 byte 0x01 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x01, 0x01 +507 b+ 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02 +508 dup 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 0x02 +509 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1 +510 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1, 16 +512 <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1 +513 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02 +514 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 16 +516 bzero 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 0x00000000000000000000000000000000 +517 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x00000000000000000000000000000002 +518 swap 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x00000000000000000000000000000002, 0x01 +519 uncover 2 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01, 0x00000000000000000000000000000001 +521 b== 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 1 +522 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 +523 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 +524 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16, 16 +526 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +527 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +528 len 64 +529 int 64 64, 64 +530 == 1 +531 assert +532 int 1 1 +533 return 1 \ No newline at end of file diff --git a/test_cases/arc4_types/out/numeric.awst b/test_cases/arc4_types/out/numeric.awst index 511b62dd6b..267f1d522d 100644 --- a/test_cases/arc4_types/out/numeric.awst +++ b/test_cases/arc4_types/out/numeric.awst @@ -5,24 +5,49 @@ contract Arc4NumericTypesContract approval_program(): bool { uint8: puyapy.UInt64 = 255u - int8_encoded: puyapy.arc4.UIntN[typing.Literal[8]] = arc4_encode(uint8, puyapy.arc4.UIntN[typing.Literal[8]]) + int8_encoded: puyapy.arc4.UInt8 = arc4_encode(uint8, puyapy.arc4.UInt8) int8_decoded: puyapy.UInt64 = arc4_decode(int8_encoded, puyapy.UInt64) assert(uint8 == int8_decoded) test_bytes: puyapy.Bytes = hex<"7FFFFFFFFFFFFFFF00"> - assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=0, source=test_bytes)[:select(len(SINGLE_EVAL(id=0, source=test_bytes)), 1u, 1u < len(SINGLE_EVAL(id=0, source=test_bytes)))]), puyapy.UInt64) == 127u) + assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=0, source=test_bytes)[:select(len(SINGLE_EVAL(id=0, source=test_bytes)), 1u, 1u < len(SINGLE_EVAL(id=0, source=test_bytes)))]), puyapy.UInt64) == 127u) assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=1, source=test_bytes)[:select(len(SINGLE_EVAL(id=1, source=test_bytes)), 3u, 3u < len(SINGLE_EVAL(id=1, source=test_bytes)))]), puyapy.UInt64) == 8388607u) - assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=2, source=test_bytes)[:select(len(SINGLE_EVAL(id=2, source=test_bytes)), 2u, 2u < len(SINGLE_EVAL(id=2, source=test_bytes)))]), puyapy.UInt64) == 32767u) - assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=3, source=test_bytes)[:select(len(SINGLE_EVAL(id=3, source=test_bytes)), 4u, 4u < len(SINGLE_EVAL(id=3, source=test_bytes)))]), puyapy.UInt64) == 2147483647u) - assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=4, source=test_bytes)[:select(len(SINGLE_EVAL(id=4, source=test_bytes)), 8u, 8u < len(SINGLE_EVAL(id=4, source=test_bytes)))]), puyapy.UInt64) == 9223372036854775807u) + assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=2, source=test_bytes)[:select(len(SINGLE_EVAL(id=2, source=test_bytes)), 2u, 2u < len(SINGLE_EVAL(id=2, source=test_bytes)))]), puyapy.UInt64) == 32767u) + assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=3, source=test_bytes)[:select(len(SINGLE_EVAL(id=3, source=test_bytes)), 4u, 4u < len(SINGLE_EVAL(id=3, source=test_bytes)))]), puyapy.UInt64) == 2147483647u) + assert(arc4_decode(reinterpret_cast(SINGLE_EVAL(id=4, source=test_bytes)[:select(len(SINGLE_EVAL(id=4, source=test_bytes)), 8u, 8u < len(SINGLE_EVAL(id=4, source=test_bytes)))]), puyapy.UInt64) == 9223372036854775807u) decimals: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 145.6853943940arc4u64x10 assert(len(reinterpret_cast(decimals)) == 8u) - really_big_int: puyapy.arc4.BigUIntN[typing.Literal[512]] = 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095arc4n512 + assert(arc4_decode(decimals, puyapy.UInt64) == 1456853943940u) + decimals_from_truncated_str: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 145.0000000000arc4u64x10 + assert(len(reinterpret_cast(decimals_from_truncated_str)) == 8u) + assert(arc4_decode(decimals_from_truncated_str, puyapy.UInt64) == 1450000000000u) + thousand: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 1000.0000000000arc4u64x10 + assert(len(reinterpret_cast(thousand)) == 8u) + assert(arc4_decode(thousand, puyapy.UInt64) == 10000000000000u) + one_decimal: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 1.0000000000arc4u64x10 + assert(len(reinterpret_cast(one_decimal)) == 8u) + assert(arc4_decode(one_decimal, puyapy.UInt64) == 10000000000u) + zero_decimal: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 0E-10arc4u64x10 + assert(len(reinterpret_cast(zero_decimal)) == 8u) + assert(arc4_decode(zero_decimal, puyapy.UInt64) == 0u) + small_decimal: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 1.00E-8arc4u64x10 + assert(len(reinterpret_cast(small_decimal)) == 8u) + assert(arc4_decode(small_decimal, puyapy.UInt64) == 100u) + smaller_decimal: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 1.0E-9arc4u64x10 + assert(len(reinterpret_cast(smaller_decimal)) == 8u) + assert(arc4_decode(smaller_decimal, puyapy.UInt64) == 10u) + smallest_decimal: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 1E-10arc4u64x10 + assert(len(reinterpret_cast(smallest_decimal)) == 8u) + assert(arc4_decode(smallest_decimal, puyapy.UInt64) == 1u) + sixty_four_decimal: puyapy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 1844674407.3709551615arc4u64x10 + assert(len(reinterpret_cast(sixty_four_decimal)) == 8u) + assert(arc4_decode(sixty_four_decimal, puyapy.UInt64) == 18446744073709551615u) + really_big_int: puyapy.arc4.UInt512 = 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095arc4n512 assert(len(reinterpret_cast(really_big_int)) == 64u) - assert(reinterpret_cast(really_big_int) == reinterpret_cast(arc4_encode(arc4_decode(really_big_int, puyapy.BigUInt), puyapy.arc4.BigUIntN[typing.Literal[512]]))) + assert(reinterpret_cast(really_big_int) == reinterpret_cast(arc4_encode(arc4_decode(really_big_int, puyapy.BigUInt), puyapy.arc4.UInt512))) really_big_decimal: puyapy.arc4.BigUFixedNxM[typing.Literal[512], typing.Literal[2]] = arc4_encode(13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095n, puyapy.arc4.BigUFixedNxM[typing.Literal[512], typing.Literal[2]]) biguint: puyapy.BigUInt = 1n - arc4_biguint_const: puyapy.arc4.BigUIntN[typing.Literal[128]] = 1arc4n128 - arc4_biguint_dynamic: puyapy.arc4.BigUIntN[typing.Literal[128]] = arc4_encode(biguint b+ 1n, puyapy.arc4.BigUIntN[typing.Literal[128]]) + arc4_biguint_const: puyapy.arc4.UInt128 = 1arc4n128 + arc4_biguint_dynamic: puyapy.arc4.UInt128 = arc4_encode(biguint b+ 1n, puyapy.arc4.UInt128) assert(biguint == arc4_decode(arc4_biguint_const, puyapy.BigUInt)) assert(len(reinterpret_cast(arc4_biguint_dynamic)) == 16u) assert(len(reinterpret_cast(really_big_decimal)) == 64u) diff --git a/test_cases/arc4_types/out/reference_types.awst b/test_cases/arc4_types/out/reference_types.awst index 91a0c9851e..82de9d8a74 100644 --- a/test_cases/arc4_types/out/reference_types.awst +++ b/test_cases/arc4_types/out/reference_types.awst @@ -2,9 +2,9 @@ contract Arc4RefTypesContract { approval_program(): bool { - sender_address: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] = reinterpret_cast(reinterpret_cast(txn())) - checked_address: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] = reinterpret_cast(checked_maybe((SINGLE_EVAL(id=0, source=reinterpret_cast(txn())), 32u == len(SINGLE_EVAL(id=0, source=reinterpret_cast(txn())))))) - unchecked_address: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] = reinterpret_cast(reinterpret_cast(txn())) + sender_address: puyapy.arc4.Address = reinterpret_cast(reinterpret_cast(txn())) + checked_address: puyapy.arc4.Address = reinterpret_cast(checked_maybe((SINGLE_EVAL(id=0, source=reinterpret_cast(txn())), 32u == len(SINGLE_EVAL(id=0, source=reinterpret_cast(txn())))))) + unchecked_address: puyapy.arc4.Address = reinterpret_cast(reinterpret_cast(txn())) assert(reinterpret_cast(sender_address) == reinterpret_cast(checked_address) and reinterpret_cast(checked_address) == reinterpret_cast(unchecked_address)) return true } diff --git a/test_cases/arc4_types/out/string.O0.log b/test_cases/arc4_types/out/string.O0.log index 657f350c93..63e0b385ad 100644 --- a/test_cases/arc4_types/out/string.O0.log +++ b/test_cases/arc4_types/out/string.O0.log @@ -96,58 +96,48 @@ PC Teal Stack 205 swap 0x0002, "ab" 206 concat 0x00026162 207 extract 2 0 "ab" -210 byte "\x00\x01c" "ab", 0x000163 -215 extract 2 0 "ab", "c" -218 concat "abc" -219 dup "abc", "abc" -220 len "abc", 3 -221 itob "abc", 0x0000000000000003 -222 extract 6 0 "abc", 0x0003 -225 swap 0x0003, "abc" -226 concat 0x0003616263 -227 extract 2 0 "abc" -230 byte "\x00\x01d" "abc", 0x000164 -235 extract 2 0 "abc", "d" -238 concat "abcd" -239 dup "abcd", "abcd" -240 len "abcd", 4 -241 itob "abcd", 0x0000000000000004 -242 extract 6 0 "abcd", 0x0004 -245 swap 0x0004, "abcd" -246 concat 0x000461626364 -247 extract 2 0 "abcd" -250 byte "\x00\x01e" "abcd", 0x000165 -255 extract 2 0 "abcd", "e" -258 concat "abcde" -259 dup "abcde", "abcde" -260 len "abcde", 5 -261 itob "abcde", 0x0000000000000005 -262 extract 6 0 "abcde", 0x0005 -265 swap 0x0005, "abcde" -266 concat 0x00056162636465 -267 extract 2 0 "abcde" -270 byte "\x00\x01f" "abcde", 0x000166 -275 extract 2 0 "abcde", "f" -278 concat "abcdef" -279 dup "abcdef", "abcdef" -280 len "abcdef", 6 -281 itob "abcdef", 0x0000000000000006 -282 extract 6 0 "abcdef", 0x0006 -285 swap 0x0006, "abcdef" -286 concat 0x0006616263646566 -287 extract 2 0 "abcdef" -290 byte "\x00\x01g" "abcdef", 0x000167 -295 extract 2 0 "abcdef", "g" -298 concat "abcdefg" -299 dup "abcdefg", "abcdefg" -300 len "abcdefg", 7 -301 itob "abcdefg", 0x0000000000000007 -302 extract 6 0 "abcdefg", 0x0007 -305 swap 0x0007, "abcdefg" -306 concat 0x000761626364656667 -307 byte "\x00\x07abcdefg" 0x000761626364656667, 0x000761626364656667 -318 swap 0x000761626364656667, 0x000761626364656667 -319 == 1 -320 assert -321 int 1 1 -323 return 1 \ No newline at end of file +210 byte "\x00\x02cd" "ab", 0x00026364 +216 extract 2 0 "ab", "cd" +219 concat "abcd" +220 dup "abcd", "abcd" +221 len "abcd", 4 +222 itob "abcd", 0x0000000000000004 +223 extract 6 0 "abcd", 0x0004 +226 swap 0x0004, "abcd" +227 concat 0x000461626364 +228 extract 2 0 "abcd" +231 byte "\x00\x01e" "abcd", 0x000165 +236 extract 2 0 "abcd", "e" +239 concat "abcde" +240 dup "abcde", "abcde" +241 len "abcde", 5 +242 itob "abcde", 0x0000000000000005 +243 extract 6 0 "abcde", 0x0005 +246 swap 0x0005, "abcde" +247 concat 0x00056162636465 +248 extract 2 0 "abcde" +251 byte "\x00\x01f" "abcde", 0x000166 +256 extract 2 0 "abcde", "f" +259 concat "abcdef" +260 dup "abcdef", "abcdef" +261 len "abcdef", 6 +262 itob "abcdef", 0x0000000000000006 +263 extract 6 0 "abcdef", 0x0006 +266 swap 0x0006, "abcdef" +267 concat 0x0006616263646566 +268 extract 2 0 "abcdef" +271 byte "\x00\x01g" "abcdef", 0x000167 +276 extract 2 0 "abcdef", "g" +279 concat "abcdefg" +280 dup "abcdefg", "abcdefg" +281 len "abcdefg", 7 +282 itob "abcdefg", 0x0000000000000007 +283 extract 6 0 "abcdefg", 0x0007 +286 swap 0x0007, "abcdefg" +287 concat 0x000761626364656667 +288 byte "\x00\x07abcdefg" 0x000761626364656667, 0x000761626364656667 +299 swap 0x000761626364656667, 0x000761626364656667 +300 == 1 +301 assert +302 int 1 1 +304 return 1 \ No newline at end of file diff --git a/test_cases/arc4_types/out/string.awst b/test_cases/arc4_types/out/string.awst index af8e995248..8f275db2e7 100644 --- a/test_cases/arc4_types/out/string.awst +++ b/test_cases/arc4_types/out/string.awst @@ -15,7 +15,7 @@ contract Arc4StringTypesContract thing: puyapy.arc4.String = arc4_encode('hi', puyapy.arc4.String) thing.extend(thing) assert(reinterpret_cast(thing) == reinterpret_cast(arc4_encode('hihi', puyapy.arc4.String))) - value: puyapy.arc4.String = arc4_encode('a', puyapy.arc4.String) + arc4_encode('b', puyapy.arc4.String) + arc4_encode('c', puyapy.arc4.String) + arc4_encode('d', puyapy.arc4.String) + value: puyapy.arc4.String = arc4_encode('a', puyapy.arc4.String) + arc4_encode('b', puyapy.arc4.String) + arc4_encode('cd', puyapy.arc4.String) value.extend(arc4_encode('e', puyapy.arc4.String)) value.extend(arc4_encode('f', puyapy.arc4.String)) value.extend(arc4_encode('g', puyapy.arc4.String)) diff --git a/test_cases/arc4_types/out/tuples.awst b/test_cases/arc4_types/out/tuples.awst index badd7d3d19..bc7bdc0ac5 100644 --- a/test_cases/arc4_types/out/tuples.awst +++ b/test_cases/arc4_types/out/tuples.awst @@ -2,17 +2,17 @@ contract Arc4TuplesTypeContract { approval_program(): bool { - my_tuple: puyapy.arc4.Tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_encode((1arc4u8, 2arc4u8, arc4_encode('hello', puyapy.arc4.String), arc4_encode('world', puyapy.arc4.String), 255arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UIntN[typing.Literal[8]]]) - assert(reinterpret_cast(my_tuple) == reinterpret_cast(reinterpret_cast(hex<"01020007000EFF000568656C6C6F0005776F726C64">))) - boolean_packing: puyapy.arc4.Tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_encode((4arc4u8, arc4_encode(true, puyapy.arc4.Bool), arc4_encode(false, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(false, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), 16arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UIntN[typing.Literal[8]]]) + my_tuple: puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UInt8] = arc4_encode((1arc4u8, 2arc4u8, arc4_encode('hello', puyapy.arc4.String), arc4_encode('world', puyapy.arc4.String), 255arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UInt8]) + assert(reinterpret_cast(my_tuple) == reinterpret_cast(reinterpret_cast(hex<"01020007000EFF000568656C6C6F0005776F726C64">))) + boolean_packing: puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UInt8] = arc4_encode((4arc4u8, arc4_encode(true, puyapy.arc4.Bool), arc4_encode(false, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(false, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), arc4_encode(true, puyapy.arc4.Bool), 16arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UInt8]) assert(reinterpret_cast(boolean_packing) == hex<"04BD8010">) - (a, b, c, d, e, f, g, h, i, j, k): tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_decode(boolean_packing, tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UIntN[typing.Literal[8]]]) + (a, b, c, d, e, f, g, h, i, j, k): tuple[puyapy.arc4.UInt8, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UInt8] = arc4_decode(boolean_packing, tuple[puyapy.arc4.UInt8, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UInt8]) assert(reinterpret_cast(boolean_packing[10u]) == reinterpret_cast(k)) assert(arc4_decode(a, puyapy.UInt64) == 4u, comment="a is 4") assert(reinterpret_cast((reinterpret_cast(b) == hex<"00">) ? (b) : ((reinterpret_cast(d) == hex<"00">) ? (d) : ((reinterpret_cast(e) == hex<"00">) ? (e) : ((reinterpret_cast(f) == hex<"00">) ? (f) : ((reinterpret_cast(g) == hex<"00">) ? (g) : ((reinterpret_cast(i) == hex<"00">) ? (i) : (j))))))) != hex<"00">, comment="b,d,e,f,g,i,j are true") assert(reinterpret_cast((reinterpret_cast(c) != hex<"00">) ? (c) : (h)) == hex<"00">, comment="c and h are false") assert(arc4_decode(k, puyapy.UInt64) == 16u, comment="k is 16") - assert(reinterpret_cast(boolean_packing) == reinterpret_cast(arc4_encode(arc4_decode(boolean_packing, tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UIntN[typing.Literal[8]]]), puyapy.arc4.Tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UIntN[typing.Literal[8]]]))) + assert(reinterpret_cast(boolean_packing) == reinterpret_cast(arc4_encode(arc4_decode(boolean_packing, tuple[puyapy.arc4.UInt8, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UInt8]), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.Bool, puyapy.arc4.UInt8]))) (total, concat): tuple[puyapy.UInt64, puyapy.arc4.String] = this::test_stuff(my_tuple) assert(arc4_decode(concat, puyapy.Bytes) == 'hello world') assert(total == 258u) @@ -24,9 +24,9 @@ contract Arc4TuplesTypeContract return true } - subroutine test_stuff(test_tuple: puyapy.arc4.Tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UIntN[typing.Literal[8]]]): tuple[puyapy.UInt64, puyapy.arc4.String] + subroutine test_stuff(test_tuple: puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UInt8]): tuple[puyapy.UInt64, puyapy.arc4.String] { - (a, b, c, d, e): tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UIntN[typing.Literal[8]]] = arc4_decode(test_tuple, tuple[puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.UIntN[typing.Literal[8]], puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UIntN[typing.Literal[8]]]) + (a, b, c, d, e): tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UInt8] = arc4_decode(test_tuple, tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.String, puyapy.arc4.String, puyapy.arc4.UInt8]) total: puyapy.UInt64 = arc4_decode(a, puyapy.UInt64) + arc4_decode(b, puyapy.UInt64) + arc4_decode(e, puyapy.UInt64) text: puyapy.Bytes = arc4_decode(c, puyapy.Bytes) + ' ' + arc4_decode(d, puyapy.Bytes) return (total, arc4_encode(text, puyapy.arc4.String)) diff --git a/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.approval.teal b/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.approval.teal new file mode 100644 index 0000000000..61b65a697e --- /dev/null +++ b/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.approval.teal @@ -0,0 +1,87 @@ +#pragma version 10 + +test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program: + byte "" + dup + int 0 + int 0 + +main_for_header@1: + dup + int 3 + < + bz main_after_for@4 + byte 0x020301 + dig 1 + dup + cover 2 + int 1 + extract3 + btoi + dig 3 + + + bury 3 + int 1 + + + bury 1 + b main_for_header@1 + +main_after_for@4: + dig 1 + int 6 + == + assert // Total should be of dynamic_bytes items + int 0 + bury 4 + +main_for_header@5: + dig 3 + int 2 + < + bz main_after_for@8 + byte 0x0304 + dig 4 + dup + cover 2 + int 1 + extract3 + btoi + dig 3 + + + bury 3 + int 1 + + + bury 4 + b main_for_header@5 + +main_after_for@8: + int 0 + bury 3 + +main_for_header@9: + dig 2 + int 2 + < + bz main_after_for@12 + byte 0x0304 + dig 3 + dup + cover 2 + int 1 + extract3 + btoi + dig 3 + + + bury 3 + int 1 + + + bury 3 + b main_for_header@9 + +main_after_for@12: + dig 1 + int 20 + == + assert // Total should now include sum of dynamic_bytes3 items + int 1 + return diff --git a/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.clear.teal b/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.clear.teal new file mode 100644 index 0000000000..9eb47b6d28 --- /dev/null +++ b/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.clear.teal @@ -0,0 +1,5 @@ +#pragma version 10 + +test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program: + int 1 + return diff --git a/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.destructured.ir b/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.destructured.ir new file mode 100644 index 0000000000..d8db7bdd50 --- /dev/null +++ b/test_cases/arc4_types/out_O2/Arc4DynamicBytesContract.destructured.ir @@ -0,0 +1,51 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let continue_looping%8#0: uint64 = (< item_index_internal%6#0 3u) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let uint8_item#0: bytes = (extract3 0x020301 item_index_internal%6#0 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%10#0) + let item_index_internal%6#0: uint64 = (+ item_index_internal%6#0 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#0 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let continue_looping%19#0: uint64 = (< item_index_internal%17#0 2u) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let uint8_item#0: bytes = (extract3 0x0304 item_index_internal%17#0 1u) + let tmp%21#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%21#0) + let item_index_internal%17#0: uint64 = (+ item_index_internal%17#0 1u) + goto block@5 + block@8: // after_for_L25 + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let continue_looping%33#0: uint64 = (< item_index_internal%31#0 2u) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let uint8_item#0: bytes = (extract3 0x0304 item_index_internal%31#0 1u) + let tmp%35#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%35#0) + let item_index_internal%31#0: uint64 = (+ item_index_internal%31#0 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#0 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out_O2/Arc4NumericTypesContract.destructured.ir b/test_cases/arc4_types/out_O2/Arc4NumericTypesContract.destructured.ir index 1f8cd89c66..3a368c1d03 100644 --- a/test_cases/arc4_types/out_O2/Arc4NumericTypesContract.destructured.ir +++ b/test_cases/arc4_types/out_O2/Arc4NumericTypesContract.destructured.ir @@ -6,5 +6,5 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.approval.teal b/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.approval.teal new file mode 100644 index 0000000000..07ee3660fd --- /dev/null +++ b/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.approval.teal @@ -0,0 +1,204 @@ +#pragma version 10 + +test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program: + int 0 + dupn 2 + byte "" + dupn 3 + // arc4_types/dynamic_bytes.py:11 + // total = UInt64(0) + int 0 + // arc4_types/dynamic_bytes.py:12 + // dynamic_bytes = DynamicBytes(Byte(2), UInt8(3), 1) + byte 0x0003 + byte 0x02 + concat + byte 0x03 + concat + byte 0x01 + concat + // arc4_types/dynamic_bytes.py:13 + // assert dynamic_bytes.decode() == b"\x02\x03\x01" + dup + extract 2 0 + byte "\x02\x03\x01" + == + assert + // arc4_types/dynamic_bytes.py:14 + // assert dynamic_bytes.bytes == b"\x00\x03\x02\x03\x01" + dup + byte "\x00\x03\x02\x03\x01" + == + assert + // arc4_types/dynamic_bytes.py:16 + // for uint8_item in dynamic_bytes: + dup + int 0 + extract_uint16 + swap + extract 2 0 + int 0 + +main_for_header@1: + // arc4_types/dynamic_bytes.py:16 + // for uint8_item in dynamic_bytes: + dup + dig 3 + < + bz main_after_for@4 + dup + int 1 + * + dig 2 + swap + int 1 + extract3 + // arc4_types/dynamic_bytes.py:17 + // total += uint8_item.decode() + btoi + dig 4 + swap + + + bury 4 + dup + int 1 + + + bury 1 + b main_for_header@1 + +main_after_for@4: + // arc4_types/dynamic_bytes.py:19 + // assert total == 6, "Total should be of dynamic_bytes items" + dig 3 + int 6 + == + assert // Total should be of dynamic_bytes items + // arc4_types/dynamic_bytes.py:21 + // dynamic_bytes2 = DynamicBytes(b"\x03\x04") + byte 0x00020304 + dup + bury 10 + // arc4_types/dynamic_bytes.py:22 + // assert dynamic_bytes2.decode() == b"\x03\x04" + dup + extract 2 0 + byte "\x03\x04" + == + assert + // arc4_types/dynamic_bytes.py:23 + // assert dynamic_bytes2.bytes == b"\x00\x02\x03\x04" + dup + byte "\x00\x02\x03\x04" + == + assert + // arc4_types/dynamic_bytes.py:25 + // for uint8_item in dynamic_bytes2: + dup + int 0 + extract_uint16 + bury 9 + extract 2 0 + bury 11 + int 0 + bury 6 + +main_for_header@5: + // arc4_types/dynamic_bytes.py:25 + // for uint8_item in dynamic_bytes2: + dig 5 + dig 8 + < + bz main_after_for@8 + dig 5 + int 1 + * + dig 11 + swap + int 1 + extract3 + // arc4_types/dynamic_bytes.py:26 + // total += uint8_item.decode() + btoi + dig 4 + swap + + + bury 4 + dig 5 + int 1 + + + bury 6 + b main_for_header@5 + +main_after_for@8: + // arc4_types/dynamic_bytes.py:28 + // dynamic_bytes3 = DynamicBytes(dynamic_bytes2.decode()) + dig 8 + dup + extract 2 0 + dup + len + itob + extract 6 2 + swap + concat + // arc4_types/dynamic_bytes.py:29 + // assert dynamic_bytes3.decode() == b"\x03\x04" + dup + extract 2 0 + byte "\x03\x04" + == + assert + // arc4_types/dynamic_bytes.py:30 + // assert dynamic_bytes3.bytes == b"\x00\x02\x03\x04" + byte "\x00\x02\x03\x04" + == + assert + // arc4_types/dynamic_bytes.py:32 + // for uint8_item in dynamic_bytes2: + dup + int 0 + extract_uint16 + bury 8 + extract 2 0 + bury 10 + int 0 + bury 5 + +main_for_header@9: + // arc4_types/dynamic_bytes.py:32 + // for uint8_item in dynamic_bytes2: + dig 4 + dig 7 + < + bz main_after_for@12 + dig 4 + int 1 + * + dig 10 + swap + int 1 + extract3 + // arc4_types/dynamic_bytes.py:33 + // total += uint8_item.decode() + btoi + dig 4 + swap + + + bury 4 + dig 4 + int 1 + + + bury 5 + b main_for_header@9 + +main_after_for@12: + // arc4_types/dynamic_bytes.py:35 + // assert total == 20, "Total should now include sum of dynamic_bytes3 items" + dig 3 + int 20 + == + assert // Total should now include sum of dynamic_bytes3 items + // arc4_types/dynamic_bytes.py:36 + // return True + int 1 + return diff --git a/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.clear.teal b/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.clear.teal new file mode 100644 index 0000000000..cba04ad698 --- /dev/null +++ b/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 + +test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program: + // arc4_types/dynamic_bytes.py:39 + // return True + int 1 + return diff --git a/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.destructured.ir b/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.destructured.ir new file mode 100644 index 0000000000..729a62ed1f --- /dev/null +++ b/test_cases/arc4_types/out_unoptimized/Arc4DynamicBytesContract.destructured.ir @@ -0,0 +1,92 @@ +contract test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract: + program approval: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program() -> uint64: + block@0: // L10 + let total#0: uint64 = 0u + let array_data%0#0: bytes = 0x0003 + let array_data%0#0: bytes = (concat array_data%0#0 0x02) + let array_data%0#0: bytes = (concat array_data%0#0 0x03) + let array_data%0#0: bytes = (concat array_data%0#0 0x01) + let dynamic_bytes#0: bytes = array_data%0#0 + let tmp%1#0: bytes = ((extract 2 0) dynamic_bytes#0) + let tmp%2#0: uint64 = (== tmp%1#0 "\x02\x03\x01") + (assert tmp%2#0) + let tmp%3#0: uint64 = (== dynamic_bytes#0 "\x00\x03\x02\x03\x01") + (assert tmp%3#0) + let array_length%4#0: uint64 = (extract_uint16 dynamic_bytes#0 0u) + let array_value%5#0: bytes = ((extract 2 0) dynamic_bytes#0) + let item_index_internal%6#0: uint64 = 0u + goto block@1 + block@1: // for_header_L16 + let continue_looping%8#0: uint64 = (< item_index_internal%6#0 array_length%4#0) + goto continue_looping%8#0 ? block@2 : block@4 + block@2: // for_body_L16 + let item_index%9#0: uint64 = (* item_index_internal%6#0 1u) + let uint8_item#0: bytes = (extract3 array_value%5#0 item_index%9#0 1u) + let tmp%10#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%10#0) + goto block@3 + block@3: // for_footer_L16 + let item_index_internal%6#0: uint64 = (+ item_index_internal%6#0 1u) + goto block@1 + block@4: // after_for_L16 + let tmp%11#0: uint64 = (== total#0 6u) + (assert tmp%11#0) // Total should be of dynamic_bytes items + let dynamic_bytes2#0: bytes = 0x00020304 + let tmp%12#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let tmp%13#0: uint64 = (== tmp%12#0 "\x03\x04") + (assert tmp%13#0) + let tmp%14#0: uint64 = (== dynamic_bytes2#0 "\x00\x02\x03\x04") + (assert tmp%14#0) + let array_length%15#0: uint64 = (extract_uint16 dynamic_bytes2#0 0u) + let array_value%16#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let item_index_internal%17#0: uint64 = 0u + goto block@5 + block@5: // for_header_L25 + let continue_looping%19#0: uint64 = (< item_index_internal%17#0 array_length%15#0) + goto continue_looping%19#0 ? block@6 : block@8 + block@6: // for_body_L25 + let item_index%20#0: uint64 = (* item_index_internal%17#0 1u) + let uint8_item#0: bytes = (extract3 array_value%16#0 item_index%20#0 1u) + let tmp%21#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%21#0) + goto block@7 + block@7: // for_footer_L25 + let item_index_internal%17#0: uint64 = (+ item_index_internal%17#0 1u) + goto block@5 + block@8: // after_for_L25 + let tmp%22#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let length%23#0: uint64 = (len tmp%22#0) + let value_as_bytes%24#0: bytes = (itob length%23#0) + let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) + let dynamic_bytes3#0: bytes = (concat value_as_uint16%25#0 tmp%22#0) + let tmp%26#0: bytes = ((extract 2 0) dynamic_bytes3#0) + let tmp%27#0: uint64 = (== tmp%26#0 "\x03\x04") + (assert tmp%27#0) + let tmp%28#0: uint64 = (== dynamic_bytes3#0 "\x00\x02\x03\x04") + (assert tmp%28#0) + let array_length%29#0: uint64 = (extract_uint16 dynamic_bytes2#0 0u) + let array_value%30#0: bytes = ((extract 2 0) dynamic_bytes2#0) + let item_index_internal%31#0: uint64 = 0u + goto block@9 + block@9: // for_header_L32 + let continue_looping%33#0: uint64 = (< item_index_internal%31#0 array_length%29#0) + goto continue_looping%33#0 ? block@10 : block@12 + block@10: // for_body_L32 + let item_index%34#0: uint64 = (* item_index_internal%31#0 1u) + let uint8_item#0: bytes = (extract3 array_value%30#0 item_index%34#0 1u) + let tmp%35#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%35#0) + goto block@11 + block@11: // for_footer_L32 + let item_index_internal%31#0: uint64 = (+ item_index_internal%31#0 1u) + goto block@9 + block@12: // after_for_L32 + let tmp%36#0: uint64 = (== total#0 20u) + (assert tmp%36#0) // Total should now include sum of dynamic_bytes3 items + return 1u + + program clear-state: + subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program() -> uint64: + block@0: // L38 + return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal index 41e2c7930b..f74d22d2be 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal +++ b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal @@ -207,17 +207,12 @@ mutating_copies: swap int 1 extract3 - // arc4_types/mutable_params.py:66 - // 2 - byte 0x02 - // arc4_types/mutable_params.py:65-66 - // assert my_array_copy[1] == UInt8( - // 2 - b== // arc4_types/mutable_params.py:65-67 // assert my_array_copy[1] == UInt8( // 2 // ), "my_array_copy should not be mutated by the subroutine" + byte 0x02 + b== assert // my_array_copy should not be mutated by the subroutine // arc4_types/mutable_params.py:69 // assert my_struct_copy.s_val_1 == String( diff --git a/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.approval.teal b/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.approval.teal index 067a360a98..f586d989d7 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.approval.teal +++ b/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.approval.teal @@ -142,21 +142,156 @@ test_cases.arc4_types.numeric.Arc4NumericTypesContract.approval_program: byte 0x0000015333430684 // arc4_types/numeric.py:45 // assert decimals.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:46 + // assert decimals.decode() == 145_6853943940 + btoi + int 1456853943940 + == + assert + // arc4_types/numeric.py:48 + // decimals_from_truncated_str = Decimal("145.0") + byte 0x000001519abc2400 + // arc4_types/numeric.py:50 + // assert decimals_from_truncated_str.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:51 + // assert decimals_from_truncated_str.decode() == 145_0000000000 + btoi + int 1450000000000 + == + assert + // arc4_types/numeric.py:53 + // thousand = Decimal("1e3") + byte 0x000009184e72a000 + // arc4_types/numeric.py:55 + // assert thousand.bytes.length == 8 + dup + len + int 8 + == + assert + // arc4_types/numeric.py:56 + // assert thousand.decode() == 1000_0000000000 + btoi + int 10000000000000 + == + assert + // arc4_types/numeric.py:58 + // one_decimal = Decimal("1.0") + byte 0x00000002540be400 + // arc4_types/numeric.py:60 + // assert one_decimal.bytes.length == (64 // 8) + dup len int 8 == assert - // arc4_types/numeric.py:47 + // arc4_types/numeric.py:61 + // assert one_decimal.decode() == 1_0000000000 + btoi + int 10000000000 + == + assert + // arc4_types/numeric.py:63 + // zero_decimal = Decimal("0.0") + byte 0x0000000000000000 + // arc4_types/numeric.py:65 + // assert zero_decimal.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:66 + // assert zero_decimal.decode() == 0 + btoi + int 0 + == + assert + // arc4_types/numeric.py:68 + // small_decimal = Decimal("0.00000001") + byte 0x0000000000000064 + // arc4_types/numeric.py:70 + // assert small_decimal.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:71 + // assert small_decimal.decode() == 100 + btoi + int 100 + == + assert + // arc4_types/numeric.py:73 + // smaller_decimal = Decimal("1E-9") + byte 0x000000000000000a + // arc4_types/numeric.py:75 + // assert smaller_decimal.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:76 + // assert smaller_decimal.decode() == 10 + btoi + int 10 + == + assert + // arc4_types/numeric.py:78 + // smallest_decimal = Decimal("0.0000000001") + byte 0x0000000000000001 + // arc4_types/numeric.py:80 + // assert smallest_decimal.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:81 + // assert smallest_decimal.decode() == 1 + btoi + int 1 + == + assert + // arc4_types/numeric.py:83 + // sixty_four_decimal = Decimal("1844674407.3709551615") + byte 0xffffffffffffffff + // arc4_types/numeric.py:85 + // assert sixty_four_decimal.bytes.length == (64 // 8) + dup + len + int 8 + == + assert + // arc4_types/numeric.py:86 + // assert sixty_four_decimal.decode() == 1844674407_3709551615 + btoi + int 18446744073709551615 + == + assert + // arc4_types/numeric.py:88 // really_big_int = BigUIntN[t.Literal[512]](sixty_four_byte_num) byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - // arc4_types/numeric.py:49 + // arc4_types/numeric.py:90 // assert really_big_int.bytes.length == 64 dup len int 64 == assert - // arc4_types/numeric.py:50 + // arc4_types/numeric.py:91 // assert really_big_int == BigUIntN[t.Literal[512]](really_big_int.decode()) dup len @@ -170,10 +305,10 @@ test_cases.arc4_types.numeric.Arc4NumericTypesContract.approval_program: b| b== assert - // arc4_types/numeric.py:53 + // arc4_types/numeric.py:94 // BigUInt(sixty_four_byte_num) byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - // arc4_types/numeric.py:52-54 + // arc4_types/numeric.py:93-95 // really_big_decimal = BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( // BigUInt(sixty_four_byte_num) // ) @@ -183,23 +318,23 @@ test_cases.arc4_types.numeric.Arc4NumericTypesContract.approval_program: assert // overflow int 64 bzero - // arc4_types/numeric.py:53 + // arc4_types/numeric.py:94 // BigUInt(sixty_four_byte_num) byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - // arc4_types/numeric.py:52-54 + // arc4_types/numeric.py:93-95 // really_big_decimal = BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( // BigUInt(sixty_four_byte_num) // ) swap b| - // arc4_types/numeric.py:56 + // arc4_types/numeric.py:97 // biguint = BigUInt(1) byte 0x01 - // arc4_types/numeric.py:57 + // arc4_types/numeric.py:98 // arc4_biguint_const = ARC4BigUInt(1) byte 0x00000000000000000000000000000001 swap - // arc4_types/numeric.py:58 + // arc4_types/numeric.py:99 // arc4_biguint_dynamic = ARC4BigUInt(biguint + 1) dup byte 0x01 @@ -212,25 +347,25 @@ test_cases.arc4_types.numeric.Arc4NumericTypesContract.approval_program: int 16 bzero b| - // arc4_types/numeric.py:60 + // arc4_types/numeric.py:101 // assert biguint == arc4_biguint_const.decode() swap uncover 2 b== assert - // arc4_types/numeric.py:62 + // arc4_types/numeric.py:103 // assert arc4_biguint_dynamic.bytes.length == (128 // 8) len int 16 == assert - // arc4_types/numeric.py:64 + // arc4_types/numeric.py:105 // assert really_big_decimal.bytes.length == 64 len int 64 == assert - // arc4_types/numeric.py:66 + // arc4_types/numeric.py:107 // return True int 1 return diff --git a/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.clear.teal b/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.clear.teal index 541d500fea..876cf97b5c 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.clear.teal +++ b/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.clear.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program: - // arc4_types/numeric.py:69 + // arc4_types/numeric.py:110 // return True int 1 return diff --git a/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.destructured.ir b/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.destructured.ir index f138d07cb8..cc8a69175e 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.destructured.ir +++ b/test_cases/arc4_types/out_unoptimized/Arc4NumericTypesContract.destructured.ir @@ -58,41 +58,100 @@ contract test_cases.arc4_types.numeric.Arc4NumericTypesContract: let tmp%42#0: uint64 = (len decimals#0) let tmp%43#0: uint64 = (== tmp%42#0 8u) (assert tmp%43#0) - let really_big_int#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - let tmp%44#0: uint64 = (len really_big_int#0) - let tmp%45#0: uint64 = (== tmp%44#0 64u) + let tmp%44#0: uint64 = (btoi decimals#0) + let tmp%45#0: uint64 = (== tmp%44#0 1456853943940u) (assert tmp%45#0) - let len_%46#0: uint64 = (len really_big_int#0) - let no_overflow%47#0: uint64 = (<= len_%46#0 64u) - (assert no_overflow%47#0) // overflow - let b_zeros%48#0: bytes = (bzero 64u) - let tmp%49#0: bytes = (b| really_big_int#0 b_zeros%48#0) - let tmp%50#0: uint64 = (b== really_big_int#0 tmp%49#0) - (assert tmp%50#0) - let len_%51#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) - let no_overflow%52#0: uint64 = (<= len_%51#0 64u) - (assert no_overflow%52#0) // overflow - let b_zeros%53#0: bytes = (bzero 64u) - let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%53#0) + let decimals_from_truncated_str#0: bytes = 0x000001519abc2400 + let tmp%46#0: uint64 = (len decimals_from_truncated_str#0) + let tmp%47#0: uint64 = (== tmp%46#0 8u) + (assert tmp%47#0) + let tmp%48#0: uint64 = (btoi decimals_from_truncated_str#0) + let tmp%49#0: uint64 = (== tmp%48#0 1450000000000u) + (assert tmp%49#0) + let thousand#0: bytes = 0x000009184e72a000 + let tmp%50#0: uint64 = (len thousand#0) + let tmp%51#0: uint64 = (== tmp%50#0 8u) + (assert tmp%51#0) + let tmp%52#0: uint64 = (btoi thousand#0) + let tmp%53#0: uint64 = (== tmp%52#0 10000000000000u) + (assert tmp%53#0) + let one_decimal#0: bytes = 0x00000002540be400 + let tmp%54#0: uint64 = (len one_decimal#0) + let tmp%55#0: uint64 = (== tmp%54#0 8u) + (assert tmp%55#0) + let tmp%56#0: uint64 = (btoi one_decimal#0) + let tmp%57#0: uint64 = (== tmp%56#0 10000000000u) + (assert tmp%57#0) + let zero_decimal#0: bytes = 0x0000000000000000 + let tmp%58#0: uint64 = (len zero_decimal#0) + let tmp%59#0: uint64 = (== tmp%58#0 8u) + (assert tmp%59#0) + let tmp%60#0: uint64 = (btoi zero_decimal#0) + let tmp%61#0: uint64 = (== tmp%60#0 0u) + (assert tmp%61#0) + let small_decimal#0: bytes = 0x0000000000000064 + let tmp%62#0: uint64 = (len small_decimal#0) + let tmp%63#0: uint64 = (== tmp%62#0 8u) + (assert tmp%63#0) + let tmp%64#0: uint64 = (btoi small_decimal#0) + let tmp%65#0: uint64 = (== tmp%64#0 100u) + (assert tmp%65#0) + let smaller_decimal#0: bytes = 0x000000000000000a + let tmp%66#0: uint64 = (len smaller_decimal#0) + let tmp%67#0: uint64 = (== tmp%66#0 8u) + (assert tmp%67#0) + let tmp%68#0: uint64 = (btoi smaller_decimal#0) + let tmp%69#0: uint64 = (== tmp%68#0 10u) + (assert tmp%69#0) + let smallest_decimal#0: bytes = 0x0000000000000001 + let tmp%70#0: uint64 = (len smallest_decimal#0) + let tmp%71#0: uint64 = (== tmp%70#0 8u) + (assert tmp%71#0) + let tmp%72#0: uint64 = (btoi smallest_decimal#0) + let tmp%73#0: uint64 = (== tmp%72#0 1u) + (assert tmp%73#0) + let sixty_four_decimal#0: bytes = 0xffffffffffffffff + let tmp%74#0: uint64 = (len sixty_four_decimal#0) + let tmp%75#0: uint64 = (== tmp%74#0 8u) + (assert tmp%75#0) + let tmp%76#0: uint64 = (btoi sixty_four_decimal#0) + let tmp%77#0: uint64 = (== tmp%76#0 18446744073709551615u) + (assert tmp%77#0) + let really_big_int#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + let tmp%78#0: uint64 = (len really_big_int#0) + let tmp%79#0: uint64 = (== tmp%78#0 64u) + (assert tmp%79#0) + let len_%80#0: uint64 = (len really_big_int#0) + let no_overflow%81#0: uint64 = (<= len_%80#0 64u) + (assert no_overflow%81#0) // overflow + let b_zeros%82#0: bytes = (bzero 64u) + let tmp%83#0: bytes = (b| really_big_int#0 b_zeros%82#0) + let tmp%84#0: uint64 = (b== really_big_int#0 tmp%83#0) + (assert tmp%84#0) + let len_%85#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%86#0: uint64 = (<= len_%85#0 64u) + (assert no_overflow%86#0) // overflow + let b_zeros%87#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%87#0) let biguint#0: bytes = 1b let arc4_biguint_const#0: bytes = 0x00000000000000000000000000000001 - let tmp%54#0: bytes = (b+ biguint#0 1b) - let len_%55#0: uint64 = (len tmp%54#0) - let no_overflow%56#0: uint64 = (<= len_%55#0 16u) - (assert no_overflow%56#0) // overflow - let b_zeros%57#0: bytes = (bzero 16u) - let arc4_biguint_dynamic#0: bytes = (b| tmp%54#0 b_zeros%57#0) - let tmp%58#0: uint64 = (b== biguint#0 arc4_biguint_const#0) - (assert tmp%58#0) - let tmp%59#0: uint64 = (len arc4_biguint_dynamic#0) - let tmp%60#0: uint64 = (== tmp%59#0 16u) - (assert tmp%60#0) - let tmp%61#0: uint64 = (len really_big_decimal#0) - let tmp%62#0: uint64 = (== tmp%61#0 64u) - (assert tmp%62#0) + let tmp%88#0: bytes = (b+ biguint#0 1b) + let len_%89#0: uint64 = (len tmp%88#0) + let no_overflow%90#0: uint64 = (<= len_%89#0 16u) + (assert no_overflow%90#0) // overflow + let b_zeros%91#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| tmp%88#0 b_zeros%91#0) + let tmp%92#0: uint64 = (b== biguint#0 arc4_biguint_const#0) + (assert tmp%92#0) + let tmp%93#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%94#0: uint64 = (== tmp%93#0 16u) + (assert tmp%94#0) + let tmp%95#0: uint64 = (len really_big_decimal#0) + let tmp%96#0: uint64 = (== tmp%95#0 64u) + (assert tmp%96#0) return 1u program clear-state: subroutine test_cases.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: - block@0: // L68 + block@0: // L109 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.approval.teal b/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.approval.teal index 51facd1517..5d51f18573 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.approval.teal +++ b/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.approval.teal @@ -120,7 +120,7 @@ test_cases.arc4_types.string.Arc4StringTypesContract.approval_program: == assert // arc4_types/string.py:35 - // value = String("a") + Bytes(b"b") + b"c" + "d" + // value = String("a") + String(Bytes(b"b")) + "cd" byte "\x00\x01a" extract 2 0 byte "\x00\x01b" @@ -133,17 +133,7 @@ test_cases.arc4_types.string.Arc4StringTypesContract.approval_program: swap concat extract 2 0 - byte "\x00\x01c" - extract 2 0 - concat - dup - len - itob - extract 6 0 - swap - concat - extract 2 0 - byte "\x00\x01d" + byte "\x00\x02cd" extract 2 0 concat dup @@ -165,7 +155,7 @@ test_cases.arc4_types.string.Arc4StringTypesContract.approval_program: swap concat // arc4_types/string.py:37 - // value += b"f" + // value += String("f") extract 2 0 byte "\x00\x01f" extract 2 0 @@ -177,7 +167,7 @@ test_cases.arc4_types.string.Arc4StringTypesContract.approval_program: swap concat // arc4_types/string.py:38 - // value += Bytes(b"g") + // value += String(Bytes(b"g")) extract 2 0 byte "\x00\x01g" extract 2 0 diff --git a/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.destructured.ir b/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.destructured.ir index 632ecafa03..62eae968d3 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.destructured.ir +++ b/test_cases/arc4_types/out_unoptimized/Arc4StringTypesContract.destructured.ir @@ -59,14 +59,15 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let len_16_bit%41#0: bytes = ((extract 6 0) len_bytes%40#0) let concat_result%42#0: bytes = (concat len_16_bit%41#0 concatenated%38#0) let expr_value_trimmed%43#0: bytes = ((extract 2 0) concat_result%42#0) - let expr_value_trimmed%44#0: bytes = ((extract 2 0) "\x00\x01c") + let expr_value_trimmed%44#0: bytes = ((extract 2 0) "\x00\x02cd") let concatenated%45#0: bytes = (concat expr_value_trimmed%43#0 expr_value_trimmed%44#0) let len_%46#0: uint64 = (len concatenated%45#0) let len_bytes%47#0: bytes = (itob len_%46#0) let len_16_bit%48#0: bytes = ((extract 6 0) len_bytes%47#0) let concat_result%49#0: bytes = (concat len_16_bit%48#0 concatenated%45#0) - let expr_value_trimmed%50#0: bytes = ((extract 2 0) concat_result%49#0) - let expr_value_trimmed%51#0: bytes = ((extract 2 0) "\x00\x01d") + let value#0: bytes = concat_result%49#0 + let expr_value_trimmed%50#0: bytes = ((extract 2 0) value#0) + let expr_value_trimmed%51#0: bytes = ((extract 2 0) "\x00\x01e") let concatenated%52#0: bytes = (concat expr_value_trimmed%50#0 expr_value_trimmed%51#0) let len_%53#0: uint64 = (len concatenated%52#0) let len_bytes%54#0: bytes = (itob len_%53#0) @@ -74,7 +75,7 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let concat_result%56#0: bytes = (concat len_16_bit%55#0 concatenated%52#0) let value#0: bytes = concat_result%56#0 let expr_value_trimmed%57#0: bytes = ((extract 2 0) value#0) - let expr_value_trimmed%58#0: bytes = ((extract 2 0) "\x00\x01e") + let expr_value_trimmed%58#0: bytes = ((extract 2 0) "\x00\x01f") let concatenated%59#0: bytes = (concat expr_value_trimmed%57#0 expr_value_trimmed%58#0) let len_%60#0: uint64 = (len concatenated%59#0) let len_bytes%61#0: bytes = (itob len_%60#0) @@ -82,23 +83,15 @@ contract test_cases.arc4_types.string.Arc4StringTypesContract: let concat_result%63#0: bytes = (concat len_16_bit%62#0 concatenated%59#0) let value#0: bytes = concat_result%63#0 let expr_value_trimmed%64#0: bytes = ((extract 2 0) value#0) - let expr_value_trimmed%65#0: bytes = ((extract 2 0) "\x00\x01f") + let expr_value_trimmed%65#0: bytes = ((extract 2 0) "\x00\x01g") let concatenated%66#0: bytes = (concat expr_value_trimmed%64#0 expr_value_trimmed%65#0) let len_%67#0: uint64 = (len concatenated%66#0) let len_bytes%68#0: bytes = (itob len_%67#0) let len_16_bit%69#0: bytes = ((extract 6 0) len_bytes%68#0) let concat_result%70#0: bytes = (concat len_16_bit%69#0 concatenated%66#0) let value#0: bytes = concat_result%70#0 - let expr_value_trimmed%71#0: bytes = ((extract 2 0) value#0) - let expr_value_trimmed%72#0: bytes = ((extract 2 0) "\x00\x01g") - let concatenated%73#0: bytes = (concat expr_value_trimmed%71#0 expr_value_trimmed%72#0) - let len_%74#0: uint64 = (len concatenated%73#0) - let len_bytes%75#0: bytes = (itob len_%74#0) - let len_16_bit%76#0: bytes = ((extract 6 0) len_bytes%75#0) - let concat_result%77#0: bytes = (concat len_16_bit%76#0 concatenated%73#0) - let value#0: bytes = concat_result%77#0 - let tmp%78#0: uint64 = (== "\x00\x07abcdefg" value#0) - (assert tmp%78#0) + let tmp%71#0: uint64 = (== "\x00\x07abcdefg" value#0) + (assert tmp%71#0) return 1u program clear-state: diff --git a/test_cases/arc4_types/puya.log b/test_cases/arc4_types/puya.log index 12d43ebae4..7a3a0de960 100644 --- a/test_cases/arc4_types/puya.log +++ b/test_cases/arc4_types/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['arc4_types'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['arc4_types'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) arc4_types/mutable_params.py:62:9 warning: expression result is ignored arc4_types/mutable_params.py:79:9 warning: expression result is ignored arc4_types/mutable_params.py:90:9 warning: expression result is ignored @@ -439,6 +439,64 @@ arc4_types/bool_eval.py:69:9 warning: assertion is always true, ignoring debug: Terminated block@0: // L12 debug: Sealing block@0: // L73 debug: Terminated block@0: // L73 +debug: Sealing block@0: // L10 +debug: Terminated block@0: // L10 +debug: Looking for 'item_index_internal%6' in an unsealed block creating an incomplete Phi: block@1: // for_header_L16 +debug: Created Phi assignment: let item_index_internal%6#1: uint64 = undefined while trying to resolve 'item_index_internal%6' in block@1: // for_header_L16 +debug: Terminated block@1: // for_header_L16 +debug: Sealing block@None: // for_body_L16 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@1: // for_header_L16 +debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@1: // for_header_L16 +debug: Terminated block@2: // for_body_L16 +debug: Sealing block@3: // for_footer_L16 +debug: Sealing block@None: // after_for_L16 +debug: Terminated block@3: // for_footer_L16 +debug: Sealing block@1: // for_header_L16 +debug: Added item_index_internal%6#0 to Phi node: let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0) in block@0: // L10 +debug: Added item_index_internal%6#2 to Phi node: let item_index_internal%6#1: uint64 = φ(item_index_internal%6#0 <- block@0, item_index_internal%6#2 <- block@3) in block@3: // for_footer_L16 +debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@0) in block@0: // L10 +debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@3) in block@3: // for_footer_L16 +debug: Terminated block@4: // after_for_L16 +debug: Looking for 'item_index_internal%17' in an unsealed block creating an incomplete Phi: block@5: // for_header_L25 +debug: Created Phi assignment: let item_index_internal%17#1: uint64 = undefined while trying to resolve 'item_index_internal%17' in block@5: // for_header_L25 +debug: Terminated block@5: // for_header_L25 +debug: Sealing block@None: // for_body_L25 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@5: // for_header_L25 +debug: Created Phi assignment: let total#3: uint64 = undefined while trying to resolve 'total' in block@5: // for_header_L25 +debug: Terminated block@6: // for_body_L25 +debug: Sealing block@7: // for_footer_L25 +debug: Sealing block@None: // after_for_L25 +debug: Terminated block@7: // for_footer_L25 +debug: Sealing block@5: // for_header_L25 +debug: Added item_index_internal%17#0 to Phi node: let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4) in block@4: // after_for_L16 +debug: Added item_index_internal%17#2 to Phi node: let item_index_internal%17#1: uint64 = φ(item_index_internal%17#0 <- block@4, item_index_internal%17#2 <- block@7) in block@7: // for_footer_L25 +debug: Added total#1 to Phi node: let total#3: uint64 = φ(total#1 <- block@4) in block@4: // after_for_L16 +debug: Added total#4 to Phi node: let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@7) in block@7: // for_footer_L25 +debug: Created Phi assignment: let dynamic_bytes2#1: bytes = undefined while trying to resolve 'dynamic_bytes2' in block@5: // for_header_L25 +debug: Added dynamic_bytes2#0 to Phi node: let dynamic_bytes2#1: bytes = φ(dynamic_bytes2#0 <- block@4) in block@4: // after_for_L16 +debug: Added dynamic_bytes2#1 to Phi node: let dynamic_bytes2#1: bytes = φ(dynamic_bytes2#0 <- block@4, dynamic_bytes2#1 <- block@7) in block@7: // for_footer_L25 +debug: Replacing trivial Phi node: let dynamic_bytes2#1: bytes = φ(dynamic_bytes2#0 <- block@4, dynamic_bytes2#1 <- block@7) (dynamic_bytes2#1) with dynamic_bytes2#0 +debug: Deleting Phi assignment: let dynamic_bytes2#1: bytes = φ(dynamic_bytes2#0 <- block@4, dynamic_bytes2#1 <- block@7) +debug: Replaced trivial Phi node: let dynamic_bytes2#1: bytes = φ(dynamic_bytes2#0 <- block@4, dynamic_bytes2#1 <- block@7) (dynamic_bytes2#1) with dynamic_bytes2#0 in current definition for 3 blocks +debug: Terminated block@8: // after_for_L25 +debug: Looking for 'item_index_internal%31' in an unsealed block creating an incomplete Phi: block@9: // for_header_L32 +debug: Created Phi assignment: let item_index_internal%31#1: uint64 = undefined while trying to resolve 'item_index_internal%31' in block@9: // for_header_L32 +debug: Terminated block@9: // for_header_L32 +debug: Sealing block@None: // for_body_L32 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@9: // for_header_L32 +debug: Created Phi assignment: let total#5: uint64 = undefined while trying to resolve 'total' in block@9: // for_header_L32 +debug: Terminated block@10: // for_body_L32 +debug: Sealing block@11: // for_footer_L32 +debug: Sealing block@None: // after_for_L32 +debug: Terminated block@11: // for_footer_L32 +debug: Sealing block@9: // for_header_L32 +debug: Added item_index_internal%31#0 to Phi node: let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8) in block@8: // after_for_L25 +debug: Added item_index_internal%31#2 to Phi node: let item_index_internal%31#1: uint64 = φ(item_index_internal%31#0 <- block@8, item_index_internal%31#2 <- block@11) in block@11: // for_footer_L32 +debug: Added total#3 to Phi node: let total#5: uint64 = φ(total#3 <- block@8) in block@8: // after_for_L25 +debug: Added total#6 to Phi node: let total#5: uint64 = φ(total#3 <- block@8, total#6 <- block@11) in block@11: // for_footer_L32 +debug: Terminated block@12: // after_for_L32 +debug: Sealing block@0: // L38 +debug: Terminated block@0: // L38 debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L13 @@ -498,8 +556,8 @@ debug: Sealing block@0: // L45 debug: Terminated block@0: // L45 debug: Sealing block@0: // L25 debug: Terminated block@0: // L25 -debug: Sealing block@0: // L68 -debug: Terminated block@0: // L68 +debug: Sealing block@0: // L109 +debug: Terminated block@0: // L109 debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@None: // and_contd_L15 @@ -2695,6 +2753,354 @@ debug: Inserted main_block@0.ops[1]: 'store tmp%6#0 to l-stack (copy)' debug: Replaced main_block@0.ops[6]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[14]: 'store tmp%9#0 to l-stack (copy)' debug: Replaced main_block@0.ops[19]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.ir +info: Optimizing test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: array_data%0#3, dynamic_bytes#0 +debug: Replacing {array_data%0#3} with dynamic_bytes#0 made 1 modifications +debug: Found equivalence set: array_length%4#0, reverse_index_internal%7#0 +debug: Found equivalence set: array_length%15#0, reverse_index_internal%18#0 +debug: Found equivalence set: array_length%29#0, reverse_index_internal%32#0 +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x0003 0x02) to 0x000302 +debug: Simplified (* item_index_internal%6#1 1u) to item_index_internal%6#1 +debug: Simplified ((extract 2 0) 0x00020304) to 0x0304 +debug: Simplified (== 0x00020304 "/x00/x02/x03/x04") to 1u +debug: Simplified (extract_uint16 0x00020304 0u) to 2u +debug: Simplified ((extract 2 0) 0x00020304) to 0x0304 +debug: Simplified (* item_index_internal%17#1 1u) to item_index_internal%17#1 +debug: Simplified ((extract 2 0) 0x00020304) to 0x0304 +debug: Simplified (extract_uint16 0x00020304 0u) to 2u +debug: Simplified ((extract 2 0) 0x00020304) to 0x0304 +debug: Simplified (* item_index_internal%31#1 1u) to item_index_internal%31#1 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#0 +debug: Removing unused variable dynamic_bytes2#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@3: // for_footer_L16 with block@2: // for_body_L16 in block@1: // for_header_L16 +debug: Merged linear block@3: // for_footer_L16 into block@2: // for_body_L16 +debug: Replaced predecessor block@7: // for_footer_L25 with block@6: // for_body_L25 in block@5: // for_header_L25 +debug: Merged linear block@7: // for_footer_L25 into block@6: // for_body_L25 +debug: Replaced predecessor block@11: // for_footer_L32 with block@10: // for_body_L32 in block@9: // for_header_L32 +debug: Merged linear block@11: // for_footer_L32 into block@10: // for_body_L32 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Replacing redundant declaration let array_value%5#0: bytes = ((extract 2 0) dynamic_bytes#0) with copy of existing registers [Register(atype=bytes, name='tmp%1', version=0, source_location=arc4_types/dynamic_bytes.py:13:15-37)] +debug: Found equivalence set: tmp%1#0, array_value%5#0 +debug: Replacing {array_value%5#0} with tmp%1#0 made 1 modifications +debug: Found equivalence set: item_index_internal%6#1, item_index%9#0 +debug: Replacing {item_index%9#0} with item_index_internal%6#1 made 1 modifications +debug: Found equivalence set: item_index_internal%17#1, item_index%20#0 +debug: Replacing {item_index%20#0} with item_index_internal%17#1 made 1 modifications +debug: Found equivalence set: item_index_internal%31#1, item_index%34#0 +debug: Replacing {item_index%34#0} with item_index_internal%31#1 made 1 modifications +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x000302 0x03) to 0x00030203 +debug: Simplified (== 0x0304 "/x03/x04") to 1u +debug: Simplified (len 0x0304) to 2u +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#1 +debug: Removing unused variable tmp%12#0 +debug: Removing unused variable tmp%14#0 +debug: Removing unused variable array_length%15#0 +debug: Removing unused variable array_value%16#0 +debug: Removing unused variable tmp%22#0 +debug: Removing unused variable array_length%29#0 +debug: Removing unused variable array_value%30#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x00030203 0x01) to 0x0003020301 +debug: Simplified ((extract 6 2) value_as_bytes%24#0) to 0x0002 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#2 +debug: Removing unused variable tmp%13#0 +debug: Removing unused variable length%23#0 +debug: Removing unused variable value_as_bytes%24#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified ((extract 2 0) 0x0003020301) to 0x020301 +debug: Simplified (== 0x0003020301 "/x00/x03/x02/x03/x01") to 1u +debug: Simplified (extract_uint16 0x0003020301 0u) to 3u +debug: Simplified (concat 0x0002 0x0304) to 0x00020304 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable dynamic_bytes#0 +debug: Removing unused variable value_as_uint16%25#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (== 0x020301 "/x02/x03/x01") to 1u +debug: Simplified ((extract 2 0) 0x00020304) to 0x0304 +debug: Simplified (== 0x00020304 "/x00/x02/x03/x04") to 1u +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%1#0 +debug: Removing unused variable tmp%3#0 +debug: Removing unused variable array_length%4#0 +debug: Removing unused variable dynamic_bytes3#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (== 0x0304 "/x03/x04") to 1u +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%2#0 +debug: Removing unused variable tmp%26#0 +debug: Removing unused variable tmp%28#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%27#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.ssa.opt_pass_7.ir +debug: Begin optimization pass 8/100 +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: No optimizations performed in pass 8, ending loop +debug: Removing Phis from test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: Removing Phis from test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Coalescing local variables in test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program using strategy RootOperandGrouping +debug: Coalescing total#0 with [total#9, total#1, total#2, total#12, total#3, total#4, total#15, total#5, total#6] +debug: Coalescing item_index_internal%6#0 with [item_index_internal%6#5, item_index_internal%6#1, item_index_internal%6#2] +debug: Coalescing uint8_item#0 with [uint8_item#1, uint8_item#2] +debug: Coalescing item_index_internal%17#0 with [item_index_internal%17#5, item_index_internal%17#1, item_index_internal%17#2] +debug: Coalescing item_index_internal%31#0 with [item_index_internal%31#5, item_index_internal%31#1, item_index_internal%31#2] +debug: Coalescing resulted in 56 replacement/s +debug: Coalescing local variables in test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Sequentializing parallel copies in test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: loc: {item_index_internal%6#0=item_index_internal%6#0, total#0=total#0} +debug: pred: {item_index_internal%6#0=item_index_internal%6#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%6#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%6#0 +debug: loc: {item_index_internal%6#0=item_index_internal%6#0, total#0=total#0} +debug: pred: {item_index_internal%6#0=item_index_internal%6#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%6#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%6#0 +debug: loc: {item_index_internal%6#0=item_index_internal%6#0, total#0=total#0} +debug: pred: {item_index_internal%6#0=item_index_internal%6#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%6#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%6#0 +debug: loc: {item_index_internal%17#0=item_index_internal%17#0, total#0=total#0} +debug: pred: {item_index_internal%17#0=item_index_internal%17#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%17#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%17#0 +debug: loc: {item_index_internal%17#0=item_index_internal%17#0, total#0=total#0} +debug: pred: {item_index_internal%17#0=item_index_internal%17#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%17#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%17#0 +debug: loc: {item_index_internal%17#0=item_index_internal%17#0, total#0=total#0} +debug: pred: {item_index_internal%17#0=item_index_internal%17#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%17#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%17#0 +debug: loc: {item_index_internal%31#0=item_index_internal%31#0, total#0=total#0} +debug: pred: {item_index_internal%31#0=item_index_internal%31#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%31#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%31#0 +debug: loc: {item_index_internal%31#0=item_index_internal%31#0, total#0=total#0} +debug: pred: {item_index_internal%31#0=item_index_internal%31#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%31#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%31#0 +debug: loc: {item_index_internal%31#0=item_index_internal%31#0, total#0=total#0} +debug: pred: {item_index_internal%31#0=item_index_internal%31#0, total#0=total#0} +debug: ready: +debug: to_do: item_index_internal%31#0, total#0 +debug: * to_do total#0 +debug: * to_do item_index_internal%31#0 +debug: Sequentializing parallel copies in test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.clear_state_program +debug: Performing post-SSA optimizations +debug: Output IR to arc4_types/out/Arc4DynamicBytesContract.destructured.ir +debug: Inserted main_for_header@1.ops[3]: 'store continue_looping%8#0 to l-stack (copy)' +debug: Replaced main_for_header@1.ops[5]: 'load continue_looping%8#0' with 'load continue_looping%8#0 from l-stack (no copy)' +debug: Inserted main_for_body@2.ops[4]: 'store uint8_item#0 to l-stack (copy)' +debug: Replaced main_for_body@2.ops[6]: 'load uint8_item#0' with 'load uint8_item#0 from l-stack (no copy)' +debug: Inserted main_for_body@2.ops[8]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_for_body@2.ops[11]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_for_body@2.ops[2]: 'store item_index_internal%6#0 to l-stack (copy)' +debug: Replaced main_for_body@2.ops[15]: 'load item_index_internal%6#0' with 'load item_index_internal%6#0 from l-stack (no copy)' +debug: Inserted main_after_for@4.ops[3]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_after_for@4.ops[5]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_for_header@5.ops[3]: 'store continue_looping%19#0 to l-stack (copy)' +debug: Replaced main_for_header@5.ops[5]: 'load continue_looping%19#0' with 'load continue_looping%19#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[4]: 'store uint8_item#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[6]: 'load uint8_item#0' with 'load uint8_item#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[8]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[11]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[2]: 'store item_index_internal%17#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[15]: 'load item_index_internal%17#0' with 'load item_index_internal%17#0 from l-stack (no copy)' +debug: Inserted main_for_header@9.ops[3]: 'store continue_looping%33#0 to l-stack (copy)' +debug: Replaced main_for_header@9.ops[5]: 'load continue_looping%33#0' with 'load continue_looping%33#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[4]: 'store uint8_item#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[6]: 'load uint8_item#0' with 'load uint8_item#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[8]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[11]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[2]: 'store item_index_internal%31#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[15]: 'load item_index_internal%31#0' with 'load item_index_internal%31#0 from l-stack (no copy)' +debug: Inserted main_after_for@12.ops[3]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_after_for@12.ops[5]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Found 6 edge set/s for test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program +debug: test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program f-stack entry: ['item_index_internal%17#0', 'item_index_internal%31#0'] +debug: test_cases.arc4_types.dynamic_bytes.Arc4DynamicBytesContract.approval_program f-stack on first store: ['total#0', 'item_index_internal%6#0'] debug: Output IR to arc4_types/out/Arc4DynamicStringArrayContract.ssa.ir info: Optimizing test_cases.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract at level 1 debug: Begin optimization pass 1/100 @@ -9711,11 +10117,29 @@ debug: Simplified (len 0x7fffffffffffffff00) to 9u debug: Simplified (len 0x7fffffffffffffff00) to 9u debug: Simplified (len 0x7fffffffffffffff00) to 9u debug: Simplified (len 0x0000015333430684) to 8u +debug: Simplified (btoi 0x0000015333430684) to 1456853943940u +debug: Simplified (len 0x000001519abc2400) to 8u +debug: Simplified (btoi 0x000001519abc2400) to 1450000000000u +debug: Simplified (len 0x000009184e72a000) to 8u +debug: Simplified (btoi 0x000009184e72a000) to 10000000000000u +debug: Simplified (len 0x00000002540be400) to 8u +debug: Simplified (btoi 0x00000002540be400) to 10000000000u +debug: Simplified (len 0x0000000000000000) to 8u +debug: Simplified (btoi 0x0000000000000000) to 0u +debug: Simplified (== tmp%60#0 0u) to (! tmp%60#0) +debug: Simplified (len 0x0000000000000064) to 8u +debug: Simplified (btoi 0x0000000000000064) to 100u +debug: Simplified (len 0x000000000000000a) to 8u +debug: Simplified (btoi 0x000000000000000a) to 10u +debug: Simplified (len 0x0000000000000001) to 8u +debug: Simplified (btoi 0x0000000000000001) to 1u +debug: Simplified (len 0xffffffffffffffff) to 8u +debug: Simplified (btoi 0xffffffffffffffff) to 18446744073709551615u debug: Simplified (len 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) to 64u debug: Simplified (len 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) to 64u -debug: Simplified (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%48#0) to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +debug: Simplified (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%82#0) to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff debug: Simplified (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) to 64u -debug: Simplified (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%53#0) to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +debug: Simplified (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%87#0) to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff debug: Simplified (b+ 1b 1b) to 2b debug: Simplified (b== 1b 0x00000000000000000000000000000001) to 1u debug: Optimizer: Remove Unused Variables @@ -9728,9 +10152,17 @@ debug: Removing unused variable awst_tmp%18#0 debug: Removing unused variable awst_tmp%26#0 debug: Removing unused variable awst_tmp%34#0 debug: Removing unused variable decimals#0 +debug: Removing unused variable decimals_from_truncated_str#0 +debug: Removing unused variable thousand#0 +debug: Removing unused variable one_decimal#0 +debug: Removing unused variable zero_decimal#0 +debug: Removing unused variable small_decimal#0 +debug: Removing unused variable smaller_decimal#0 +debug: Removing unused variable smallest_decimal#0 +debug: Removing unused variable sixty_four_decimal#0 debug: Removing unused variable really_big_int#0 -debug: Removing unused variable b_zeros%48#0 -debug: Removing unused variable b_zeros%53#0 +debug: Removing unused variable b_zeros%82#0 +debug: Removing unused variable b_zeros%87#0 debug: Removing unused variable biguint#0 debug: Removing unused variable arc4_biguint_const#0 debug: Optimizer: Simplify Control Ops @@ -9762,12 +10194,29 @@ debug: Simplified (< 2u 9u) to 1u debug: Simplified (< 4u 9u) to 1u debug: Simplified (< 8u 9u) to 1u debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 1456853943940u 1456853943940u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 1450000000000u 1450000000000u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 10000000000000u 10000000000000u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 10000000000u 10000000000u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (! 0u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 100u 100u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 10u 10u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 1u 1u) to 1u +debug: Simplified (== 8u 8u) to 1u +debug: Simplified (== 18446744073709551615u 18446744073709551615u) to 1u debug: Simplified (== 64u 64u) to 1u debug: Simplified (<= 64u 64u) to 1u debug: Simplified (b== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) to 1u debug: Simplified (<= 64u 64u) to 1u debug: Simplified (len 2b) to 1u -debug: Simplified (b| 2b b_zeros%57#0) to 0x00000000000000000000000000000002 +debug: Simplified (b| 2b b_zeros%91#0) to 0x00000000000000000000000000000002 debug: Simplified (len 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) to 64u debug: Optimizer: Remove Unused Variables debug: Removing unused variable int8_encoded#0 @@ -9783,13 +10232,30 @@ debug: Removing unused variable tmp%35#0 debug: Removing unused variable tmp%36#0 debug: Removing unused variable tmp%42#0 debug: Removing unused variable tmp%44#0 -debug: Removing unused variable len_%46#0 -debug: Removing unused variable tmp%49#0 -debug: Removing unused variable len_%51#0 -debug: Removing unused variable really_big_decimal#0 +debug: Removing unused variable tmp%46#0 +debug: Removing unused variable tmp%48#0 +debug: Removing unused variable tmp%50#0 +debug: Removing unused variable tmp%52#0 debug: Removing unused variable tmp%54#0 -debug: Removing unused variable b_zeros%57#0 +debug: Removing unused variable tmp%56#0 debug: Removing unused variable tmp%58#0 +debug: Removing unused variable tmp%60#0 +debug: Removing unused variable tmp%62#0 +debug: Removing unused variable tmp%64#0 +debug: Removing unused variable tmp%66#0 +debug: Removing unused variable tmp%68#0 +debug: Removing unused variable tmp%70#0 +debug: Removing unused variable tmp%72#0 +debug: Removing unused variable tmp%74#0 +debug: Removing unused variable tmp%76#0 +debug: Removing unused variable tmp%78#0 +debug: Removing unused variable len_%80#0 +debug: Removing unused variable tmp%83#0 +debug: Removing unused variable len_%85#0 +debug: Removing unused variable really_big_decimal#0 +debug: Removing unused variable tmp%88#0 +debug: Removing unused variable b_zeros%91#0 +debug: Removing unused variable tmp%92#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -9829,12 +10295,29 @@ debug: Removing unused variable tmp%29#0 debug: Removing unused variable tmp%37#0 debug: Removing unused variable tmp%43#0 debug: Removing unused variable tmp%45#0 -debug: Removing unused variable no_overflow%47#0 -debug: Removing unused variable tmp%50#0 -debug: Removing unused variable no_overflow%52#0 -debug: Removing unused variable len_%55#0 -debug: Removing unused variable arc4_biguint_dynamic#0 +debug: Removing unused variable tmp%47#0 +debug: Removing unused variable tmp%49#0 +debug: Removing unused variable tmp%51#0 +debug: Removing unused variable tmp%53#0 +debug: Removing unused variable tmp%55#0 +debug: Removing unused variable tmp%57#0 +debug: Removing unused variable tmp%59#0 debug: Removing unused variable tmp%61#0 +debug: Removing unused variable tmp%63#0 +debug: Removing unused variable tmp%65#0 +debug: Removing unused variable tmp%67#0 +debug: Removing unused variable tmp%69#0 +debug: Removing unused variable tmp%71#0 +debug: Removing unused variable tmp%73#0 +debug: Removing unused variable tmp%75#0 +debug: Removing unused variable tmp%77#0 +debug: Removing unused variable tmp%79#0 +debug: Removing unused variable no_overflow%81#0 +debug: Removing unused variable tmp%84#0 +debug: Removing unused variable no_overflow%86#0 +debug: Removing unused variable len_%89#0 +debug: Removing unused variable arc4_biguint_dynamic#0 +debug: Removing unused variable tmp%95#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -9869,9 +10352,9 @@ debug: Removing unused variable tmp%14#0 debug: Removing unused variable tmp%22#0 debug: Removing unused variable tmp%30#0 debug: Removing unused variable tmp%38#0 -debug: Removing unused variable no_overflow%56#0 -debug: Removing unused variable tmp%59#0 -debug: Removing unused variable tmp%62#0 +debug: Removing unused variable no_overflow%90#0 +debug: Removing unused variable tmp%93#0 +debug: Removing unused variable tmp%96#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -9904,7 +10387,7 @@ debug: Removing unused variable tmp%15#0 debug: Removing unused variable tmp%23#0 debug: Removing unused variable tmp%31#0 debug: Removing unused variable tmp%39#0 -debug: Removing unused variable tmp%60#0 +debug: Removing unused variable tmp%94#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10106,14 +10589,14 @@ debug: Found equivalence set: some_bytes_as_string#0, awst_tmp%4#0 debug: Replacing {awst_tmp%4#0} with some_bytes_as_string#0 made 4 modifications debug: Found equivalence set: concat_result%34#0, thing#1 debug: Replacing {concat_result%34#0} with thing#1 made 1 modifications -debug: Found equivalence set: concat_result%56#0, value#0 -debug: Replacing {concat_result%56#0} with value#0 made 1 modifications -debug: Found equivalence set: concat_result%63#0, value#1 -debug: Replacing {concat_result%63#0} with value#1 made 1 modifications -debug: Found equivalence set: concat_result%70#0, value#2 -debug: Replacing {concat_result%70#0} with value#2 made 1 modifications -debug: Found equivalence set: concat_result%77#0, value#3 -debug: Replacing {concat_result%77#0} with value#3 made 1 modifications +debug: Found equivalence set: concat_result%49#0, value#0 +debug: Replacing {concat_result%49#0} with value#0 made 1 modifications +debug: Found equivalence set: concat_result%56#0, value#1 +debug: Replacing {concat_result%56#0} with value#1 made 1 modifications +debug: Found equivalence set: concat_result%63#0, value#2 +debug: Replacing {concat_result%63#0} with value#2 made 1 modifications +debug: Found equivalence set: concat_result%70#0, value#3 +debug: Replacing {concat_result%70#0} with value#3 made 1 modifications debug: Optimizer: Intrinsic Simplifier debug: Simplified (len "Hello World!") to 12u debug: Simplified ((extract 2 0) "/x00/x05Hello") to "Hello" @@ -10123,8 +10606,7 @@ debug: Simplified ((extract 2 0) "/x00/x02hi") to "hi" debug: Simplified ((extract 2 0) "/x00/x02hi") to "hi" debug: Simplified ((extract 2 0) "/x00/x01a") to "a" debug: Simplified ((extract 2 0) "/x00/x01b") to "b" -debug: Simplified ((extract 2 0) "/x00/x01c") to "c" -debug: Simplified ((extract 2 0) "/x00/x01d") to "d" +debug: Simplified ((extract 2 0) "/x00/x02cd") to "cd" debug: Simplified ((extract 2 0) "/x00/x01e") to "e" debug: Simplified ((extract 2 0) "/x00/x01f") to "f" debug: Simplified ((extract 2 0) "/x00/x01g") to "g" @@ -10178,7 +10660,6 @@ debug: Removing unused variable expr_value_trimmed%44#0 debug: Removing unused variable expr_value_trimmed%51#0 debug: Removing unused variable expr_value_trimmed%58#0 debug: Removing unused variable expr_value_trimmed%65#0 -debug: Removing unused variable expr_value_trimmed%72#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10331,7 +10812,7 @@ debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (substring3 0x000c48656c6c6f20576f726c6421 2u 14u) to 0x48656c6c6f20576f726c6421 debug: Simplified (concat 0x48656c6c6f20 "World!") to 0x48656c6c6f20576f726c6421 -debug: Simplified (concat 0x6162 "c") to 0x616263 +debug: Simplified (concat 0x6162 "cd") to 0x61626364 debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%8#0 debug: Removing unused variable expr_value_trimmed%20#0 @@ -10360,7 +10841,7 @@ debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (== "Hello World!" 0x48656c6c6f20576f726c6421) to 1u debug: Simplified (len 0x48656c6c6f20576f726c6421) to 12u -debug: Simplified (len 0x616263) to 3u +debug: Simplified (len 0x61626364) to 4u debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%10#0 debug: Removing unused variable concatenated%22#0 @@ -10387,7 +10868,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified ((extract 6 0) len_bytes%24#0) to 0x000c -debug: Simplified ((extract 6 0) len_bytes%47#0) to 0x0003 +debug: Simplified ((extract 6 0) len_bytes%47#0) to 0x0004 debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%11#0 debug: Removing unused variable len_%23#0 @@ -10416,7 +10897,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (concat 0x000c 0x48656c6c6f20576f726c6421) to 0x000c48656c6c6f20576f726c6421 -debug: Simplified (concat 0x0003 0x616263) to 0x0003616263 +debug: Simplified (concat 0x0004 0x61626364) to 0x000461626364 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_16_bit%25#0 debug: Removing unused variable len_16_bit%48#0 @@ -10442,10 +10923,10 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (== "/x00/x0cHello World!" 0x000c48656c6c6f20576f726c6421) to 1u -debug: Simplified ((extract 2 0) 0x0003616263) to 0x616263 +debug: Simplified ((extract 2 0) 0x000461626364) to 0x61626364 debug: Optimizer: Remove Unused Variables debug: Removing unused variable concat_result%26#0 -debug: Removing unused variable concat_result%49#0 +debug: Removing unused variable value#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10467,7 +10948,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x616263 "d") to 0x61626364 +debug: Simplified (concat 0x61626364 "e") to 0x6162636465 debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%27#0 debug: Removing unused variable expr_value_trimmed%50#0 @@ -10492,7 +10973,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (len 0x61626364) to 4u +debug: Simplified (len 0x6162636465) to 5u debug: Optimizer: Remove Unused Variables debug: Removing unused variable concatenated%52#0 debug: Optimizer: Simplify Control Ops @@ -10516,7 +10997,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 6 0) len_bytes%54#0) to 0x0004 +debug: Simplified ((extract 6 0) len_bytes%54#0) to 0x0005 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_%53#0 debug: Removing unused variable len_bytes%54#0 @@ -10541,7 +11022,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x0004 0x61626364) to 0x000461626364 +debug: Simplified (concat 0x0005 0x6162636465) to 0x00056162636465 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_16_bit%55#0 debug: Optimizer: Simplify Control Ops @@ -10565,9 +11046,9 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 2 0) 0x000461626364) to 0x61626364 +debug: Simplified ((extract 2 0) 0x00056162636465) to 0x6162636465 debug: Optimizer: Remove Unused Variables -debug: Removing unused variable value#0 +debug: Removing unused variable value#1 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10589,7 +11070,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x61626364 "e") to 0x6162636465 +debug: Simplified (concat 0x6162636465 "f") to 0x616263646566 debug: Optimizer: Remove Unused Variables debug: Removing unused variable expr_value_trimmed%57#0 debug: Optimizer: Simplify Control Ops @@ -10613,7 +11094,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (len 0x6162636465) to 5u +debug: Simplified (len 0x616263646566) to 6u debug: Optimizer: Remove Unused Variables debug: Removing unused variable concatenated%59#0 debug: Optimizer: Simplify Control Ops @@ -10637,7 +11118,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 6 0) len_bytes%61#0) to 0x0005 +debug: Simplified ((extract 6 0) len_bytes%61#0) to 0x0006 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_%60#0 debug: Removing unused variable len_bytes%61#0 @@ -10662,7 +11143,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x0005 0x6162636465) to 0x00056162636465 +debug: Simplified (concat 0x0006 0x616263646566) to 0x0006616263646566 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_16_bit%62#0 debug: Optimizer: Simplify Control Ops @@ -10686,9 +11167,9 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 2 0) 0x00056162636465) to 0x6162636465 +debug: Simplified ((extract 2 0) 0x0006616263646566) to 0x616263646566 debug: Optimizer: Remove Unused Variables -debug: Removing unused variable value#1 +debug: Removing unused variable value#2 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10710,7 +11191,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x6162636465 "f") to 0x616263646566 +debug: Simplified (concat 0x616263646566 "g") to 0x61626364656667 debug: Optimizer: Remove Unused Variables debug: Removing unused variable expr_value_trimmed%64#0 debug: Optimizer: Simplify Control Ops @@ -10734,7 +11215,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (len 0x616263646566) to 6u +debug: Simplified (len 0x61626364656667) to 7u debug: Optimizer: Remove Unused Variables debug: Removing unused variable concatenated%66#0 debug: Optimizer: Simplify Control Ops @@ -10758,7 +11239,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 6 0) len_bytes%68#0) to 0x0006 +debug: Simplified ((extract 6 0) len_bytes%68#0) to 0x0007 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_%67#0 debug: Removing unused variable len_bytes%68#0 @@ -10783,7 +11264,7 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x0006 0x616263646566) to 0x0006616263646566 +debug: Simplified (concat 0x0007 0x61626364656667) to 0x000761626364656667 debug: Optimizer: Remove Unused Variables debug: Removing unused variable len_16_bit%69#0 debug: Optimizer: Simplify Control Ops @@ -10807,9 +11288,9 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 2 0) 0x0006616263646566) to 0x616263646566 +debug: Simplified (== "/x00/x07abcdefg" 0x000761626364656667) to 1u debug: Optimizer: Remove Unused Variables -debug: Removing unused variable value#2 +debug: Removing unused variable value#3 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10831,9 +11312,8 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x616263646566 "g") to 0x61626364656667 debug: Optimizer: Remove Unused Variables -debug: Removing unused variable expr_value_trimmed%71#0 +debug: Removing unused variable tmp%71#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -10855,126 +11335,6 @@ debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContrac debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier -debug: Simplified (len 0x61626364656667) to 7u -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable concatenated%73#0 -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Output IR to arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_28.ir -debug: Begin optimization pass 29/100 -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Simplified ((extract 6 0) len_bytes%75#0) to 0x0007 -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable len_%74#0 -debug: Removing unused variable len_bytes%75#0 -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Output IR to arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_29.ir -debug: Begin optimization pass 30/100 -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Simplified (concat 0x0007 0x61626364656667) to 0x000761626364656667 -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable len_16_bit%76#0 -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Output IR to arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_30.ir -debug: Begin optimization pass 31/100 -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Simplified (== "/x00/x07abcdefg" 0x000761626364656667) to 1u -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable value#3 -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Output IR to arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_31.ir -debug: Begin optimization pass 32/100 -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable tmp%78#0 -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Control Ops -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizer: Repeated Expression Elimination -debug: Output IR to arc4_types/out/Arc4StringTypesContract.ssa.opt_pass_32.ir -debug: Begin optimization pass 33/100 -debug: Optimizing subroutine test_cases.arc4_types.string.Arc4StringTypesContract.approval_program -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump @@ -10991,7 +11351,7 @@ debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination -debug: No optimizations performed in pass 33, ending loop +debug: No optimizations performed in pass 28, ending loop debug: Removing Phis from test_cases.arc4_types.string.Arc4StringTypesContract.approval_program debug: Removing Phis from test_cases.arc4_types.string.Arc4StringTypesContract.clear_state_program debug: Coalescing local variables in test_cases.arc4_types.string.Arc4StringTypesContract.approval_program using strategy RootOperandGrouping @@ -13268,9 +13628,12 @@ info: Writing arc4_types/out/Arc4BoolTypeContract.approval.teal info: Writing arc4_types/out/Arc4BoolTypeContract.clear.teal info: Writing arc4_types/out/Arc4BoolEvalContract.approval.teal info: Writing arc4_types/out/Arc4BoolEvalContract.clear.teal +info: Writing arc4_types/out/Arc4DynamicBytesContract.approval.teal +info: Writing arc4_types/out/Arc4DynamicBytesContract.clear.teal info: Writing arc4_types/out/Arc4DynamicStringArrayContract.approval.teal info: Writing arc4_types/out/Arc4DynamicStringArrayContract.clear.teal info: Writing arc4_types/out/Arc4DynamicStringArrayContract.arc32.json +info: Writing arc4_types/out/client_Arc4DynamicStringArrayContract.py info: Writing arc4_types/out/Arc4MutableParamsContract.approval.teal info: Writing arc4_types/out/Arc4MutableParamsContract.clear.teal info: Writing arc4_types/out/Arc4MutationContract.approval.teal diff --git a/test_cases/arc4_types/string.py b/test_cases/arc4_types/string.py index 48009955eb..1519b99b9c 100644 --- a/test_cases/arc4_types/string.py +++ b/test_cases/arc4_types/string.py @@ -32,10 +32,10 @@ def approval_program(self) -> bool: thing += thing assert thing == String("hihi") - value = String("a") + Bytes(b"b") + b"c" + "d" + value = String("a") + String(Bytes(b"b")) + "cd" value += "e" - value += b"f" - value += Bytes(b"g") + value += String("f") + value += String(Bytes(b"g")) assert String("abcdefg") == value return True diff --git a/test_cases/asset/puya.log b/test_cases/asset/puya.log index 6c5b89986e..2d8679aa1b 100644 --- a/test_cases/asset/puya.log +++ b/test_cases/asset/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['asset'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['asset'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/augmented_assignment/puya.log b/test_cases/augmented_assignment/puya.log index 4cb63a4373..85d670c568 100644 --- a/test_cases/augmented_assignment/puya.log +++ b/test_cases/augmented_assignment/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['augmented_assignment'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['augmented_assignment'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/avm_types_in_abi/out/client_TestContract.py b/test_cases/avm_types_in_abi/out/client_TestContract.py new file mode 100644 index 0000000000..5597c58aed --- /dev/null +++ b/test_cases/avm_types_in_abi/out/client_TestContract.py @@ -0,0 +1,17 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class TestContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod(create=True) + def create( + self, + bool_param: puyapy.arc4.Bool, + uint64_param: puyapy.arc4.UInt64, + bytes_param: puyapy.arc4.DynamicBytes, + tuple_param: puyapy.arc4.Tuple[puyapy.arc4.Bool, puyapy.arc4.UInt64, puyapy.arc4.DynamicBytes], + ) -> puyapy.arc4.Tuple[puyapy.arc4.Bool, puyapy.arc4.UInt64, puyapy.arc4.DynamicBytes]: ... diff --git a/test_cases/avm_types_in_abi/puya.log b/test_cases/avm_types_in_abi/puya.log index df39195e1e..a433da204c 100644 --- a/test_cases/avm_types_in_abi/puya.log +++ b/test_cases/avm_types_in_abi/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['avm_types_in_abi'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['avm_types_in_abi'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -592,4 +592,5 @@ debug: shared x-stack for create_bool_true@3 -> create_bool_merge@5: and_result% debug: shared x-stack for create_bool_false@4 -> create_bool_merge@5: and_result%3#0 info: Writing avm_types_in_abi/out/TestContract.approval.teal info: Writing avm_types_in_abi/out/TestContract.clear.teal -info: Writing avm_types_in_abi/out/TestContract.arc32.json \ No newline at end of file +info: Writing avm_types_in_abi/out/TestContract.arc32.json +info: Writing avm_types_in_abi/out/client_TestContract.py \ No newline at end of file diff --git a/test_cases/biguint_binary_ops/puya.log b/test_cases/biguint_binary_ops/puya.log index 69b80a1f65..3bb3db1e8a 100644 --- a/test_cases/biguint_binary_ops/puya.log +++ b/test_cases/biguint_binary_ops/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['biguint_binary_ops'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['biguint_binary_ops'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/boolean_binary_ops/puya.log b/test_cases/boolean_binary_ops/puya.log index 126e57a1b6..33266110f6 100644 --- a/test_cases/boolean_binary_ops/puya.log +++ b/test_cases/boolean_binary_ops/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['boolean_binary_ops'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['boolean_binary_ops'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/bytes_ops/puya.log b/test_cases/bytes_ops/puya.log index 0ec203cca8..3dbbed7181 100644 --- a/test_cases/bytes_ops/puya.log +++ b/test_cases/bytes_ops/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['bytes_ops'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['bytes_ops'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/callsub/puya.log b/test_cases/callsub/puya.log index c129dc242a..0d944fe7e4 100644 --- a/test_cases/callsub/puya.log +++ b/test_cases/callsub/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['callsub'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['callsub'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/chained_assignment/puya.log b/test_cases/chained_assignment/puya.log index ba2dc6b0e1..ca5a0bca10 100644 --- a/test_cases/chained_assignment/puya.log +++ b/test_cases/chained_assignment/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['chained_assignment'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['chained_assignment'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/conditional_execution/puya.log b/test_cases/conditional_execution/puya.log index 3b3a9c8237..af1396046e 100644 --- a/test_cases/conditional_execution/puya.log +++ b/test_cases/conditional_execution/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['conditional_execution'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['conditional_execution'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) conditional_execution/contract.py:10:9 warning: expression result is ignored conditional_execution/contract.py:16:9 warning: expression result is ignored conditional_execution/contract.py:22:9 warning: expression result is ignored diff --git a/test_cases/conditional_expressions/puya.log b/test_cases/conditional_expressions/puya.log index ed89f8f717..e6448601c8 100644 --- a/test_cases/conditional_expressions/puya.log +++ b/test_cases/conditional_expressions/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['conditional_expressions'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['conditional_expressions'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/constants/puya.log b/test_cases/constants/puya.log index ea2519a243..69e79668fa 100644 --- a/test_cases/constants/puya.log +++ b/test_cases/constants/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['constants'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['constants'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) constants/non_utf8.py:1 warning: UH OH SPAGHETTI-O's, darn tootin' non-utf8(?!) encoded file encountered: constants/non_utf8.py encoded as iso-8859-7 debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 diff --git a/test_cases/contains/puya.log b/test_cases/contains/puya.log index 7042633c9a..2e550e09f1 100644 --- a/test_cases/contains/puya.log +++ b/test_cases/contains/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['contains'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['contains'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/control_op_simplification/puya.log b/test_cases/control_op_simplification/puya.log index 815c782722..d8ba154a79 100644 --- a/test_cases/control_op_simplification/puya.log +++ b/test_cases/control_op_simplification/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['control_op_simplification'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['control_op_simplification'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/edverify/puya.log b/test_cases/edverify/puya.log index 9b8ed621a9..72589001e7 100644 --- a/test_cases/edverify/puya.log +++ b/test_cases/edverify/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['edverify'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['edverify'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/enumeration/puya.log b/test_cases/enumeration/puya.log index 88578ca1e0..281637ca11 100644 --- a/test_cases/enumeration/puya.log +++ b/test_cases/enumeration/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['enumeration'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['enumeration'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/everything/out/client_MyContract.py b/test_cases/everything/out/client_MyContract.py new file mode 100644 index 0000000000..6729ff1049 --- /dev/null +++ b/test_cases/everything/out/client_MyContract.py @@ -0,0 +1,36 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class MyContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod(create=True) + def create( + self, + ) -> None: ... + + @puyapy.arc4.abimethod(allow_actions=['NoOp', 'OptIn']) + def register( + self, + name: puyapy.arc4.String, + ) -> None: ... + + @puyapy.arc4.abimethod + def say_hello( + self, + ) -> puyapy.arc4.String: ... + + @puyapy.arc4.abimethod + def calculate( + self, + a: puyapy.arc4.UInt64, + b: puyapy.arc4.UInt64, + ) -> puyapy.arc4.UInt64: ... + + @puyapy.arc4.abimethod(allow_actions=['CloseOut']) + def close_out( + self, + ) -> None: ... diff --git a/test_cases/everything/out/contract.awst b/test_cases/everything/out/contract.awst index 51b6b15200..f978d1be67 100644 --- a/test_cases/everything/out/contract.awst +++ b/test_cases/everything/out/contract.awst @@ -64,10 +64,10 @@ contract Everything extends (test_cases.everything.my_base::MyMiddleBase, test_c return arc4_encode('Hello, ', puyapy.arc4.String) + name + arc4_encode('!', puyapy.arc4.String) } - abimethod calculate(a: puyapy.arc4.UIntN[typing.Literal[64]], b: puyapy.arc4.UIntN[typing.Literal[64]]): puyapy.arc4.UIntN[typing.Literal[64]] + abimethod calculate(a: puyapy.arc4.UInt64, b: puyapy.arc4.UInt64): puyapy.arc4.UInt64 { - c: puyapy.arc4.UIntN[typing.Literal[64]] = test_cases.everything.my_base::MyMiddleBase::calculate(a, b) - return arc4_encode(arc4_decode(c, puyapy.UInt64) * arc4_decode(b, puyapy.UInt64), puyapy.arc4.UIntN[typing.Literal[64]]) + c: puyapy.arc4.UInt64 = test_cases.everything.my_base::MyMiddleBase::calculate(a, b) + return arc4_encode(arc4_decode(c, puyapy.UInt64) * arc4_decode(b, puyapy.UInt64), puyapy.arc4.UInt64) } abimethod close_out(): None diff --git a/test_cases/everything/out/my_base.awst b/test_cases/everything/out/my_base.awst index fcae20995e..1ee1cdb7b3 100644 --- a/test_cases/everything/out/my_base.awst +++ b/test_cases/everything/out/my_base.awst @@ -12,9 +12,9 @@ abstract contract MyBase abstract contract MyMiddleBase extends (test_cases.everything.my_base::MyBase) { - subroutine calculate(a: puyapy.arc4.UIntN[typing.Literal[64]], b: puyapy.arc4.UIntN[typing.Literal[64]]): puyapy.arc4.UIntN[typing.Literal[64]] + subroutine calculate(a: puyapy.arc4.UInt64, b: puyapy.arc4.UInt64): puyapy.arc4.UInt64 { - return arc4_encode(arc4_decode(a, puyapy.UInt64) + arc4_decode(b, puyapy.UInt64), puyapy.arc4.UIntN[typing.Literal[64]]) + return arc4_encode(arc4_decode(a, puyapy.UInt64) + arc4_decode(b, puyapy.UInt64), puyapy.arc4.UInt64) } } diff --git a/test_cases/everything/puya.log b/test_cases/everything/puya.log index 8ee6f627f2..11b9da94ca 100644 --- a/test_cases/everything/puya.log +++ b/test_cases/everything/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['everything'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['everything'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1019,4 +1019,5 @@ debug: Inserted _remove_sender_block@0.ops[5]: 'store counter_value%0#0 to l-sta debug: Replaced _remove_sender_block@0.ops[12]: 'load counter_value%0#0' with 'load counter_value%0#0 from l-stack (no copy)' info: Writing everything/out/MyContract.approval.teal info: Writing everything/out/MyContract.clear.teal -info: Writing everything/out/MyContract.arc32.json \ No newline at end of file +info: Writing everything/out/MyContract.arc32.json +info: Writing everything/out/client_MyContract.py \ No newline at end of file diff --git a/test_cases/inner_transactions/out/Greeter.approval.mir b/test_cases/inner_transactions/out/Greeter.approval.mir index a0bc521599..70ca347655 100644 --- a/test_cases/inner_transactions/out/Greeter.approval.mir +++ b/test_cases/inner_transactions/out/Greeter.approval.mir @@ -166,21 +166,21 @@ log_greetings_block@0: swap // store greeting#0 to l-stack (no copy) (𝕡) name#0 | greeting#0,hello_call%%LastLog#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 // virtual: load hello_call%%LastLog#0 from l-stack (no copy) (𝕡) name#0 | greeting#0,hello_call%%LastLog#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 extract 0 4 // (𝕡) name#0 | greeting#0,{extract} arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 - // virtual: store tmp%4#0 to l-stack (no copy) (𝕡) name#0 | greeting#0,tmp%4#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 - // virtual: load tmp%4#0 from l-stack (no copy) (𝕡) name#0 | greeting#0,tmp%4#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 - byte 0x151f7c75 // (𝕡) name#0 | greeting#0,tmp%4#0,0x151f7c75 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 - == // (𝕡) name#0 | greeting#0,{==} arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 // virtual: store tmp%5#0 to l-stack (no copy) (𝕡) name#0 | greeting#0,tmp%5#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 // virtual: load tmp%5#0 from l-stack (no copy) (𝕡) name#0 | greeting#0,tmp%5#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 + byte 0x151f7c75 // (𝕡) name#0 | greeting#0,tmp%5#0,0x151f7c75 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 + == // (𝕡) name#0 | greeting#0,{==} arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 + // virtual: store tmp%6#0 to l-stack (no copy) (𝕡) name#0 | greeting#0,tmp%6#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 + // virtual: load tmp%6#0 from l-stack (no copy) (𝕡) name#0 | greeting#0,tmp%6#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 assert // ARC4 prefix is valid // (𝕡) name#0 | greeting#0 arc4.String.from_log(hello_call.last_log) inner_transactions/c2c.py:30 // virtual: load greeting#0 from l-stack (no copy) (𝕡) name#0 | greeting#0 greeting.decode() inner_transactions/c2c.py:31 extract 2 0 // (𝕡) name#0 | {extract} greeting.decode() inner_transactions/c2c.py:31 - // virtual: store tmp%9#0 to l-stack (no copy) (𝕡) name#0 | tmp%9#0 greeting.decode() inner_transactions/c2c.py:31 - byte "HelloWorld returned: " // (𝕡) name#0 | tmp%9#0,"HelloWorld returned: " greeting.decode() inner_transactions/c2c.py:31 - swap // load tmp%9#0 from l-stack (no copy) (𝕡) name#0 | "HelloWorld returned: ",tmp%9#0 greeting.decode() inner_transactions/c2c.py:31 - concat // (𝕡) name#0 | {concat} greeting.decode() inner_transactions/c2c.py:31 // virtual: store tmp%10#0 to l-stack (no copy) (𝕡) name#0 | tmp%10#0 greeting.decode() inner_transactions/c2c.py:31 - // virtual: load tmp%10#0 from l-stack (no copy) (𝕡) name#0 | tmp%10#0 log(b"HelloWorld returned: ", greeting.decode()) inner_transactions/c2c.py:31 + byte "HelloWorld returned: " // (𝕡) name#0 | tmp%10#0,"HelloWorld returned: " greeting.decode() inner_transactions/c2c.py:31 + swap // load tmp%10#0 from l-stack (no copy) (𝕡) name#0 | "HelloWorld returned: ",tmp%10#0 greeting.decode() inner_transactions/c2c.py:31 + concat // (𝕡) name#0 | {concat} greeting.decode() inner_transactions/c2c.py:31 + // virtual: store tmp%11#0 to l-stack (no copy) (𝕡) name#0 | tmp%11#0 greeting.decode() inner_transactions/c2c.py:31 + // virtual: load tmp%11#0 from l-stack (no copy) (𝕡) name#0 | tmp%11#0 log(b"HelloWorld returned: ", greeting.decode()) inner_transactions/c2c.py:31 log // (𝕡) name#0 | log(b"HelloWorld returned: ", greeting.decode()) inner_transactions/c2c.py:31 retsub // diff --git a/test_cases/inner_transactions/out/Greeter.destructured.ir b/test_cases/inner_transactions/out/Greeter.destructured.ir index 05909d7ee9..3575f8a6ee 100644 --- a/test_cases/inner_transactions/out/Greeter.destructured.ir +++ b/test_cases/inner_transactions/out/Greeter.destructured.ir @@ -72,12 +72,12 @@ contract test_cases.inner_transactions.c2c.Greeter: itxn_submit let hello_call%%LastLog#0: bytes = (itxn LastLog) let greeting#0: bytes = ((extract 4 0) hello_call%%LastLog#0) - let tmp%4#0: bytes = ((extract 0 4) hello_call%%LastLog#0) - let tmp%5#0: uint64 = (== tmp%4#0 0x151f7c75) - (assert tmp%5#0) // ARC4 prefix is valid - let tmp%9#0: bytes = ((extract 2 0) greeting#0) - let tmp%10#0: bytes = (concat "HelloWorld returned: " tmp%9#0) - (log tmp%10#0) + let tmp%5#0: bytes = ((extract 0 4) hello_call%%LastLog#0) + let tmp%6#0: uint64 = (== tmp%5#0 0x151f7c75) + (assert tmp%6#0) // ARC4 prefix is valid + let tmp%10#0: bytes = ((extract 2 0) greeting#0) + let tmp%11#0: bytes = (concat "HelloWorld returned: " tmp%10#0) + (log tmp%11#0) return subroutine test_cases.inner_transactions.c2c.Greeter.__init__() -> void: diff --git a/test_cases/inner_transactions/out/Greeter.ssa.ir b/test_cases/inner_transactions/out/Greeter.ssa.ir index fe6050f4c5..23a7dddc8b 100644 --- a/test_cases/inner_transactions/out/Greeter.ssa.ir +++ b/test_cases/inner_transactions/out/Greeter.ssa.ir @@ -315,16 +315,17 @@ contract test_cases.inner_transactions.c2c.Greeter: let hello_call%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) let hello_call%%VoteLast#0: uint64 = (itxn VoteLast) let hello_call%%XferAsset#0: uint64 = (itxn XferAsset) - let tmp%3#0: bytes = ((extract 4 0) hello_call%%LastLog#0) - let tmp%4#0: bytes = ((extract 0 4) hello_call%%LastLog#0) - let tmp%5#0: uint64 = (== tmp%4#0 0x151f7c75) - let (value%6#0: bytes, check%7#0: uint64) = (tmp%3#0, tmp%5#0) - (assert check%7#0) // ARC4 prefix is valid - let greeting#0: bytes = value%6#0 - let tmp%8#0: bytes = (concat "HelloWorld returned: " "") - let tmp%9#0: bytes = ((extract 2 0) greeting#0) - let tmp%10#0: bytes = (concat tmp%8#0 tmp%9#0) - (log tmp%10#0) + let awst_tmp%3#0: bytes = hello_call%%LastLog#0 + let tmp%4#0: bytes = ((extract 4 0) awst_tmp%3#0) + let tmp%5#0: bytes = ((extract 0 4) awst_tmp%3#0) + let tmp%6#0: uint64 = (== tmp%5#0 0x151f7c75) + let (value%7#0: bytes, check%8#0: uint64) = (tmp%4#0, tmp%6#0) + (assert check%8#0) // ARC4 prefix is valid + let greeting#0: bytes = value%7#0 + let tmp%9#0: bytes = (concat "HelloWorld returned: " "") + let tmp%10#0: bytes = ((extract 2 0) greeting#0) + let tmp%11#0: bytes = (concat tmp%9#0 tmp%10#0) + (log tmp%11#0) return subroutine test_cases.inner_transactions.c2c.Greeter.__init__() -> void: diff --git a/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_1.ir b/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_1.ir index 6070ccac72..ec63da4cb5 100644 --- a/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_1.ir +++ b/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_1.ir @@ -72,13 +72,13 @@ contract test_cases.inner_transactions.c2c.Greeter: itxn_submit let hello_call%%LastLog#0: bytes = (itxn LastLog) let greeting#0: bytes = ((extract 4 0) hello_call%%LastLog#0) - let tmp%4#0: bytes = ((extract 0 4) hello_call%%LastLog#0) - let tmp%5#0: uint64 = (== tmp%4#0 0x151f7c75) - (assert tmp%5#0) // ARC4 prefix is valid - let tmp%8#0: bytes = "HelloWorld returned: " - let tmp%9#0: bytes = ((extract 2 0) greeting#0) - let tmp%10#0: bytes = (concat tmp%8#0 tmp%9#0) - (log tmp%10#0) + let tmp%5#0: bytes = ((extract 0 4) hello_call%%LastLog#0) + let tmp%6#0: uint64 = (== tmp%5#0 0x151f7c75) + (assert tmp%6#0) // ARC4 prefix is valid + let tmp%9#0: bytes = "HelloWorld returned: " + let tmp%10#0: bytes = ((extract 2 0) greeting#0) + let tmp%11#0: bytes = (concat tmp%9#0 tmp%10#0) + (log tmp%11#0) return subroutine test_cases.inner_transactions.c2c.Greeter.__init__() -> void: diff --git a/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_2.ir b/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_2.ir index 05909d7ee9..3575f8a6ee 100644 --- a/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_2.ir +++ b/test_cases/inner_transactions/out/Greeter.ssa.opt_pass_2.ir @@ -72,12 +72,12 @@ contract test_cases.inner_transactions.c2c.Greeter: itxn_submit let hello_call%%LastLog#0: bytes = (itxn LastLog) let greeting#0: bytes = ((extract 4 0) hello_call%%LastLog#0) - let tmp%4#0: bytes = ((extract 0 4) hello_call%%LastLog#0) - let tmp%5#0: uint64 = (== tmp%4#0 0x151f7c75) - (assert tmp%5#0) // ARC4 prefix is valid - let tmp%9#0: bytes = ((extract 2 0) greeting#0) - let tmp%10#0: bytes = (concat "HelloWorld returned: " tmp%9#0) - (log tmp%10#0) + let tmp%5#0: bytes = ((extract 0 4) hello_call%%LastLog#0) + let tmp%6#0: uint64 = (== tmp%5#0 0x151f7c75) + (assert tmp%6#0) // ARC4 prefix is valid + let tmp%10#0: bytes = ((extract 2 0) greeting#0) + let tmp%11#0: bytes = (concat "HelloWorld returned: " tmp%10#0) + (log tmp%11#0) return subroutine test_cases.inner_transactions.c2c.Greeter.__init__() -> void: diff --git a/test_cases/inner_transactions/out/c2c.awst b/test_cases/inner_transactions/out/c2c.awst index 1327d29355..6acde94769 100644 --- a/test_cases/inner_transactions/out/c2c.awst +++ b/test_cases/inner_transactions/out/c2c.awst @@ -19,7 +19,7 @@ contract Greeter abimethod log_greetings(name: puyapy.arc4.String): None { hello_call: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationID=this.hello_app, ApplicationArgs=(Method("hello(string)string"), name))) - greeting: puyapy.arc4.String = reinterpret_cast(checked_maybe((extract<4, 0>(reinterpret_cast(hello_call.LastLog)), extract<0, 4>(reinterpret_cast(hello_call.LastLog)) == hex<"151F7C75">))) + greeting: puyapy.arc4.String = reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=0, source=hello_call.LastLog)), extract<0, 4>(SINGLE_EVAL(id=0, source=hello_call.LastLog)) == hex<"151F7C75">))) log(concat(concat('HelloWorld returned: ', ''), arc4_decode(greeting, puyapy.Bytes))) } } \ No newline at end of file diff --git a/test_cases/inner_transactions/out/client_Greeter.py b/test_cases/inner_transactions/out/client_Greeter.py new file mode 100644 index 0000000000..d5d8bcde36 --- /dev/null +++ b/test_cases/inner_transactions/out/client_Greeter.py @@ -0,0 +1,19 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Greeter(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def bootstrap( + self, + ) -> puyapy.arc4.UInt64: ... + + @puyapy.arc4.abimethod + def log_greetings( + self, + name: puyapy.arc4.String, + ) -> None: ... diff --git a/test_cases/inner_transactions/out_O2/Greeter.destructured.ir b/test_cases/inner_transactions/out_O2/Greeter.destructured.ir index 05909d7ee9..3575f8a6ee 100644 --- a/test_cases/inner_transactions/out_O2/Greeter.destructured.ir +++ b/test_cases/inner_transactions/out_O2/Greeter.destructured.ir @@ -72,12 +72,12 @@ contract test_cases.inner_transactions.c2c.Greeter: itxn_submit let hello_call%%LastLog#0: bytes = (itxn LastLog) let greeting#0: bytes = ((extract 4 0) hello_call%%LastLog#0) - let tmp%4#0: bytes = ((extract 0 4) hello_call%%LastLog#0) - let tmp%5#0: uint64 = (== tmp%4#0 0x151f7c75) - (assert tmp%5#0) // ARC4 prefix is valid - let tmp%9#0: bytes = ((extract 2 0) greeting#0) - let tmp%10#0: bytes = (concat "HelloWorld returned: " tmp%9#0) - (log tmp%10#0) + let tmp%5#0: bytes = ((extract 0 4) hello_call%%LastLog#0) + let tmp%6#0: uint64 = (== tmp%5#0 0x151f7c75) + (assert tmp%6#0) // ARC4 prefix is valid + let tmp%10#0: bytes = ((extract 2 0) greeting#0) + let tmp%11#0: bytes = (concat "HelloWorld returned: " tmp%10#0) + (log tmp%11#0) return subroutine test_cases.inner_transactions.c2c.Greeter.__init__() -> void: diff --git a/test_cases/inner_transactions/out_unoptimized/Greeter.destructured.ir b/test_cases/inner_transactions/out_unoptimized/Greeter.destructured.ir index 6fe4f6c7b5..2f896a65f6 100644 --- a/test_cases/inner_transactions/out_unoptimized/Greeter.destructured.ir +++ b/test_cases/inner_transactions/out_unoptimized/Greeter.destructured.ir @@ -91,17 +91,18 @@ contract test_cases.inner_transactions.c2c.Greeter: block@1: // next_txn_L26 itxn_submit let hello_call%%LastLog#0: bytes = (itxn LastLog) - let tmp%3#0: bytes = ((extract 4 0) hello_call%%LastLog#0) - let tmp%4#0: bytes = ((extract 0 4) hello_call%%LastLog#0) - let tmp%5#0: uint64 = (== tmp%4#0 0x151f7c75) - let value%6#0: bytes = tmp%3#0 - let check%7#0: uint64 = tmp%5#0 - (assert check%7#0) // ARC4 prefix is valid - let greeting#0: bytes = value%6#0 - let tmp%8#0: bytes = (concat "HelloWorld returned: " "") - let tmp%9#0: bytes = ((extract 2 0) greeting#0) - let tmp%10#0: bytes = (concat tmp%8#0 tmp%9#0) - (log tmp%10#0) + let awst_tmp%3#0: bytes = hello_call%%LastLog#0 + let tmp%4#0: bytes = ((extract 4 0) awst_tmp%3#0) + let tmp%5#0: bytes = ((extract 0 4) awst_tmp%3#0) + let tmp%6#0: uint64 = (== tmp%5#0 0x151f7c75) + let value%7#0: bytes = tmp%4#0 + let check%8#0: uint64 = tmp%6#0 + (assert check%8#0) // ARC4 prefix is valid + let greeting#0: bytes = value%7#0 + let tmp%9#0: bytes = (concat "HelloWorld returned: " "") + let tmp%10#0: bytes = ((extract 2 0) greeting#0) + let tmp%11#0: bytes = (concat tmp%9#0 tmp%10#0) + (log tmp%11#0) return subroutine test_cases.inner_transactions.c2c.Greeter.__init__() -> void: diff --git a/test_cases/inner_transactions/puya.log b/test_cases/inner_transactions/puya.log index dd616b4d04..2ac37accbb 100644 --- a/test_cases/inner_transactions/puya.log +++ b/test_cases/inner_transactions/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['inner_transactions'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['inner_transactions'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1125,10 +1125,12 @@ debug: Found equivalence set: name#0, inner_txn_params%0%%param_ApplicationArgs_ debug: Replacing {inner_txn_params%0%%param_ApplicationArgs_idx_1#0} with name#0 made 1 modifications debug: Found equivalence set: hello_app_value%1#0, inner_txn_params%0%%param_ApplicationID_idx_0#0 debug: Replacing {inner_txn_params%0%%param_ApplicationID_idx_0#0} with hello_app_value%1#0 made 1 modifications -debug: Found equivalence set: tmp%3#0, value%6#0, greeting#0 -debug: Replacing {tmp%3#0, value%6#0} with greeting#0 made 1 modifications -debug: Found equivalence set: tmp%5#0, check%7#0 -debug: Replacing {check%7#0} with tmp%5#0 made 1 modifications +debug: Found equivalence set: hello_call%%LastLog#0, awst_tmp%3#0 +debug: Replacing {awst_tmp%3#0} with hello_call%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%4#0, value%7#0, greeting#0 +debug: Replacing {tmp%4#0, value%7#0} with greeting#0 made 1 modifications +debug: Found equivalence set: tmp%6#0, check%8#0 +debug: Replacing {check%8#0} with tmp%6#0 made 1 modifications debug: Optimizer: Intrinsic Simplifier debug: Simplified (concat "HelloWorld returned: " "") to "HelloWorld returned: " debug: Optimizer: Remove Unused Variables @@ -1301,7 +1303,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Removing unused variable tmp%8#0 +debug: Removing unused variable tmp%9#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -1451,16 +1453,16 @@ debug: Inserted bootstrap_block@0.ops[36]: 'store hello_app_value%5#0 to l-stack debug: Replaced bootstrap_block@0.ops[40]: 'load hello_app_value%5#0' with 'load hello_app_value%5#0 from l-stack (no copy)' debug: Inserted log_greetings_block@0.ops[18]: 'store hello_call%%LastLog#0 to l-stack (copy)' debug: Replaced log_greetings_block@0.ops[20]: 'load hello_call%%LastLog#0' with 'load hello_call%%LastLog#0 from l-stack (no copy)' -debug: Inserted log_greetings_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced log_greetings_block@0.ops[27]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' -debug: Inserted log_greetings_block@0.ops[30]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced log_greetings_block@0.ops[32]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' -debug: Inserted log_greetings_block@0.ops[40]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced log_greetings_block@0.ops[42]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted log_greetings_block@0.ops[25]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced log_greetings_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted log_greetings_block@0.ops[30]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced log_greetings_block@0.ops[32]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted log_greetings_block@0.ops[40]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced log_greetings_block@0.ops[42]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted log_greetings_block@0.ops[4]: 'store hello_app_exists%2#0 to l-stack (copy)' debug: Replaced log_greetings_block@0.ops[7]: 'load hello_app_exists%2#0' with 'load hello_app_exists%2#0 from l-stack (no copy)' -debug: Inserted log_greetings_block@0.ops[37]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced log_greetings_block@0.ops[40]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted log_greetings_block@0.ops[37]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced log_greetings_block@0.ops[40]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted log_greetings_block@0.ops[22]: 'store hello_call%%LastLog#0 to l-stack (copy)' debug: Replaced log_greetings_block@0.ops[25]: 'load hello_call%%LastLog#0' with 'load hello_call%%LastLog#0 from l-stack (no copy)' debug: Inserted log_greetings_block@0.ops[6]: 'store hello_app_value%1#0 to l-stack (copy)' @@ -5348,6 +5350,7 @@ debug: test_cases.inner_transactions.itxn_loop.MyContract.approval_program f-sta info: Writing inner_transactions/out/Greeter.approval.teal info: Writing inner_transactions/out/Greeter.clear.teal info: Writing inner_transactions/out/Greeter.arc32.json +info: Writing inner_transactions/out/client_Greeter.py info: Writing inner_transactions/out/MyContract.approval.teal info: Writing inner_transactions/out/MyContract.clear.teal info: Writing inner_transactions/out/itxn_loop.approval.teal diff --git a/test_cases/intrinsics/puya.log b/test_cases/intrinsics/puya.log index c8c8a16dc0..2b18dce8d4 100644 --- a/test_cases/intrinsics/puya.log +++ b/test_cases/intrinsics/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['intrinsics'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['intrinsics'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/koopman/puya.log b/test_cases/koopman/puya.log index 1ee0f235a7..eb7e5ea8ad 100644 --- a/test_cases/koopman/puya.log +++ b/test_cases/koopman/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['koopman'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['koopman'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/less_simple/puya.log b/test_cases/less_simple/puya.log index 30a81b0bfa..c54ac16f59 100644 --- a/test_cases/less_simple/puya.log +++ b/test_cases/less_simple/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['less_simple'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['less_simple'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/log/out/contract.awst b/test_cases/log/out/contract.awst index 198bf8b8a9..15da962d93 100644 --- a/test_cases/log/out/contract.awst +++ b/test_cases/log/out/contract.awst @@ -7,9 +7,9 @@ contract MyContract log('2') log(itob(txn() + 3u)) log((reinterpret_cast(txn())) ? ('4') : ('')) - log(concat(concat(concat(concat(concat(concat(concat(concat('5', ''), itob(6u)), ''), itob(txn() + 7u)), ''), reinterpret_cast(8n)), ''), (reinterpret_cast(txn())) ? ('9') : (''))) - log(concat(concat(concat(concat(concat(concat(concat(concat('5', '_'), itob(6u)), '_'), itob(txn() + 7u)), '_'), reinterpret_cast(8n)), '_'), (reinterpret_cast(txn())) ? ('9') : (''))) - log(concat(concat(concat(concat(concat(concat(concat(concat('5', '_'), itob(6u)), '_'), itob(txn() + 7u)), '_'), reinterpret_cast(8n)), '_'), (reinterpret_cast(txn())) ? ('9') : (''))) + log(concat(concat(concat(concat(concat(concat(concat(concat('5', ''), itob(6u)), ''), itob(txn() + 7u)), ''), 8n), ''), (reinterpret_cast(txn())) ? ('9') : (''))) + log(concat(concat(concat(concat(concat(concat(concat(concat('5', '_'), itob(6u)), '_'), itob(txn() + 7u)), '_'), 8n), '_'), (reinterpret_cast(txn())) ? ('9') : (''))) + log(concat(concat(concat(concat(concat(concat(concat(concat('5', '_'), itob(6u)), '_'), itob(txn() + 7u)), '_'), 8n), '_'), (reinterpret_cast(txn())) ? ('9') : (''))) return true } diff --git a/test_cases/log/puya.log b/test_cases/log/puya.log index 310adbaab3..3345a80aac 100644 --- a/test_cases/log/puya.log +++ b/test_cases/log/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['log'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['log'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/match/puya.log b/test_cases/match/puya.log index c28d25eef7..dfb62293cd 100644 --- a/test_cases/match/puya.log +++ b/test_cases/match/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['match'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['match'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/module_consts/puya.log b/test_cases/module_consts/puya.log index 9fd989f8fb..461c052635 100644 --- a/test_cases/module_consts/puya.log +++ b/test_cases/module_consts/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['module_consts'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['module_consts'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/mylib/puya.log b/test_cases/mylib/puya.log index 8e5f85c573..1cd094f7a3 100644 --- a/test_cases/mylib/puya.log +++ b/test_cases/mylib/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['mylib'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['mylib'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/nested_loops/puya.log b/test_cases/nested_loops/puya.log index 20337fbe25..16c6258789 100644 --- a/test_cases/nested_loops/puya.log +++ b/test_cases/nested_loops/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['nested_loops'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['nested_loops'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/regression_118/out/client_Contract.py b/test_cases/regression_118/out/client_Contract.py new file mode 100644 index 0000000000..074c09de45 --- /dev/null +++ b/test_cases/regression_118/out/client_Contract.py @@ -0,0 +1,14 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Contract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def verify( + self, + values: puyapy.arc4.DynamicArray[puyapy.arc4.UInt256], + ) -> puyapy.arc4.Tuple[puyapy.arc4.Bool, puyapy.arc4.String]: ... diff --git a/test_cases/regression_118/out/contract.awst b/test_cases/regression_118/out/contract.awst index f8ae18d133..c5d17612eb 100644 --- a/test_cases/regression_118/out/contract.awst +++ b/test_cases/regression_118/out/contract.awst @@ -1,6 +1,6 @@ contract Contract { - abimethod verify(values: puyapy.arc4.DynamicArray[puyapy.arc4.BigUIntN[typing.Literal[256]]]): puyapy.arc4.Tuple[puyapy.arc4.Bool, puyapy.arc4.String] + abimethod verify(values: puyapy.arc4.DynamicArray[puyapy.arc4.UInt256]): puyapy.arc4.Tuple[puyapy.arc4.Bool, puyapy.arc4.String] { val1: puyapy.arc4.Bool = arc4_encode(reinterpret_cast(txn()), puyapy.arc4.Bool) if (extract_uint16(values, 0u) != 2u) { diff --git a/test_cases/regression_118/puya.log b/test_cases/regression_118/puya.log index 4d6d88b4de..de13922325 100644 --- a/test_cases/regression_118/puya.log +++ b/test_cases/regression_118/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['regression_118'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['regression_118'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -510,4 +510,5 @@ debug: shared x-stack for verify_block@0 -> verify_if_body@1: val1#0 debug: shared x-stack for verify_block@0 -> verify_after_if_else@2: val1#0 info: Writing regression_118/out/Contract.approval.teal info: Writing regression_118/out/Contract.clear.teal -info: Writing regression_118/out/Contract.arc32.json \ No newline at end of file +info: Writing regression_118/out/Contract.arc32.json +info: Writing regression_118/out/client_Contract.py \ No newline at end of file diff --git a/test_cases/reversed_iteration/out/contract.awst b/test_cases/reversed_iteration/out/contract.awst index c247a9687c..717935e5e9 100644 --- a/test_cases/reversed_iteration/out/contract.awst +++ b/test_cases/reversed_iteration/out/contract.awst @@ -5,16 +5,16 @@ contract MyContract for i in reversed(range(0u, 0u, 1u)) { log(itob(i)) } - for x in reversed(arc4_array_encode([], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[0]])) { + for x in reversed(arc4_array_encode([], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[0]])) { log(reinterpret_cast(x)) } - test_array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] = arc4_array_encode([0arc4u8, 0arc4u8, 0arc4u8, 0arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]]) + test_array: puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]] = arc4_array_encode([0arc4u8, 0arc4u8, 0arc4u8, 0arc4u8], puyapy.arc4.StaticArray[puyapy.arc4.UInt8, typing.Literal[4]]) for (index, item) in enumerate(reversed(range(0u, 4u, 1u))) { - test_array[index]: puyapy.arc4.UIntN[typing.Literal[8]] = arc4_encode(item, puyapy.arc4.UIntN[typing.Literal[8]]) + test_array[index]: puyapy.arc4.UInt8 = arc4_encode(item, puyapy.arc4.UInt8) } assert(reinterpret_cast(test_array) == hex<"03020100">) for (index, item) in reversed(enumerate(reversed(range(4u, 8u, 1u)))) { - test_array[index]: puyapy.arc4.UIntN[typing.Literal[8]] = arc4_encode(item, puyapy.arc4.UIntN[typing.Literal[8]]) + test_array[index]: puyapy.arc4.UInt8 = arc4_encode(item, puyapy.arc4.UInt8) if (index == 2u) { break } diff --git a/test_cases/reversed_iteration/puya.log b/test_cases/reversed_iteration/puya.log index 780ea604aa..66c7adcd6f 100644 --- a/test_cases/reversed_iteration/puya.log +++ b/test_cases/reversed_iteration/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['reversed_iteration'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['reversed_iteration'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/scratch_slots/puya.log b/test_cases/scratch_slots/puya.log index e6b0d44693..d316047931 100644 --- a/test_cases/scratch_slots/puya.log +++ b/test_cases/scratch_slots/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['scratch_slots'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['scratch_slots'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/simple/puya.log b/test_cases/simple/puya.log index e352978174..402ad77fe4 100644 --- a/test_cases/simple/puya.log +++ b/test_cases/simple/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['simple'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['simple'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/simplish/puya.log b/test_cases/simplish/puya.log index f21ea8c844..f6c0b6ef69 100644 --- a/test_cases/simplish/puya.log +++ b/test_cases/simplish/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['simplish'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['simplish'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/ssa/puya.log b/test_cases/ssa/puya.log index 05b62d7b9d..d01961fa31 100644 --- a/test_cases/ssa/puya.log +++ b/test_cases/ssa/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['ssa'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['ssa'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/ssa2/puya.log b/test_cases/ssa2/puya.log index d0483e0abe..5c8087bf16 100644 --- a/test_cases/ssa2/puya.log +++ b/test_cases/ssa2/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['ssa2'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['ssa2'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/state_proxies/out/client_StateProxyContract.py b/test_cases/state_proxies/out/client_StateProxyContract.py new file mode 100644 index 0000000000..7abdd7d1da --- /dev/null +++ b/test_cases/state_proxies/out/client_StateProxyContract.py @@ -0,0 +1,13 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class StateProxyContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod(allow_actions=['OptIn'], create=True) + def create( + self, + ) -> None: ... diff --git a/test_cases/state_proxies/puya.log b/test_cases/state_proxies/puya.log index 811d4e3019..a4ddac3c26 100644 --- a/test_cases/state_proxies/puya.log +++ b/test_cases/state_proxies/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['state_proxies'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['state_proxies'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -435,4 +435,5 @@ debug: Inserted create_block@0.ops[11]: 'store tmp%1#0 to l-stack (copy)' debug: Replaced create_block@0.ops[13]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' info: Writing state_proxies/out/StateProxyContract.approval.teal info: Writing state_proxies/out/StateProxyContract.clear.teal -info: Writing state_proxies/out/StateProxyContract.arc32.json \ No newline at end of file +info: Writing state_proxies/out/StateProxyContract.arc32.json +info: Writing state_proxies/out/client_StateProxyContract.py \ No newline at end of file diff --git a/test_cases/string_ops/puya.log b/test_cases/string_ops/puya.log index 87cd2672e2..e6d97b73e7 100644 --- a/test_cases/string_ops/puya.log +++ b/test_cases/string_ops/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['string_ops'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['string_ops'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/stubs/puya.log b/test_cases/stubs/puya.log index 0f89a1ad53..e9cc874b26 100644 --- a/test_cases/stubs/puya.log +++ b/test_cases/stubs/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['stubs'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['stubs'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/template_variables/out/client_TemplateVariablesContract.py b/test_cases/template_variables/out/client_TemplateVariablesContract.py new file mode 100644 index 0000000000..bdad71d449 --- /dev/null +++ b/test_cases/template_variables/out/client_TemplateVariablesContract.py @@ -0,0 +1,18 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class TemplateVariablesContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def get_bytes( + self, + ) -> puyapy.arc4.DynamicBytes: ... + + @puyapy.arc4.abimethod + def get_big_uint( + self, + ) -> puyapy.arc4.UInt512: ... diff --git a/test_cases/template_variables/out/contract.awst b/test_cases/template_variables/out/contract.awst index 797d17f096..1eb048bf0a 100644 --- a/test_cases/template_variables/out/contract.awst +++ b/test_cases/template_variables/out/contract.awst @@ -5,10 +5,10 @@ contract TemplateVariablesContract return TemplateVar[puyapy.Bytes](TMPL_SOME_BYTES) } - abimethod get_big_uint(): puyapy.arc4.BigUIntN[typing.Literal[512]] + abimethod get_big_uint(): puyapy.arc4.UInt512 { x: puyapy.BigUInt = TemplateVar[puyapy.BigUInt](TMPL_SOME_BIG_UINT) - return arc4_encode(x, puyapy.arc4.BigUIntN[typing.Literal[512]]) + return arc4_encode(x, puyapy.arc4.UInt512) } abimethod on_update(): None diff --git a/test_cases/template_variables/puya.log b/test_cases/template_variables/puya.log index af707efb5f..1bb58fc9cb 100644 --- a/test_cases/template_variables/puya.log +++ b/test_cases/template_variables/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['template_variables'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['template_variables'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -550,4 +550,5 @@ debug: Inserted get_big_uint_block@0.ops[4]: 'store x#0 to l-stack (copy)' debug: Replaced get_big_uint_block@0.ops[19]: 'load x#0' with 'load x#0 from l-stack (no copy)' info: Writing template_variables/out/TemplateVariablesContract.approval.teal info: Writing template_variables/out/TemplateVariablesContract.clear.teal -info: Writing template_variables/out/TemplateVariablesContract.arc32.json \ No newline at end of file +info: Writing template_variables/out/TemplateVariablesContract.arc32.json +info: Writing template_variables/out/client_TemplateVariablesContract.py \ No newline at end of file diff --git a/test_cases/too_many_permutations/puya.log b/test_cases/too_many_permutations/puya.log index ddb23a792f..b2a0157e21 100644 --- a/test_cases/too_many_permutations/puya.log +++ b/test_cases/too_many_permutations/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['too_many_permutations'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['too_many_permutations'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/transaction/contract.py b/test_cases/transaction/contract.py index 3eab6d80d2..37d92d3b4f 100644 --- a/test_cases/transaction/contract.py +++ b/test_cases/transaction/contract.py @@ -94,9 +94,9 @@ def application_call(self, txn: gtxn.ApplicationCallTransaction) -> None: assert txn.num_assets, "num_assets" assert txn.num_apps, "num_apps" assert txn.global_num_uint, "global_num_uint" - assert txn.global_num_byte_slice, "global_num_byte_slice" + assert txn.global_num_bytes, "global_num_bytes" assert txn.local_num_uint, "local_num_uint" - assert txn.local_num_byte_slice, "local_num_byte_slice" + assert txn.local_num_bytes, "local_num_bytes" assert txn.extra_program_pages, "extra_program_pages" assert txn.last_log, "last_log" assert txn.num_approval_program_pages, "num_approval_program_pages" diff --git a/test_cases/transaction/out/TransactionContract.approval.mir b/test_cases/transaction/out/TransactionContract.approval.mir index f1b2c32da9..bb2127d700 100644 --- a/test_cases/transaction/out/TransactionContract.approval.mir +++ b/test_cases/transaction/out/TransactionContract.approval.mir @@ -780,21 +780,21 @@ application_call_block@0: // virtual: store tmp%10#0 to l-stack (no copy) (𝕡) txn#0 | tmp%10#0 txn.global_num_uint transaction/contract.py:96 // virtual: load tmp%10#0 from l-stack (no copy) (𝕡) txn#0 | tmp%10#0 assert txn.global_num_uint, "global_num_uint" transaction/contract.py:96 assert // global_num_uint // (𝕡) txn#0 | assert txn.global_num_uint, "global_num_uint" transaction/contract.py:96 - frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn.global_num_byte_slice transaction/contract.py:97 - gtxns GlobalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.global_num_byte_slice transaction/contract.py:97 - // virtual: store tmp%11#0 to l-stack (no copy) (𝕡) txn#0 | tmp%11#0 txn.global_num_byte_slice transaction/contract.py:97 - // virtual: load tmp%11#0 from l-stack (no copy) (𝕡) txn#0 | tmp%11#0 assert txn.global_num_byte_slice, "global_num_byte_slice" transaction/contract.py:97 - assert // global_num_byte_slice // (𝕡) txn#0 | assert txn.global_num_byte_slice, "global_num_byte_slice" transaction/contract.py:97 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn.global_num_bytes transaction/contract.py:97 + gtxns GlobalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.global_num_bytes transaction/contract.py:97 + // virtual: store tmp%11#0 to l-stack (no copy) (𝕡) txn#0 | tmp%11#0 txn.global_num_bytes transaction/contract.py:97 + // virtual: load tmp%11#0 from l-stack (no copy) (𝕡) txn#0 | tmp%11#0 assert txn.global_num_bytes, "global_num_bytes" transaction/contract.py:97 + assert // global_num_bytes // (𝕡) txn#0 | assert txn.global_num_bytes, "global_num_bytes" transaction/contract.py:97 frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn.local_num_uint transaction/contract.py:98 gtxns LocalNumUint // (𝕡) txn#0 | {gtxns} txn.local_num_uint transaction/contract.py:98 // virtual: store tmp%12#0 to l-stack (no copy) (𝕡) txn#0 | tmp%12#0 txn.local_num_uint transaction/contract.py:98 // virtual: load tmp%12#0 from l-stack (no copy) (𝕡) txn#0 | tmp%12#0 assert txn.local_num_uint, "local_num_uint" transaction/contract.py:98 assert // local_num_uint // (𝕡) txn#0 | assert txn.local_num_uint, "local_num_uint" transaction/contract.py:98 - frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn.local_num_byte_slice transaction/contract.py:99 - gtxns LocalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.local_num_byte_slice transaction/contract.py:99 - // virtual: store tmp%13#0 to l-stack (no copy) (𝕡) txn#0 | tmp%13#0 txn.local_num_byte_slice transaction/contract.py:99 - // virtual: load tmp%13#0 from l-stack (no copy) (𝕡) txn#0 | tmp%13#0 assert txn.local_num_byte_slice, "local_num_byte_slice" transaction/contract.py:99 - assert // local_num_byte_slice // (𝕡) txn#0 | assert txn.local_num_byte_slice, "local_num_byte_slice" transaction/contract.py:99 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn.local_num_bytes transaction/contract.py:99 + gtxns LocalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.local_num_bytes transaction/contract.py:99 + // virtual: store tmp%13#0 to l-stack (no copy) (𝕡) txn#0 | tmp%13#0 txn.local_num_bytes transaction/contract.py:99 + // virtual: load tmp%13#0 from l-stack (no copy) (𝕡) txn#0 | tmp%13#0 assert txn.local_num_bytes, "local_num_bytes" transaction/contract.py:99 + assert // local_num_bytes // (𝕡) txn#0 | assert txn.local_num_bytes, "local_num_bytes" transaction/contract.py:99 frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn.extra_program_pages transaction/contract.py:100 gtxns ExtraProgramPages // (𝕡) txn#0 | {gtxns} txn.extra_program_pages transaction/contract.py:100 // virtual: store tmp%14#0 to l-stack (no copy) (𝕡) txn#0 | tmp%14#0 txn.extra_program_pages transaction/contract.py:100 diff --git a/test_cases/transaction/out/TransactionContract.approval.teal b/test_cases/transaction/out/TransactionContract.approval.teal index 0fdf13400c..9efd504b44 100644 --- a/test_cases/transaction/out/TransactionContract.approval.teal +++ b/test_cases/transaction/out/TransactionContract.approval.teal @@ -631,20 +631,20 @@ application_call: gtxns GlobalNumUint assert // global_num_uint // transaction/contract.py:97 - // assert txn.global_num_byte_slice, "global_num_byte_slice" + // assert txn.global_num_bytes, "global_num_bytes" frame_dig -1 gtxns GlobalNumByteSlice - assert // global_num_byte_slice + assert // global_num_bytes // transaction/contract.py:98 // assert txn.local_num_uint, "local_num_uint" frame_dig -1 gtxns LocalNumUint assert // local_num_uint // transaction/contract.py:99 - // assert txn.local_num_byte_slice, "local_num_byte_slice" + // assert txn.local_num_bytes, "local_num_bytes" frame_dig -1 gtxns LocalNumByteSlice - assert // local_num_byte_slice + assert // local_num_bytes // transaction/contract.py:100 // assert txn.extra_program_pages, "extra_program_pages" frame_dig -1 diff --git a/test_cases/transaction/out/TransactionContract.arc32.json b/test_cases/transaction/out/TransactionContract.arc32.json index 5a8596b43c..9283e11684 100644 --- a/test_cases/transaction/out/TransactionContract.arc32.json +++ b/test_cases/transaction/out/TransactionContract.arc32.json @@ -47,7 +47,7 @@ } }, "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYXBwcm92YWxfcHJvZ3JhbToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIG1ldGhvZCAiY3JlYXRlKCl2b2lkIgogICAgbWV0aG9kICJwYXkocGF5KXZvaWQiCiAgICBtZXRob2QgImtleShrZXlyZWcpdm9pZCIKICAgIG1ldGhvZCAiYXNzZXRfY29uZmlnKGFjZmcpdm9pZCIKICAgIG1ldGhvZCAiYXNzZXRfdHJhbnNmZXIoYXhmZXIpdm9pZCIKICAgIG1ldGhvZCAiYXNzZXRfZnJlZXplKGFmcnopdm9pZCIKICAgIG1ldGhvZCAiYXBwbGljYXRpb25fY2FsbChhcHBsKXZvaWQiCiAgICBtZXRob2QgIm11bHRpcGxlX3R4bnMoYXBwbCxhcHBsLGFwcGwpdm9pZCIKICAgIG1ldGhvZCAiYW55X3R4bih0eG4sdHhuLHR4bil2b2lkIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggbWFpbl9jcmVhdGVfcm91dGVAMSBtYWluX3BheV9yb3V0ZUAyIG1haW5fa2V5X3JvdXRlQDMgbWFpbl9hc3NldF9jb25maWdfcm91dGVANCBtYWluX2Fzc2V0X3RyYW5zZmVyX3JvdXRlQDUgbWFpbl9hc3NldF9mcmVlemVfcm91dGVANiBtYWluX2FwcGxpY2F0aW9uX2NhbGxfcm91dGVANyBtYWluX211bHRpcGxlX3R4bnNfcm91dGVAOCBtYWluX2FueV90eG5fcm91dGVAOQogICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKbWFpbl9jcmVhdGVfcm91dGVAMToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEyCiAgICAvLyBAYXJjNC5hYmltZXRob2QoY3JlYXRlPVRydWUpCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAhCiAgICBhc3NlcnQgLy8gaXMgY3JlYXRpbmcKICAgIGNhbGxzdWIgY3JlYXRlCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX3BheV9yb3V0ZUAyOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAxCiAgICAtCiAgICBkdXAKICAgIGd0eG5zIFR5cGVFbnVtCiAgICBpbnQgcGF5CiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgcGF5CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTozMQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICBjYWxsc3ViIHBheQogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9rZXlfcm91dGVAMzoKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQwCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMQogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50IGtleXJlZwogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGtleXJlZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NDAKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBrZXkKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXNzZXRfY29uZmlnX3JvdXRlQDQ6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo1MQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMQogICAgLy8gY2xhc3MgVHJhbnNhY3Rpb25Db250cmFjdChhcmM0LkFSQzRDb250cmFjdCk6CiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDEKICAgIC0KICAgIGR1cAogICAgZ3R4bnMgVHlwZUVudW0KICAgIGludCBhY2ZnCiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYWNmZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBhc3NldF9jb25maWcKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXNzZXRfdHJhbnNmZXJfcm91dGVANToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjY4CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMQogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50IGF4ZmVyCiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYXhmZXIKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjY4CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgYXNzZXRfdHJhbnNmZXIKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXNzZXRfZnJlZXplX3JvdXRlQDY6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo3NwogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMQogICAgLy8gY2xhc3MgVHJhbnNhY3Rpb25Db250cmFjdChhcmM0LkFSQzRDb250cmFjdCk6CiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDEKICAgIC0KICAgIGR1cAogICAgZ3R4bnMgVHlwZUVudW0KICAgIGludCBhZnJ6CiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYWZyegogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzcKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBhc3NldF9mcmVlemUKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXBwbGljYXRpb25fY2FsbF9yb3V0ZUA3OgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6ODUKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAxCiAgICAtCiAgICBkdXAKICAgIGd0eG5zIFR5cGVFbnVtCiAgICBpbnQgYXBwbAogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGFwcGwKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojg1CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgYXBwbGljYXRpb25fY2FsbAogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9tdWx0aXBsZV90eG5zX3JvdXRlQDg6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMTEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAzCiAgICAtCiAgICBkdXAKICAgIGd0eG5zIFR5cGVFbnVtCiAgICBpbnQgYXBwbAogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGFwcGwKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMgogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50IGFwcGwKICAgID09CiAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBhcHBsCiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDEKICAgIC0KICAgIGR1cAogICAgZ3R4bnMgVHlwZUVudW0KICAgIGludCBhcHBsCiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYXBwbAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTExCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgbXVsdGlwbGVfdHhucwogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9hbnlfdHhuX3JvdXRlQDk6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMjEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAzCiAgICAtCiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDIKICAgIC0KICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMQogICAgLQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTIxCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgYW55X3R4bgogICAgaW50IDEKICAgIHJldHVybgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5jcmVhdGUoKSAtPiB2b2lkOgpjcmVhdGU6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMi0xMwogICAgLy8gQGFyYzQuYWJpbWV0aG9kKGNyZWF0ZT1UcnVlKQogICAgLy8gZGVmIGNyZWF0ZShzZWxmKSAtPiBOb25lOgogICAgcHJvdG8gMCAwCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QucGF5KHR4bjogdWludDY0KSAtPiB2b2lkOgpwYXk6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTozMS0zMgogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgcGF5KHNlbGYsIHR4bjogZ3R4bi5QYXltZW50VHJhbnNhY3Rpb24pIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjMzCiAgICAvLyBzZWxmLl9jb21tb25fY2hlY2tzKHR4bikKICAgIGZyYW1lX2RpZyAtMQogICAgY2FsbHN1YiBfY29tbW9uX2NoZWNrcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzUKICAgIC8vIHR4bi5yZWNlaXZlciA9PSBvcC5HbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFJlY2VpdmVyCiAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgPT0KICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjM0LTM2CiAgICAvLyBhc3NlcnQgKAogICAgLy8gICAgIHR4bi5yZWNlaXZlciA9PSBvcC5HbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzCiAgICAvLyApLCAiUGF5bWVudCBzaG91bGQgYmUgZm9yIHRoaXMgYXBwIgogICAgYXNzZXJ0IC8vIFBheW1lbnQgc2hvdWxkIGJlIGZvciB0aGlzIGFwcAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzcKICAgIC8vIGFzc2VydCB0eG4uYW1vdW50ID4gMTAwMCwgIlBheW1lbnQgc2hvdWxkIGJlIGZvciA+MTAwMCBtaWNybyBhbGdvcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQW1vdW50CiAgICBpbnQgMTAwMAogICAgPgogICAgYXNzZXJ0IC8vIFBheW1lbnQgc2hvdWxkIGJlIGZvciA+MTAwMCBtaWNybyBhbGdvcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzgKICAgIC8vIGFzc2VydCB0eG4uY2xvc2VfcmVtYWluZGVyX3RvID09IG9wLkdsb2JhbC56ZXJvX2FkZHJlc3MsICJjbG9zZV9yZW1haW5kZXJfdG8iCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENsb3NlUmVtYWluZGVyVG8KICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgPT0KICAgIGFzc2VydCAvLyBjbG9zZV9yZW1haW5kZXJfdG8KICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5fY29tbW9uX2NoZWNrcyh0eG46IHVpbnQ2NCkgLT4gdm9pZDoKX2NvbW1vbl9jaGVja3M6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxNi0xNwogICAgLy8gQHN1YnJvdXRpbmUKICAgIC8vIGRlZiBfY29tbW9uX2NoZWNrcyhzZWxmLCB0eG46IGd0eG4uVHJhbnNhY3Rpb25CYXNlKSAtPiBOb25lOgogICAgcHJvdG8gMSAwCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxOAogICAgLy8gYXNzZXJ0IHR4bi50eG5faWQsICJ0eG5faWQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFR4SUQKICAgIGxlbgogICAgYXNzZXJ0IC8vIHR4bl9pZAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTkKICAgIC8vIGFzc2VydCB0eG4uc2VuZGVyID09IG9wLkdsb2JhbC5jcmVhdG9yX2FkZHJlc3MsICJzZW5kZXIiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFNlbmRlcgogICAgZ2xvYmFsIENyZWF0b3JBZGRyZXNzCiAgICA9PQogICAgYXNzZXJ0IC8vIHNlbmRlcgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MjAKICAgIC8vIGFzc2VydCB0eG4uZmVlLCAiZmVlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGZWUKICAgIGFzc2VydCAvLyBmZWUKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjIxCiAgICAvLyBhc3NlcnQgdHhuLnR5cGUsICJ0eXBlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBUeXBlRW51bQogICAgYXNzZXJ0IC8vIHR5cGUKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjIyCiAgICAvLyBhc3NlcnQgdHhuLnR5cGVfYnl0ZXMsICJ0eXBlX2J5dGVzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBUeXBlCiAgICBsZW4KICAgIGFzc2VydCAvLyB0eXBlX2J5dGVzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToyMwogICAgLy8gYXNzZXJ0IHR4bi5ub3RlID09IEJ5dGVzKGIiIiksICJub3RlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOb3RlCiAgICBieXRlICIiCiAgICA9PQogICAgYXNzZXJ0IC8vIG5vdGUKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjI0CiAgICAvLyBhc3NlcnQgdHhuLmdyb3VwX2luZGV4ID09IDAsICJncm91cF9pbmRleCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgR3JvdXBJbmRleAogICAgIQogICAgYXNzZXJ0IC8vIGdyb3VwX2luZGV4CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToyNQogICAgLy8gYXNzZXJ0IHR4bi5maXJzdF92YWxpZCwgImZpcnN0X3ZhbGlkIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGaXJzdFZhbGlkCiAgICBhc3NlcnQgLy8gZmlyc3RfdmFsaWQKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjI2LTI3CiAgICAvLyAjIGFzc2VydCB0eG4uZmlyc3RfdmFsaWRfdGltZSwgImZpcnN0X3ZhbGlkX3RpbWUiICMgdGhpcyB2YWx1ZSBjYW4gYmUgZmxha3kgaW4gdGVzdHMKICAgIC8vIGFzc2VydCB0eG4ubGFzdF92YWxpZCwgImxhc3RfdmFsaWQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIExhc3RWYWxpZAogICAgYXNzZXJ0IC8vIGxhc3RfdmFsaWQKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjI4CiAgICAvLyBhc3NlcnQgdHhuLmxlYXNlLCAibGVhc2UiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIExlYXNlCiAgICBsZW4KICAgIGFzc2VydCAvLyBsZWFzZQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MjkKICAgIC8vIGFzc2VydCB0eG4ucmVrZXlfdG8gPT0gb3AuR2xvYmFsLnplcm9fYWRkcmVzcywgInJla2V5X3RvIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBSZWtleVRvCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgID09CiAgICBhc3NlcnQgLy8gcmVrZXlfdG8KICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5rZXkodHhuOiB1aW50NjQpIC0+IHZvaWQ6CmtleToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQwLTQxCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBrZXkoc2VsZiwgdHhuOiBndHhuLktleVJlZ2lzdHJhdGlvblRyYW5zYWN0aW9uKSAtPiBOb25lOgogICAgcHJvdG8gMSAwCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo0MgogICAgLy8gc2VsZi5fY29tbW9uX2NoZWNrcyh0eG4pCiAgICBmcmFtZV9kaWcgLTEKICAgIGNhbGxzdWIgX2NvbW1vbl9jaGVja3MKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQzCiAgICAvLyBhc3NlcnQgdHhuLnZvdGVfa2V5LCAidm90ZV9rZXkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFZvdGVQSwogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIHZvdGVfa2V5CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo0NAogICAgLy8gYXNzZXJ0IHR4bi5zZWxlY3Rpb25fa2V5LCAic2VsZWN0aW9uX2tleSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgU2VsZWN0aW9uUEsKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyBzZWxlY3Rpb25fa2V5CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo0NQogICAgLy8gYXNzZXJ0IHR4bi52b3RlX2tleV9kaWx1dGlvbiwgInZvdGVfa2V5X2RpbHV0aW9uIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBWb3RlS2V5RGlsdXRpb24KICAgIGFzc2VydCAvLyB2b3RlX2tleV9kaWx1dGlvbgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NDYKICAgIC8vIGFzc2VydCB0eG4udm90ZV9maXJzdCwgInZvdGVfZmlyc3QiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFZvdGVGaXJzdAogICAgYXNzZXJ0IC8vIHZvdGVfZmlyc3QKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQ3CiAgICAvLyBhc3NlcnQgdHhuLnZvdGVfbGFzdCwgInZvdGVfbGFzdCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgVm90ZUxhc3QKICAgIGFzc2VydCAvLyB2b3RlX2xhc3QKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQ4CiAgICAvLyBhc3NlcnQgdHhuLm5vbl9wYXJ0aWNpcGF0aW9uLCAibm9uX3BhcnRpY2lwYXRpb24iCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIE5vbnBhcnRpY2lwYXRpb24KICAgIGFzc2VydCAvLyBub25fcGFydGljaXBhdGlvbgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NDkKICAgIC8vIGFzc2VydCB0eG4uc3RhdGVfcHJvb2Zfa2V5LCAic3RhdGVfcHJvb2Zfa2V5IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBTdGF0ZVByb29mUEsKICAgIGxlbgogICAgYXNzZXJ0IC8vIHN0YXRlX3Byb29mX2tleQogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFzc2V0X2NvbmZpZyh0eG46IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfY29uZmlnOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTEtNTIKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIGFzc2V0X2NvbmZpZyhzZWxmLCB0eG46IGd0eG4uQXNzZXRDb25maWdUcmFuc2FjdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTMKICAgIC8vIHNlbGYuX2NvbW1vbl9jaGVja3ModHhuKQogICAgZnJhbWVfZGlnIC0xCiAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo1NQogICAgLy8gYXNzZXJ0IHR4bi5jb25maWdfYXNzZXQsICJjb25maWdfYXNzZXQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0CiAgICBhc3NlcnQgLy8gY29uZmlnX2Fzc2V0CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo1NgogICAgLy8gYXNzZXJ0IHR4bi50b3RhbCwgInRvdGFsIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldFRvdGFsCiAgICBhc3NlcnQgLy8gdG90YWwKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjU3CiAgICAvLyBhc3NlcnQgdHhuLmRlY2ltYWxzLCAiZGVjaW1hbHMiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0RGVjaW1hbHMKICAgIGFzc2VydCAvLyBkZWNpbWFscwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTgKICAgIC8vIGFzc2VydCB0eG4uZGVmYXVsdF9mcm96ZW4sICJkZWZhdWx0X2Zyb3plbiIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ29uZmlnQXNzZXREZWZhdWx0RnJvemVuCiAgICBhc3NlcnQgLy8gZGVmYXVsdF9mcm96ZW4KICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjU5CiAgICAvLyBhc3NlcnQgdHhuLnVuaXRfbmFtZSwgInVuaXRfbmFtZSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ29uZmlnQXNzZXRVbml0TmFtZQogICAgbGVuCiAgICBhc3NlcnQgLy8gdW5pdF9uYW1lCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2MAogICAgLy8gYXNzZXJ0IHR4bi5hc3NldF9uYW1lLCAiYXNzZXRfbmFtZSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ29uZmlnQXNzZXROYW1lCiAgICBsZW4KICAgIGFzc2VydCAvLyBhc3NldF9uYW1lCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2MQogICAgLy8gYXNzZXJ0IHR4bi51cmwsICJ1cmwiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0VVJMCiAgICBsZW4KICAgIGFzc2VydCAvLyB1cmwKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjYyCiAgICAvLyBhc3NlcnQgdHhuLm1ldGFkYXRhX2hhc2gsICJtZXRhZGF0YV9oYXNoIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldE1ldGFkYXRhSGFzaAogICAgbGVuCiAgICBhc3NlcnQgLy8gbWV0YWRhdGFfaGFzaAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NjMKICAgIC8vIGFzc2VydCB0eG4ubWFuYWdlciwgIm1hbmFnZXIiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0TWFuYWdlcgogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIG1hbmFnZXIKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjY0CiAgICAvLyBhc3NlcnQgdHhuLnJlc2VydmUsICJyZXNlcnZlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldFJlc2VydmUKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyByZXNlcnZlCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2NQogICAgLy8gYXNzZXJ0IHR4bi5mcmVlemUsICJmcmVlemUiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0RnJlZXplCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gZnJlZXplCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2NgogICAgLy8gYXNzZXJ0IHR4bi5jbGF3YmFjaywgImNsYXdiYWNrIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldENsYXdiYWNrCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gY2xhd2JhY2sKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5hc3NldF90cmFuc2Zlcih0eG46IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfdHJhbnNmZXI6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2OC02OQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgYXNzZXRfdHJhbnNmZXIoc2VsZiwgdHhuOiBndHhuLkFzc2V0VHJhbnNmZXJUcmFuc2FjdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzAKICAgIC8vIHNlbGYuX2NvbW1vbl9jaGVja3ModHhuKQogICAgZnJhbWVfZGlnIC0xCiAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo3MQogICAgLy8gYXNzZXJ0IHR4bi54ZmVyX2Fzc2V0LCAieGZlcl9hc3NldCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgWGZlckFzc2V0CiAgICBhc3NlcnQgLy8geGZlcl9hc3NldAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzIKICAgIC8vIGFzc2VydCB0eG4uYXNzZXRfYW1vdW50LCAiYXNzZXRfYW1vdW50IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBc3NldEFtb3VudAogICAgYXNzZXJ0IC8vIGFzc2V0X2Ftb3VudAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzMKICAgIC8vIGFzc2VydCB0eG4uYXNzZXRfc2VuZGVyLCAiYXNzZXRfc2VuZGVyIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBc3NldFNlbmRlcgogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIGFzc2V0X3NlbmRlcgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzQKICAgIC8vIGFzc2VydCB0eG4uYXNzZXRfcmVjZWl2ZXIsICJhc3NldF9yZWNlaXZlciIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQXNzZXRSZWNlaXZlcgogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIGFzc2V0X3JlY2VpdmVyCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo3NQogICAgLy8gYXNzZXJ0IHR4bi5hc3NldF9jbG9zZV90bywgImFzc2V0X2Nsb3NlX3RvIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBc3NldENsb3NlVG8KICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyBhc3NldF9jbG9zZV90bwogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFzc2V0X2ZyZWV6ZSh0eG46IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfZnJlZXplOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzctNzgKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIGFzc2V0X2ZyZWV6ZShzZWxmLCB0eG46IGd0eG4uQXNzZXRGcmVlemVUcmFuc2FjdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzkKICAgIC8vIHNlbGYuX2NvbW1vbl9jaGVja3ModHhuKQogICAgZnJhbWVfZGlnIC0xCiAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4MQogICAgLy8gYXNzZXJ0IHR4bi5mcmVlemVfYXNzZXQsICJmcmVlemVfYXNzZXQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIEZyZWV6ZUFzc2V0CiAgICBhc3NlcnQgLy8gZnJlZXplX2Fzc2V0CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4MgogICAgLy8gYXNzZXJ0IHR4bi5mcmVlemVfYWNjb3VudCwgImZyZWV6ZV9hY2NvdW50IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGcmVlemVBc3NldEFjY291bnQKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyBmcmVlemVfYWNjb3VudAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6ODMKICAgIC8vIGFzc2VydCB0eG4uZnJvemVuLCAiZnJvemVuIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGcmVlemVBc3NldEZyb3plbgogICAgYXNzZXJ0IC8vIGZyb3plbgogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFwcGxpY2F0aW9uX2NhbGwodHhuOiB1aW50NjQpIC0+IHZvaWQ6CmFwcGxpY2F0aW9uX2NhbGw6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4NS04NgogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgYXBwbGljYXRpb25fY2FsbChzZWxmLCB0eG46IGd0eG4uQXBwbGljYXRpb25DYWxsVHJhbnNhY3Rpb24pIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojg3CiAgICAvLyBzZWxmLl9jb21tb25fY2hlY2tzKHR4bikKICAgIGZyYW1lX2RpZyAtMQogICAgY2FsbHN1YiBfY29tbW9uX2NoZWNrcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6ODgKICAgIC8vIGFzc2VydCB0eG4uYXBwX2lkLCAiYXBwX2lkIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gYXBwX2lkCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4OQogICAgLy8gYXNzZXJ0IHR4bi5vbl9jb21wbGV0aW9uLCAib25fY29tcGxldGlvbiIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgT25Db21wbGV0aW9uCiAgICBhc3NlcnQgLy8gb25fY29tcGxldGlvbgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6OTAKICAgIC8vIGFzc2VydCB0eG4ubnVtX2FwcF9hcmdzLCAibnVtX2FwcF9hcmdzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1BcHBBcmdzCiAgICBhc3NlcnQgLy8gbnVtX2FwcF9hcmdzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5MQogICAgLy8gYXNzZXJ0IHR4bi5udW1fYWNjb3VudHMsICJudW1fYWNjb3VudHMiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIE51bUFjY291bnRzCiAgICBhc3NlcnQgLy8gbnVtX2FjY291bnRzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5MgogICAgLy8gYXNzZXJ0IHR4bi5hcHByb3ZhbF9wcm9ncmFtLCAiYXBwcm92YWxfcHJvZ3JhbSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQXBwcm92YWxQcm9ncmFtCiAgICBsZW4KICAgIGFzc2VydCAvLyBhcHByb3ZhbF9wcm9ncmFtCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5MwogICAgLy8gYXNzZXJ0IHR4bi5jbGVhcl9zdGF0ZV9wcm9ncmFtLCAiY2xlYXJfc3RhdGVfcHJvZ3JhbSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ2xlYXJTdGF0ZVByb2dyYW0KICAgIGxlbgogICAgYXNzZXJ0IC8vIGNsZWFyX3N0YXRlX3Byb2dyYW0KICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojk0CiAgICAvLyBhc3NlcnQgdHhuLm51bV9hc3NldHMsICJudW1fYXNzZXRzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1Bc3NldHMKICAgIGFzc2VydCAvLyBudW1fYXNzZXRzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5NQogICAgLy8gYXNzZXJ0IHR4bi5udW1fYXBwcywgIm51bV9hcHBzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1BcHBsaWNhdGlvbnMKICAgIGFzc2VydCAvLyBudW1fYXBwcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6OTYKICAgIC8vIGFzc2VydCB0eG4uZ2xvYmFsX251bV91aW50LCAiZ2xvYmFsX251bV91aW50IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBHbG9iYWxOdW1VaW50CiAgICBhc3NlcnQgLy8gZ2xvYmFsX251bV91aW50CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5NwogICAgLy8gYXNzZXJ0IHR4bi5nbG9iYWxfbnVtX2J5dGVfc2xpY2UsICJnbG9iYWxfbnVtX2J5dGVfc2xpY2UiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIEdsb2JhbE51bUJ5dGVTbGljZQogICAgYXNzZXJ0IC8vIGdsb2JhbF9udW1fYnl0ZV9zbGljZQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6OTgKICAgIC8vIGFzc2VydCB0eG4ubG9jYWxfbnVtX3VpbnQsICJsb2NhbF9udW1fdWludCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTG9jYWxOdW1VaW50CiAgICBhc3NlcnQgLy8gbG9jYWxfbnVtX3VpbnQKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojk5CiAgICAvLyBhc3NlcnQgdHhuLmxvY2FsX251bV9ieXRlX3NsaWNlLCAibG9jYWxfbnVtX2J5dGVfc2xpY2UiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIExvY2FsTnVtQnl0ZVNsaWNlCiAgICBhc3NlcnQgLy8gbG9jYWxfbnVtX2J5dGVfc2xpY2UKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEwMAogICAgLy8gYXNzZXJ0IHR4bi5leHRyYV9wcm9ncmFtX3BhZ2VzLCAiZXh0cmFfcHJvZ3JhbV9wYWdlcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgRXh0cmFQcm9ncmFtUGFnZXMKICAgIGFzc2VydCAvLyBleHRyYV9wcm9ncmFtX3BhZ2VzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDEKICAgIC8vIGFzc2VydCB0eG4ubGFzdF9sb2csICJsYXN0X2xvZyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTGFzdExvZwogICAgbGVuCiAgICBhc3NlcnQgLy8gbGFzdF9sb2cKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEwMgogICAgLy8gYXNzZXJ0IHR4bi5udW1fYXBwcm92YWxfcHJvZ3JhbV9wYWdlcywgIm51bV9hcHByb3ZhbF9wcm9ncmFtX3BhZ2VzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1BcHByb3ZhbFByb2dyYW1QYWdlcwogICAgYXNzZXJ0IC8vIG51bV9hcHByb3ZhbF9wcm9ncmFtX3BhZ2VzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDMKICAgIC8vIGFzc2VydCB0eG4ubnVtX2NsZWFyX3N0YXRlX3Byb2dyYW1fcGFnZXMsICJudW1fY2xlYXJfc3RhdGVfcHJvZ3JhbV9wYWdlcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTnVtQ2xlYXJTdGF0ZVByb2dyYW1QYWdlcwogICAgYXNzZXJ0IC8vIG51bV9jbGVhcl9zdGF0ZV9wcm9ncmFtX3BhZ2VzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDQKICAgIC8vIGFzc2VydCB0eG4uYXBwX2FyZ3MoMCksICJhcHBfYXJncygwKSIKICAgIGZyYW1lX2RpZyAtMQogICAgaW50IDAKICAgIGd0eG5zYXMgQXBwbGljYXRpb25BcmdzCiAgICBsZW4KICAgIGFzc2VydCAvLyBhcHBfYXJncygwKQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTA1CiAgICAvLyBhc3NlcnQgdHhuLmFjY291bnRzKDApLCAiYWNjb3VudHMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIEFjY291bnRzCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gYWNjb3VudHMoMCkKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEwNgogICAgLy8gYXNzZXJ0IHR4bi5hc3NldHMoMCksICJhc3NldHMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIEFzc2V0cwogICAgYXNzZXJ0IC8vIGFzc2V0cygwKQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTA3CiAgICAvLyBhc3NlcnQgdHhuLmFwcHMoMCksICJhcHBzKDApIgogICAgZnJhbWVfZGlnIC0xCiAgICBpbnQgMAogICAgZ3R4bnNhcyBBcHBsaWNhdGlvbnMKICAgIGFzc2VydCAvLyBhcHBzKDApCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDgKICAgIC8vIGFzc2VydCB0eG4uYXBwcm92YWxfcHJvZ3JhbV9wYWdlcygwKSwgImFwcHJvdmFsX3Byb2dyYW1fcGFnZXMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIEFwcHJvdmFsUHJvZ3JhbVBhZ2VzCiAgICBsZW4KICAgIGFzc2VydCAvLyBhcHByb3ZhbF9wcm9ncmFtX3BhZ2VzKDApCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDkKICAgIC8vIGFzc2VydCB0eG4uY2xlYXJfc3RhdGVfcHJvZ3JhbV9wYWdlcygwKSwgImNsZWFyX3N0YXRlX3Byb2dyYW1fcGFnZXMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIENsZWFyU3RhdGVQcm9ncmFtUGFnZXMKICAgIGxlbgogICAgYXNzZXJ0IC8vIGNsZWFyX3N0YXRlX3Byb2dyYW1fcGFnZXMoMCkKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5tdWx0aXBsZV90eG5zKHR4bjE6IHVpbnQ2NCwgdHhuMjogdWludDY0LCB0eG4zOiB1aW50NjQpIC0+IHZvaWQ6Cm11bHRpcGxlX3R4bnM6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMTEtMTE3CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBtdWx0aXBsZV90eG5zKAogICAgLy8gICAgIHNlbGYsCiAgICAvLyAgICAgdHhuMTogZ3R4bi5BcHBsaWNhdGlvbkNhbGxUcmFuc2FjdGlvbiwKICAgIC8vICAgICB0eG4yOiBndHhuLkFwcGxpY2F0aW9uQ2FsbFRyYW5zYWN0aW9uLAogICAgLy8gICAgIHR4bjM6IGd0eG4uQXBwbGljYXRpb25DYWxsVHJhbnNhY3Rpb24sCiAgICAvLyApIC0+IE5vbmU6CiAgICBwcm90byAzIDAKICAgIGJ5dGUgIiIKICAgIGZyYW1lX2RpZyAtMwogICAgaW50IDAKICAgIGIgbXVsdGlwbGVfdHhuc19mb3JfYm9keUA0CgptdWx0aXBsZV90eG5zX2Zvcl9oZWFkZXJfMUAyOgogICAgZnJhbWVfZGlnIC0yCiAgICBmcmFtZV9idXJ5IDEKICAgIGZyYW1lX2RpZyAwCiAgICBiIG11bHRpcGxlX3R4bnNfZm9yX2JvZHlANAoKbXVsdGlwbGVfdHhuc19mb3JfaGVhZGVyXzJAMzoKICAgIGZyYW1lX2RpZyAtMQogICAgZnJhbWVfYnVyeSAxCiAgICBmcmFtZV9kaWcgMAoKbXVsdGlwbGVfdHhuc19mb3JfYm9keUA0OgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTE5CiAgICAvLyBhc3NlcnQgYXBwLmdyb3VwX2luZGV4ID09IGluZGV4CiAgICBmcmFtZV9kaWcgMQogICAgZ3R4bnMgR3JvdXBJbmRleAogICAgZGlnIDEKICAgID09CiAgICBhc3NlcnQKICAgIGR1cAogICAgaW50IDEKICAgICsKICAgIGZyYW1lX2J1cnkgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTE4CiAgICAvLyBmb3IgaW5kZXgsIGFwcCBpbiB1ZW51bWVyYXRlKCh0eG4xLCB0eG4yLCB0eG4zKSk6CiAgICBzd2l0Y2ggbXVsdGlwbGVfdHhuc19mb3JfaGVhZGVyXzFAMiBtdWx0aXBsZV90eG5zX2Zvcl9oZWFkZXJfMkAzCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYW55X3R4bih0eG4xOiB1aW50NjQsIHR4bjI6IHVpbnQ2NCwgdHhuMzogdWludDY0KSAtPiB2b2lkOgphbnlfdHhuOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTIxLTEyNwogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgYW55X3R4bigKICAgIC8vICAgICBzZWxmLAogICAgLy8gICAgIHR4bjE6IGd0eG4uVHJhbnNhY3Rpb24sCiAgICAvLyAgICAgdHhuMjogZ3R4bi5UcmFuc2FjdGlvbiwKICAgIC8vICAgICB0eG4zOiBndHhuLlRyYW5zYWN0aW9uLAogICAgLy8gKSAtPiBOb25lOgogICAgcHJvdG8gMyAwCiAgICBieXRlICIiCiAgICBpbnQgMAogICAgZnJhbWVfZGlnIC0zCiAgICBiIGFueV90eG5fZm9yX2JvZHlANAoKYW55X3R4bl9mb3JfaGVhZGVyXzFAMjoKICAgIGZyYW1lX2RpZyAtMgogICAgZnJhbWVfZGlnIDAKICAgIGZyYW1lX2J1cnkgMQogICAgYiBhbnlfdHhuX2Zvcl9ib2R5QDQKCmFueV90eG5fZm9yX2hlYWRlcl8yQDM6CiAgICBmcmFtZV9kaWcgLTEKICAgIGZyYW1lX2RpZyAwCiAgICBmcmFtZV9idXJ5IDEKCmFueV90eG5fZm9yX2JvZHlANDoKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEyOQogICAgLy8gYXNzZXJ0IHR4bi5ncm91cF9pbmRleCA9PSBpbmRleAogICAgZ3R4bnMgR3JvdXBJbmRleAogICAgZnJhbWVfZGlnIDEKICAgIGR1cAogICAgY292ZXIgMgogICAgPT0KICAgIGFzc2VydAogICAgZHVwCiAgICBpbnQgMQogICAgKwogICAgZnJhbWVfYnVyeSAwCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMjgKICAgIC8vIGZvciBpbmRleCwgdHhuIGluIHVlbnVtZXJhdGUoKHR4bjEsIHR4bjIsIHR4bjMpKToKICAgIHN3aXRjaCBhbnlfdHhuX2Zvcl9oZWFkZXJfMUAyIGFueV90eG5fZm9yX2hlYWRlcl8yQDMKICAgIHJldHN1Ygo=", + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYXBwcm92YWxfcHJvZ3JhbToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIG1ldGhvZCAiY3JlYXRlKCl2b2lkIgogICAgbWV0aG9kICJwYXkocGF5KXZvaWQiCiAgICBtZXRob2QgImtleShrZXlyZWcpdm9pZCIKICAgIG1ldGhvZCAiYXNzZXRfY29uZmlnKGFjZmcpdm9pZCIKICAgIG1ldGhvZCAiYXNzZXRfdHJhbnNmZXIoYXhmZXIpdm9pZCIKICAgIG1ldGhvZCAiYXNzZXRfZnJlZXplKGFmcnopdm9pZCIKICAgIG1ldGhvZCAiYXBwbGljYXRpb25fY2FsbChhcHBsKXZvaWQiCiAgICBtZXRob2QgIm11bHRpcGxlX3R4bnMoYXBwbCxhcHBsLGFwcGwpdm9pZCIKICAgIG1ldGhvZCAiYW55X3R4bih0eG4sdHhuLHR4bil2b2lkIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggbWFpbl9jcmVhdGVfcm91dGVAMSBtYWluX3BheV9yb3V0ZUAyIG1haW5fa2V5X3JvdXRlQDMgbWFpbl9hc3NldF9jb25maWdfcm91dGVANCBtYWluX2Fzc2V0X3RyYW5zZmVyX3JvdXRlQDUgbWFpbl9hc3NldF9mcmVlemVfcm91dGVANiBtYWluX2FwcGxpY2F0aW9uX2NhbGxfcm91dGVANyBtYWluX211bHRpcGxlX3R4bnNfcm91dGVAOCBtYWluX2FueV90eG5fcm91dGVAOQogICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKbWFpbl9jcmVhdGVfcm91dGVAMToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEyCiAgICAvLyBAYXJjNC5hYmltZXRob2QoY3JlYXRlPVRydWUpCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAhCiAgICBhc3NlcnQgLy8gaXMgY3JlYXRpbmcKICAgIGNhbGxzdWIgY3JlYXRlCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX3BheV9yb3V0ZUAyOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAxCiAgICAtCiAgICBkdXAKICAgIGd0eG5zIFR5cGVFbnVtCiAgICBpbnQgcGF5CiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgcGF5CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTozMQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICBjYWxsc3ViIHBheQogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9rZXlfcm91dGVAMzoKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQwCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMQogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50IGtleXJlZwogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGtleXJlZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NDAKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBrZXkKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXNzZXRfY29uZmlnX3JvdXRlQDQ6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo1MQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMQogICAgLy8gY2xhc3MgVHJhbnNhY3Rpb25Db250cmFjdChhcmM0LkFSQzRDb250cmFjdCk6CiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDEKICAgIC0KICAgIGR1cAogICAgZ3R4bnMgVHlwZUVudW0KICAgIGludCBhY2ZnCiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYWNmZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBhc3NldF9jb25maWcKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXNzZXRfdHJhbnNmZXJfcm91dGVANToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjY4CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMQogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50IGF4ZmVyCiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYXhmZXIKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjY4CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgYXNzZXRfdHJhbnNmZXIKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXNzZXRfZnJlZXplX3JvdXRlQDY6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo3NwogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMQogICAgLy8gY2xhc3MgVHJhbnNhY3Rpb25Db250cmFjdChhcmM0LkFSQzRDb250cmFjdCk6CiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDEKICAgIC0KICAgIGR1cAogICAgZ3R4bnMgVHlwZUVudW0KICAgIGludCBhZnJ6CiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYWZyegogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzcKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBhc3NldF9mcmVlemUKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYXBwbGljYXRpb25fY2FsbF9yb3V0ZUA3OgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6ODUKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAxCiAgICAtCiAgICBkdXAKICAgIGd0eG5zIFR5cGVFbnVtCiAgICBpbnQgYXBwbAogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGFwcGwKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojg1CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgYXBwbGljYXRpb25fY2FsbAogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9tdWx0aXBsZV90eG5zX3JvdXRlQDg6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMTEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAzCiAgICAtCiAgICBkdXAKICAgIGd0eG5zIFR5cGVFbnVtCiAgICBpbnQgYXBwbAogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGFwcGwKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMgogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50IGFwcGwKICAgID09CiAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBhcHBsCiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDEKICAgIC0KICAgIGR1cAogICAgZ3R4bnMgVHlwZUVudW0KICAgIGludCBhcHBsCiAgICA9PQogICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYXBwbAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTExCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgbXVsdGlwbGVfdHhucwogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9hbnlfdHhuX3JvdXRlQDk6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMjEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTEKICAgIC8vIGNsYXNzIFRyYW5zYWN0aW9uQ29udHJhY3QoYXJjNC5BUkM0Q29udHJhY3QpOgogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludCAzCiAgICAtCiAgICB0eG4gR3JvdXBJbmRleAogICAgaW50IDIKICAgIC0KICAgIHR4biBHcm91cEluZGV4CiAgICBpbnQgMQogICAgLQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTIxCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgYW55X3R4bgogICAgaW50IDEKICAgIHJldHVybgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5jcmVhdGUoKSAtPiB2b2lkOgpjcmVhdGU6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMi0xMwogICAgLy8gQGFyYzQuYWJpbWV0aG9kKGNyZWF0ZT1UcnVlKQogICAgLy8gZGVmIGNyZWF0ZShzZWxmKSAtPiBOb25lOgogICAgcHJvdG8gMCAwCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QucGF5KHR4bjogdWludDY0KSAtPiB2b2lkOgpwYXk6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTozMS0zMgogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgcGF5KHNlbGYsIHR4bjogZ3R4bi5QYXltZW50VHJhbnNhY3Rpb24pIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjMzCiAgICAvLyBzZWxmLl9jb21tb25fY2hlY2tzKHR4bikKICAgIGZyYW1lX2RpZyAtMQogICAgY2FsbHN1YiBfY29tbW9uX2NoZWNrcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzUKICAgIC8vIHR4bi5yZWNlaXZlciA9PSBvcC5HbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFJlY2VpdmVyCiAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgPT0KICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjM0LTM2CiAgICAvLyBhc3NlcnQgKAogICAgLy8gICAgIHR4bi5yZWNlaXZlciA9PSBvcC5HbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzCiAgICAvLyApLCAiUGF5bWVudCBzaG91bGQgYmUgZm9yIHRoaXMgYXBwIgogICAgYXNzZXJ0IC8vIFBheW1lbnQgc2hvdWxkIGJlIGZvciB0aGlzIGFwcAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzcKICAgIC8vIGFzc2VydCB0eG4uYW1vdW50ID4gMTAwMCwgIlBheW1lbnQgc2hvdWxkIGJlIGZvciA+MTAwMCBtaWNybyBhbGdvcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQW1vdW50CiAgICBpbnQgMTAwMAogICAgPgogICAgYXNzZXJ0IC8vIFBheW1lbnQgc2hvdWxkIGJlIGZvciA+MTAwMCBtaWNybyBhbGdvcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MzgKICAgIC8vIGFzc2VydCB0eG4uY2xvc2VfcmVtYWluZGVyX3RvID09IG9wLkdsb2JhbC56ZXJvX2FkZHJlc3MsICJjbG9zZV9yZW1haW5kZXJfdG8iCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENsb3NlUmVtYWluZGVyVG8KICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgPT0KICAgIGFzc2VydCAvLyBjbG9zZV9yZW1haW5kZXJfdG8KICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5fY29tbW9uX2NoZWNrcyh0eG46IHVpbnQ2NCkgLT4gdm9pZDoKX2NvbW1vbl9jaGVja3M6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxNi0xNwogICAgLy8gQHN1YnJvdXRpbmUKICAgIC8vIGRlZiBfY29tbW9uX2NoZWNrcyhzZWxmLCB0eG46IGd0eG4uVHJhbnNhY3Rpb25CYXNlKSAtPiBOb25lOgogICAgcHJvdG8gMSAwCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxOAogICAgLy8gYXNzZXJ0IHR4bi50eG5faWQsICJ0eG5faWQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFR4SUQKICAgIGxlbgogICAgYXNzZXJ0IC8vIHR4bl9pZAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTkKICAgIC8vIGFzc2VydCB0eG4uc2VuZGVyID09IG9wLkdsb2JhbC5jcmVhdG9yX2FkZHJlc3MsICJzZW5kZXIiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFNlbmRlcgogICAgZ2xvYmFsIENyZWF0b3JBZGRyZXNzCiAgICA9PQogICAgYXNzZXJ0IC8vIHNlbmRlcgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MjAKICAgIC8vIGFzc2VydCB0eG4uZmVlLCAiZmVlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGZWUKICAgIGFzc2VydCAvLyBmZWUKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjIxCiAgICAvLyBhc3NlcnQgdHhuLnR5cGUsICJ0eXBlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBUeXBlRW51bQogICAgYXNzZXJ0IC8vIHR5cGUKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjIyCiAgICAvLyBhc3NlcnQgdHhuLnR5cGVfYnl0ZXMsICJ0eXBlX2J5dGVzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBUeXBlCiAgICBsZW4KICAgIGFzc2VydCAvLyB0eXBlX2J5dGVzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToyMwogICAgLy8gYXNzZXJ0IHR4bi5ub3RlID09IEJ5dGVzKGIiIiksICJub3RlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOb3RlCiAgICBieXRlICIiCiAgICA9PQogICAgYXNzZXJ0IC8vIG5vdGUKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjI0CiAgICAvLyBhc3NlcnQgdHhuLmdyb3VwX2luZGV4ID09IDAsICJncm91cF9pbmRleCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgR3JvdXBJbmRleAogICAgIQogICAgYXNzZXJ0IC8vIGdyb3VwX2luZGV4CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToyNQogICAgLy8gYXNzZXJ0IHR4bi5maXJzdF92YWxpZCwgImZpcnN0X3ZhbGlkIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGaXJzdFZhbGlkCiAgICBhc3NlcnQgLy8gZmlyc3RfdmFsaWQKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjI2LTI3CiAgICAvLyAjIGFzc2VydCB0eG4uZmlyc3RfdmFsaWRfdGltZSwgImZpcnN0X3ZhbGlkX3RpbWUiICMgdGhpcyB2YWx1ZSBjYW4gYmUgZmxha3kgaW4gdGVzdHMKICAgIC8vIGFzc2VydCB0eG4ubGFzdF92YWxpZCwgImxhc3RfdmFsaWQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIExhc3RWYWxpZAogICAgYXNzZXJ0IC8vIGxhc3RfdmFsaWQKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjI4CiAgICAvLyBhc3NlcnQgdHhuLmxlYXNlLCAibGVhc2UiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIExlYXNlCiAgICBsZW4KICAgIGFzc2VydCAvLyBsZWFzZQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MjkKICAgIC8vIGFzc2VydCB0eG4ucmVrZXlfdG8gPT0gb3AuR2xvYmFsLnplcm9fYWRkcmVzcywgInJla2V5X3RvIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBSZWtleVRvCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgID09CiAgICBhc3NlcnQgLy8gcmVrZXlfdG8KICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5rZXkodHhuOiB1aW50NjQpIC0+IHZvaWQ6CmtleToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQwLTQxCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBrZXkoc2VsZiwgdHhuOiBndHhuLktleVJlZ2lzdHJhdGlvblRyYW5zYWN0aW9uKSAtPiBOb25lOgogICAgcHJvdG8gMSAwCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo0MgogICAgLy8gc2VsZi5fY29tbW9uX2NoZWNrcyh0eG4pCiAgICBmcmFtZV9kaWcgLTEKICAgIGNhbGxzdWIgX2NvbW1vbl9jaGVja3MKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQzCiAgICAvLyBhc3NlcnQgdHhuLnZvdGVfa2V5LCAidm90ZV9rZXkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFZvdGVQSwogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIHZvdGVfa2V5CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo0NAogICAgLy8gYXNzZXJ0IHR4bi5zZWxlY3Rpb25fa2V5LCAic2VsZWN0aW9uX2tleSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgU2VsZWN0aW9uUEsKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyBzZWxlY3Rpb25fa2V5CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo0NQogICAgLy8gYXNzZXJ0IHR4bi52b3RlX2tleV9kaWx1dGlvbiwgInZvdGVfa2V5X2RpbHV0aW9uIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBWb3RlS2V5RGlsdXRpb24KICAgIGFzc2VydCAvLyB2b3RlX2tleV9kaWx1dGlvbgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NDYKICAgIC8vIGFzc2VydCB0eG4udm90ZV9maXJzdCwgInZvdGVfZmlyc3QiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIFZvdGVGaXJzdAogICAgYXNzZXJ0IC8vIHZvdGVfZmlyc3QKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQ3CiAgICAvLyBhc3NlcnQgdHhuLnZvdGVfbGFzdCwgInZvdGVfbGFzdCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgVm90ZUxhc3QKICAgIGFzc2VydCAvLyB2b3RlX2xhc3QKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjQ4CiAgICAvLyBhc3NlcnQgdHhuLm5vbl9wYXJ0aWNpcGF0aW9uLCAibm9uX3BhcnRpY2lwYXRpb24iCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIE5vbnBhcnRpY2lwYXRpb24KICAgIGFzc2VydCAvLyBub25fcGFydGljaXBhdGlvbgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NDkKICAgIC8vIGFzc2VydCB0eG4uc3RhdGVfcHJvb2Zfa2V5LCAic3RhdGVfcHJvb2Zfa2V5IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBTdGF0ZVByb29mUEsKICAgIGxlbgogICAgYXNzZXJ0IC8vIHN0YXRlX3Byb29mX2tleQogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFzc2V0X2NvbmZpZyh0eG46IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfY29uZmlnOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTEtNTIKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIGFzc2V0X2NvbmZpZyhzZWxmLCB0eG46IGd0eG4uQXNzZXRDb25maWdUcmFuc2FjdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTMKICAgIC8vIHNlbGYuX2NvbW1vbl9jaGVja3ModHhuKQogICAgZnJhbWVfZGlnIC0xCiAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo1NQogICAgLy8gYXNzZXJ0IHR4bi5jb25maWdfYXNzZXQsICJjb25maWdfYXNzZXQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0CiAgICBhc3NlcnQgLy8gY29uZmlnX2Fzc2V0CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo1NgogICAgLy8gYXNzZXJ0IHR4bi50b3RhbCwgInRvdGFsIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldFRvdGFsCiAgICBhc3NlcnQgLy8gdG90YWwKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjU3CiAgICAvLyBhc3NlcnQgdHhuLmRlY2ltYWxzLCAiZGVjaW1hbHMiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0RGVjaW1hbHMKICAgIGFzc2VydCAvLyBkZWNpbWFscwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NTgKICAgIC8vIGFzc2VydCB0eG4uZGVmYXVsdF9mcm96ZW4sICJkZWZhdWx0X2Zyb3plbiIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ29uZmlnQXNzZXREZWZhdWx0RnJvemVuCiAgICBhc3NlcnQgLy8gZGVmYXVsdF9mcm96ZW4KICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjU5CiAgICAvLyBhc3NlcnQgdHhuLnVuaXRfbmFtZSwgInVuaXRfbmFtZSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ29uZmlnQXNzZXRVbml0TmFtZQogICAgbGVuCiAgICBhc3NlcnQgLy8gdW5pdF9uYW1lCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2MAogICAgLy8gYXNzZXJ0IHR4bi5hc3NldF9uYW1lLCAiYXNzZXRfbmFtZSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ29uZmlnQXNzZXROYW1lCiAgICBsZW4KICAgIGFzc2VydCAvLyBhc3NldF9uYW1lCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2MQogICAgLy8gYXNzZXJ0IHR4bi51cmwsICJ1cmwiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0VVJMCiAgICBsZW4KICAgIGFzc2VydCAvLyB1cmwKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjYyCiAgICAvLyBhc3NlcnQgdHhuLm1ldGFkYXRhX2hhc2gsICJtZXRhZGF0YV9oYXNoIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldE1ldGFkYXRhSGFzaAogICAgbGVuCiAgICBhc3NlcnQgLy8gbWV0YWRhdGFfaGFzaAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NjMKICAgIC8vIGFzc2VydCB0eG4ubWFuYWdlciwgIm1hbmFnZXIiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0TWFuYWdlcgogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIG1hbmFnZXIKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjY0CiAgICAvLyBhc3NlcnQgdHhuLnJlc2VydmUsICJyZXNlcnZlIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldFJlc2VydmUKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyByZXNlcnZlCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2NQogICAgLy8gYXNzZXJ0IHR4bi5mcmVlemUsICJmcmVlemUiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIENvbmZpZ0Fzc2V0RnJlZXplCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gZnJlZXplCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2NgogICAgLy8gYXNzZXJ0IHR4bi5jbGF3YmFjaywgImNsYXdiYWNrIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBDb25maWdBc3NldENsYXdiYWNrCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gY2xhd2JhY2sKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5hc3NldF90cmFuc2Zlcih0eG46IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfdHJhbnNmZXI6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo2OC02OQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgYXNzZXRfdHJhbnNmZXIoc2VsZiwgdHhuOiBndHhuLkFzc2V0VHJhbnNmZXJUcmFuc2FjdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzAKICAgIC8vIHNlbGYuX2NvbW1vbl9jaGVja3ModHhuKQogICAgZnJhbWVfZGlnIC0xCiAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo3MQogICAgLy8gYXNzZXJ0IHR4bi54ZmVyX2Fzc2V0LCAieGZlcl9hc3NldCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgWGZlckFzc2V0CiAgICBhc3NlcnQgLy8geGZlcl9hc3NldAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzIKICAgIC8vIGFzc2VydCB0eG4uYXNzZXRfYW1vdW50LCAiYXNzZXRfYW1vdW50IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBc3NldEFtb3VudAogICAgYXNzZXJ0IC8vIGFzc2V0X2Ftb3VudAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzMKICAgIC8vIGFzc2VydCB0eG4uYXNzZXRfc2VuZGVyLCAiYXNzZXRfc2VuZGVyIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBc3NldFNlbmRlcgogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIGFzc2V0X3NlbmRlcgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzQKICAgIC8vIGFzc2VydCB0eG4uYXNzZXRfcmVjZWl2ZXIsICJhc3NldF9yZWNlaXZlciIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQXNzZXRSZWNlaXZlcgogICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAhPQogICAgYXNzZXJ0IC8vIGFzc2V0X3JlY2VpdmVyCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo3NQogICAgLy8gYXNzZXJ0IHR4bi5hc3NldF9jbG9zZV90bywgImFzc2V0X2Nsb3NlX3RvIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBc3NldENsb3NlVG8KICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyBhc3NldF9jbG9zZV90bwogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFzc2V0X2ZyZWV6ZSh0eG46IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfZnJlZXplOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzctNzgKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIGFzc2V0X2ZyZWV6ZShzZWxmLCB0eG46IGd0eG4uQXNzZXRGcmVlemVUcmFuc2FjdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6NzkKICAgIC8vIHNlbGYuX2NvbW1vbl9jaGVja3ModHhuKQogICAgZnJhbWVfZGlnIC0xCiAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4MQogICAgLy8gYXNzZXJ0IHR4bi5mcmVlemVfYXNzZXQsICJmcmVlemVfYXNzZXQiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIEZyZWV6ZUFzc2V0CiAgICBhc3NlcnQgLy8gZnJlZXplX2Fzc2V0CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4MgogICAgLy8gYXNzZXJ0IHR4bi5mcmVlemVfYWNjb3VudCwgImZyZWV6ZV9hY2NvdW50IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGcmVlemVBc3NldEFjY291bnQKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgIT0KICAgIGFzc2VydCAvLyBmcmVlemVfYWNjb3VudAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6ODMKICAgIC8vIGFzc2VydCB0eG4uZnJvemVuLCAiZnJvemVuIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBGcmVlemVBc3NldEZyb3plbgogICAgYXNzZXJ0IC8vIGZyb3plbgogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFwcGxpY2F0aW9uX2NhbGwodHhuOiB1aW50NjQpIC0+IHZvaWQ6CmFwcGxpY2F0aW9uX2NhbGw6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4NS04NgogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgYXBwbGljYXRpb25fY2FsbChzZWxmLCB0eG46IGd0eG4uQXBwbGljYXRpb25DYWxsVHJhbnNhY3Rpb24pIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojg3CiAgICAvLyBzZWxmLl9jb21tb25fY2hlY2tzKHR4bikKICAgIGZyYW1lX2RpZyAtMQogICAgY2FsbHN1YiBfY29tbW9uX2NoZWNrcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6ODgKICAgIC8vIGFzc2VydCB0eG4uYXBwX2lkLCAiYXBwX2lkIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gYXBwX2lkCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo4OQogICAgLy8gYXNzZXJ0IHR4bi5vbl9jb21wbGV0aW9uLCAib25fY29tcGxldGlvbiIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgT25Db21wbGV0aW9uCiAgICBhc3NlcnQgLy8gb25fY29tcGxldGlvbgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6OTAKICAgIC8vIGFzc2VydCB0eG4ubnVtX2FwcF9hcmdzLCAibnVtX2FwcF9hcmdzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1BcHBBcmdzCiAgICBhc3NlcnQgLy8gbnVtX2FwcF9hcmdzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5MQogICAgLy8gYXNzZXJ0IHR4bi5udW1fYWNjb3VudHMsICJudW1fYWNjb3VudHMiCiAgICBmcmFtZV9kaWcgLTEKICAgIGd0eG5zIE51bUFjY291bnRzCiAgICBhc3NlcnQgLy8gbnVtX2FjY291bnRzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5MgogICAgLy8gYXNzZXJ0IHR4bi5hcHByb3ZhbF9wcm9ncmFtLCAiYXBwcm92YWxfcHJvZ3JhbSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQXBwcm92YWxQcm9ncmFtCiAgICBsZW4KICAgIGFzc2VydCAvLyBhcHByb3ZhbF9wcm9ncmFtCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5MwogICAgLy8gYXNzZXJ0IHR4bi5jbGVhcl9zdGF0ZV9wcm9ncmFtLCAiY2xlYXJfc3RhdGVfcHJvZ3JhbSIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgQ2xlYXJTdGF0ZVByb2dyYW0KICAgIGxlbgogICAgYXNzZXJ0IC8vIGNsZWFyX3N0YXRlX3Byb2dyYW0KICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojk0CiAgICAvLyBhc3NlcnQgdHhuLm51bV9hc3NldHMsICJudW1fYXNzZXRzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1Bc3NldHMKICAgIGFzc2VydCAvLyBudW1fYXNzZXRzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5NQogICAgLy8gYXNzZXJ0IHR4bi5udW1fYXBwcywgIm51bV9hcHBzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1BcHBsaWNhdGlvbnMKICAgIGFzc2VydCAvLyBudW1fYXBwcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6OTYKICAgIC8vIGFzc2VydCB0eG4uZ2xvYmFsX251bV91aW50LCAiZ2xvYmFsX251bV91aW50IgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBHbG9iYWxOdW1VaW50CiAgICBhc3NlcnQgLy8gZ2xvYmFsX251bV91aW50CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weTo5NwogICAgLy8gYXNzZXJ0IHR4bi5nbG9iYWxfbnVtX2J5dGVzLCAiZ2xvYmFsX251bV9ieXRlcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgR2xvYmFsTnVtQnl0ZVNsaWNlCiAgICBhc3NlcnQgLy8gZ2xvYmFsX251bV9ieXRlcwogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6OTgKICAgIC8vIGFzc2VydCB0eG4ubG9jYWxfbnVtX3VpbnQsICJsb2NhbF9udW1fdWludCIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTG9jYWxOdW1VaW50CiAgICBhc3NlcnQgLy8gbG9jYWxfbnVtX3VpbnQKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5Ojk5CiAgICAvLyBhc3NlcnQgdHhuLmxvY2FsX251bV9ieXRlcywgImxvY2FsX251bV9ieXRlcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTG9jYWxOdW1CeXRlU2xpY2UKICAgIGFzc2VydCAvLyBsb2NhbF9udW1fYnl0ZXMKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEwMAogICAgLy8gYXNzZXJ0IHR4bi5leHRyYV9wcm9ncmFtX3BhZ2VzLCAiZXh0cmFfcHJvZ3JhbV9wYWdlcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgRXh0cmFQcm9ncmFtUGFnZXMKICAgIGFzc2VydCAvLyBleHRyYV9wcm9ncmFtX3BhZ2VzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDEKICAgIC8vIGFzc2VydCB0eG4ubGFzdF9sb2csICJsYXN0X2xvZyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTGFzdExvZwogICAgbGVuCiAgICBhc3NlcnQgLy8gbGFzdF9sb2cKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEwMgogICAgLy8gYXNzZXJ0IHR4bi5udW1fYXBwcm92YWxfcHJvZ3JhbV9wYWdlcywgIm51bV9hcHByb3ZhbF9wcm9ncmFtX3BhZ2VzIgogICAgZnJhbWVfZGlnIC0xCiAgICBndHhucyBOdW1BcHByb3ZhbFByb2dyYW1QYWdlcwogICAgYXNzZXJ0IC8vIG51bV9hcHByb3ZhbF9wcm9ncmFtX3BhZ2VzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDMKICAgIC8vIGFzc2VydCB0eG4ubnVtX2NsZWFyX3N0YXRlX3Byb2dyYW1fcGFnZXMsICJudW1fY2xlYXJfc3RhdGVfcHJvZ3JhbV9wYWdlcyIKICAgIGZyYW1lX2RpZyAtMQogICAgZ3R4bnMgTnVtQ2xlYXJTdGF0ZVByb2dyYW1QYWdlcwogICAgYXNzZXJ0IC8vIG51bV9jbGVhcl9zdGF0ZV9wcm9ncmFtX3BhZ2VzCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDQKICAgIC8vIGFzc2VydCB0eG4uYXBwX2FyZ3MoMCksICJhcHBfYXJncygwKSIKICAgIGZyYW1lX2RpZyAtMQogICAgaW50IDAKICAgIGd0eG5zYXMgQXBwbGljYXRpb25BcmdzCiAgICBsZW4KICAgIGFzc2VydCAvLyBhcHBfYXJncygwKQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTA1CiAgICAvLyBhc3NlcnQgdHhuLmFjY291bnRzKDApLCAiYWNjb3VudHMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIEFjY291bnRzCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gYWNjb3VudHMoMCkKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEwNgogICAgLy8gYXNzZXJ0IHR4bi5hc3NldHMoMCksICJhc3NldHMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIEFzc2V0cwogICAgYXNzZXJ0IC8vIGFzc2V0cygwKQogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTA3CiAgICAvLyBhc3NlcnQgdHhuLmFwcHMoMCksICJhcHBzKDApIgogICAgZnJhbWVfZGlnIC0xCiAgICBpbnQgMAogICAgZ3R4bnNhcyBBcHBsaWNhdGlvbnMKICAgIGFzc2VydCAvLyBhcHBzKDApCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDgKICAgIC8vIGFzc2VydCB0eG4uYXBwcm92YWxfcHJvZ3JhbV9wYWdlcygwKSwgImFwcHJvdmFsX3Byb2dyYW1fcGFnZXMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIEFwcHJvdmFsUHJvZ3JhbVBhZ2VzCiAgICBsZW4KICAgIGFzc2VydCAvLyBhcHByb3ZhbF9wcm9ncmFtX3BhZ2VzKDApCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMDkKICAgIC8vIGFzc2VydCB0eG4uY2xlYXJfc3RhdGVfcHJvZ3JhbV9wYWdlcygwKSwgImNsZWFyX3N0YXRlX3Byb2dyYW1fcGFnZXMoMCkiCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBndHhuc2FzIENsZWFyU3RhdGVQcm9ncmFtUGFnZXMKICAgIGxlbgogICAgYXNzZXJ0IC8vIGNsZWFyX3N0YXRlX3Byb2dyYW1fcGFnZXMoMCkKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5tdWx0aXBsZV90eG5zKHR4bjE6IHVpbnQ2NCwgdHhuMjogdWludDY0LCB0eG4zOiB1aW50NjQpIC0+IHZvaWQ6Cm11bHRpcGxlX3R4bnM6CiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMTEtMTE3CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBtdWx0aXBsZV90eG5zKAogICAgLy8gICAgIHNlbGYsCiAgICAvLyAgICAgdHhuMTogZ3R4bi5BcHBsaWNhdGlvbkNhbGxUcmFuc2FjdGlvbiwKICAgIC8vICAgICB0eG4yOiBndHhuLkFwcGxpY2F0aW9uQ2FsbFRyYW5zYWN0aW9uLAogICAgLy8gICAgIHR4bjM6IGd0eG4uQXBwbGljYXRpb25DYWxsVHJhbnNhY3Rpb24sCiAgICAvLyApIC0+IE5vbmU6CiAgICBwcm90byAzIDAKICAgIGJ5dGUgIiIKICAgIGZyYW1lX2RpZyAtMwogICAgaW50IDAKICAgIGIgbXVsdGlwbGVfdHhuc19mb3JfYm9keUA0CgptdWx0aXBsZV90eG5zX2Zvcl9oZWFkZXJfMUAyOgogICAgZnJhbWVfZGlnIC0yCiAgICBmcmFtZV9idXJ5IDEKICAgIGZyYW1lX2RpZyAwCiAgICBiIG11bHRpcGxlX3R4bnNfZm9yX2JvZHlANAoKbXVsdGlwbGVfdHhuc19mb3JfaGVhZGVyXzJAMzoKICAgIGZyYW1lX2RpZyAtMQogICAgZnJhbWVfYnVyeSAxCiAgICBmcmFtZV9kaWcgMAoKbXVsdGlwbGVfdHhuc19mb3JfYm9keUA0OgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTE5CiAgICAvLyBhc3NlcnQgYXBwLmdyb3VwX2luZGV4ID09IGluZGV4CiAgICBmcmFtZV9kaWcgMQogICAgZ3R4bnMgR3JvdXBJbmRleAogICAgZGlnIDEKICAgID09CiAgICBhc3NlcnQKICAgIGR1cAogICAgaW50IDEKICAgICsKICAgIGZyYW1lX2J1cnkgMAogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTE4CiAgICAvLyBmb3IgaW5kZXgsIGFwcCBpbiB1ZW51bWVyYXRlKCh0eG4xLCB0eG4yLCB0eG4zKSk6CiAgICBzd2l0Y2ggbXVsdGlwbGVfdHhuc19mb3JfaGVhZGVyXzFAMiBtdWx0aXBsZV90eG5zX2Zvcl9oZWFkZXJfMkAzCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYW55X3R4bih0eG4xOiB1aW50NjQsIHR4bjI6IHVpbnQ2NCwgdHhuMzogdWludDY0KSAtPiB2b2lkOgphbnlfdHhuOgogICAgLy8gdHJhbnNhY3Rpb24vY29udHJhY3QucHk6MTIxLTEyNwogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgYW55X3R4bigKICAgIC8vICAgICBzZWxmLAogICAgLy8gICAgIHR4bjE6IGd0eG4uVHJhbnNhY3Rpb24sCiAgICAvLyAgICAgdHhuMjogZ3R4bi5UcmFuc2FjdGlvbiwKICAgIC8vICAgICB0eG4zOiBndHhuLlRyYW5zYWN0aW9uLAogICAgLy8gKSAtPiBOb25lOgogICAgcHJvdG8gMyAwCiAgICBieXRlICIiCiAgICBpbnQgMAogICAgZnJhbWVfZGlnIC0zCiAgICBiIGFueV90eG5fZm9yX2JvZHlANAoKYW55X3R4bl9mb3JfaGVhZGVyXzFAMjoKICAgIGZyYW1lX2RpZyAtMgogICAgZnJhbWVfZGlnIDAKICAgIGZyYW1lX2J1cnkgMQogICAgYiBhbnlfdHhuX2Zvcl9ib2R5QDQKCmFueV90eG5fZm9yX2hlYWRlcl8yQDM6CiAgICBmcmFtZV9kaWcgLTEKICAgIGZyYW1lX2RpZyAwCiAgICBmcmFtZV9idXJ5IDEKCmFueV90eG5fZm9yX2JvZHlANDoKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjEyOQogICAgLy8gYXNzZXJ0IHR4bi5ncm91cF9pbmRleCA9PSBpbmRleAogICAgZ3R4bnMgR3JvdXBJbmRleAogICAgZnJhbWVfZGlnIDEKICAgIGR1cAogICAgY292ZXIgMgogICAgPT0KICAgIGFzc2VydAogICAgZHVwCiAgICBpbnQgMQogICAgKwogICAgZnJhbWVfYnVyeSAwCiAgICAvLyB0cmFuc2FjdGlvbi9jb250cmFjdC5weToxMjgKICAgIC8vIGZvciBpbmRleCwgdHhuIGluIHVlbnVtZXJhdGUoKHR4bjEsIHR4bjIsIHR4bjMpKToKICAgIHN3aXRjaCBhbnlfdHhuX2Zvcl9oZWFkZXJfMUAyIGFueV90eG5fZm9yX2hlYWRlcl8yQDMKICAgIHJldHN1Ygo=", "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuY2xlYXJfc3RhdGVfcHJvZ3JhbToKICAgIC8vIHRyYW5zYWN0aW9uL2NvbnRyYWN0LnB5OjExCiAgICAvLyBjbGFzcyBUcmFuc2FjdGlvbkNvbnRyYWN0KGFyYzQuQVJDNENvbnRyYWN0KToKICAgIGludCAxCiAgICByZXR1cm4K" }, "state": { diff --git a/test_cases/transaction/out/TransactionContract.destructured.ir b/test_cases/transaction/out/TransactionContract.destructured.ir index f3baff96a1..22cb207357 100644 --- a/test_cases/transaction/out/TransactionContract.destructured.ir +++ b/test_cases/transaction/out/TransactionContract.destructured.ir @@ -307,11 +307,11 @@ contract test_cases.transaction.contract.TransactionContract: let tmp%10#0: uint64 = ((gtxns GlobalNumUint) txn#0) (assert tmp%10#0) // global_num_uint let tmp%11#0: uint64 = ((gtxns GlobalNumByteSlice) txn#0) - (assert tmp%11#0) // global_num_byte_slice + (assert tmp%11#0) // global_num_bytes let tmp%12#0: uint64 = ((gtxns LocalNumUint) txn#0) (assert tmp%12#0) // local_num_uint let tmp%13#0: uint64 = ((gtxns LocalNumByteSlice) txn#0) - (assert tmp%13#0) // local_num_byte_slice + (assert tmp%13#0) // local_num_bytes let tmp%14#0: uint64 = ((gtxns ExtraProgramPages) txn#0) (assert tmp%14#0) // extra_program_pages let tmp%15#0: bytes = ((gtxns LastLog) txn#0) diff --git a/test_cases/transaction/out/TransactionContract.ssa.ir b/test_cases/transaction/out/TransactionContract.ssa.ir index ac01fb42eb..8201b5ba9a 100644 --- a/test_cases/transaction/out/TransactionContract.ssa.ir +++ b/test_cases/transaction/out/TransactionContract.ssa.ir @@ -320,11 +320,11 @@ contract test_cases.transaction.contract.TransactionContract: let tmp%10#0: uint64 = ((gtxns GlobalNumUint) txn#0) (assert tmp%10#0) // global_num_uint let tmp%11#0: uint64 = ((gtxns GlobalNumByteSlice) txn#0) - (assert tmp%11#0) // global_num_byte_slice + (assert tmp%11#0) // global_num_bytes let tmp%12#0: uint64 = ((gtxns LocalNumUint) txn#0) (assert tmp%12#0) // local_num_uint let tmp%13#0: uint64 = ((gtxns LocalNumByteSlice) txn#0) - (assert tmp%13#0) // local_num_byte_slice + (assert tmp%13#0) // local_num_bytes let tmp%14#0: uint64 = ((gtxns ExtraProgramPages) txn#0) (assert tmp%14#0) // extra_program_pages let tmp%15#0: bytes = ((gtxns LastLog) txn#0) diff --git a/test_cases/transaction/out/TransactionContract.ssa.opt_pass_1.ir b/test_cases/transaction/out/TransactionContract.ssa.opt_pass_1.ir index 00d94f3938..a4bae6e602 100644 --- a/test_cases/transaction/out/TransactionContract.ssa.opt_pass_1.ir +++ b/test_cases/transaction/out/TransactionContract.ssa.opt_pass_1.ir @@ -307,11 +307,11 @@ contract test_cases.transaction.contract.TransactionContract: let tmp%10#0: uint64 = ((gtxns GlobalNumUint) txn#0) (assert tmp%10#0) // global_num_uint let tmp%11#0: uint64 = ((gtxns GlobalNumByteSlice) txn#0) - (assert tmp%11#0) // global_num_byte_slice + (assert tmp%11#0) // global_num_bytes let tmp%12#0: uint64 = ((gtxns LocalNumUint) txn#0) (assert tmp%12#0) // local_num_uint let tmp%13#0: uint64 = ((gtxns LocalNumByteSlice) txn#0) - (assert tmp%13#0) // local_num_byte_slice + (assert tmp%13#0) // local_num_bytes let tmp%14#0: uint64 = ((gtxns ExtraProgramPages) txn#0) (assert tmp%14#0) // extra_program_pages let tmp%15#0: bytes = ((gtxns LastLog) txn#0) diff --git a/test_cases/transaction/out/client_TransactionContract.py b/test_cases/transaction/out/client_TransactionContract.py new file mode 100644 index 0000000000..1f6cd04c78 --- /dev/null +++ b/test_cases/transaction/out/client_TransactionContract.py @@ -0,0 +1,65 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class TransactionContract(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod(create=True) + def create( + self, + ) -> None: ... + + @puyapy.arc4.abimethod + def pay( + self, + txn: puyapy.gtxn.PaymentTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def key( + self, + txn: puyapy.gtxn.KeyRegistrationTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def asset_config( + self, + txn: puyapy.gtxn.AssetConfigTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def asset_transfer( + self, + txn: puyapy.gtxn.AssetTransferTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def asset_freeze( + self, + txn: puyapy.gtxn.AssetFreezeTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def application_call( + self, + txn: puyapy.gtxn.ApplicationCallTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def multiple_txns( + self, + txn1: puyapy.gtxn.ApplicationCallTransaction, + txn2: puyapy.gtxn.ApplicationCallTransaction, + txn3: puyapy.gtxn.ApplicationCallTransaction, + ) -> None: ... + + @puyapy.arc4.abimethod + def any_txn( + self, + txn1: puyapy.gtxn.Transaction, + txn2: puyapy.gtxn.Transaction, + txn3: puyapy.gtxn.Transaction, + ) -> None: ... diff --git a/test_cases/transaction/out/contract.awst b/test_cases/transaction/out/contract.awst index 0b0e54384b..d398a3d860 100644 --- a/test_cases/transaction/out/contract.awst +++ b/test_cases/transaction/out/contract.awst @@ -86,9 +86,9 @@ contract TransactionContract assert(reinterpret_cast(gtxns(txn)), comment="num_assets") assert(reinterpret_cast(gtxns(txn)), comment="num_apps") assert(reinterpret_cast(gtxns(txn)), comment="global_num_uint") - assert(reinterpret_cast(gtxns(txn)), comment="global_num_byte_slice") + assert(reinterpret_cast(gtxns(txn)), comment="global_num_bytes") assert(reinterpret_cast(gtxns(txn)), comment="local_num_uint") - assert(reinterpret_cast(gtxns(txn)), comment="local_num_byte_slice") + assert(reinterpret_cast(gtxns(txn)), comment="local_num_bytes") assert(reinterpret_cast(gtxns(txn)), comment="extra_program_pages") assert(reinterpret_cast(len(gtxns(txn))), comment="last_log") assert(reinterpret_cast(gtxns(txn)), comment="num_approval_program_pages") diff --git a/test_cases/transaction/out_O2/TransactionContract.approval.teal b/test_cases/transaction/out_O2/TransactionContract.approval.teal index 2a44b20584..15ae706547 100644 --- a/test_cases/transaction/out_O2/TransactionContract.approval.teal +++ b/test_cases/transaction/out_O2/TransactionContract.approval.teal @@ -439,13 +439,13 @@ application_call: assert // global_num_uint frame_dig -1 gtxns GlobalNumByteSlice - assert // global_num_byte_slice + assert // global_num_bytes frame_dig -1 gtxns LocalNumUint assert // local_num_uint frame_dig -1 gtxns LocalNumByteSlice - assert // local_num_byte_slice + assert // local_num_bytes frame_dig -1 gtxns ExtraProgramPages assert // extra_program_pages diff --git a/test_cases/transaction/out_O2/TransactionContract.destructured.ir b/test_cases/transaction/out_O2/TransactionContract.destructured.ir index f3baff96a1..22cb207357 100644 --- a/test_cases/transaction/out_O2/TransactionContract.destructured.ir +++ b/test_cases/transaction/out_O2/TransactionContract.destructured.ir @@ -307,11 +307,11 @@ contract test_cases.transaction.contract.TransactionContract: let tmp%10#0: uint64 = ((gtxns GlobalNumUint) txn#0) (assert tmp%10#0) // global_num_uint let tmp%11#0: uint64 = ((gtxns GlobalNumByteSlice) txn#0) - (assert tmp%11#0) // global_num_byte_slice + (assert tmp%11#0) // global_num_bytes let tmp%12#0: uint64 = ((gtxns LocalNumUint) txn#0) (assert tmp%12#0) // local_num_uint let tmp%13#0: uint64 = ((gtxns LocalNumByteSlice) txn#0) - (assert tmp%13#0) // local_num_byte_slice + (assert tmp%13#0) // local_num_bytes let tmp%14#0: uint64 = ((gtxns ExtraProgramPages) txn#0) (assert tmp%14#0) // extra_program_pages let tmp%15#0: bytes = ((gtxns LastLog) txn#0) diff --git a/test_cases/transaction/out_unoptimized/TransactionContract.approval.teal b/test_cases/transaction/out_unoptimized/TransactionContract.approval.teal index f963dc6e3e..de0b9e2c87 100644 --- a/test_cases/transaction/out_unoptimized/TransactionContract.approval.teal +++ b/test_cases/transaction/out_unoptimized/TransactionContract.approval.teal @@ -653,20 +653,20 @@ application_call: gtxns GlobalNumUint assert // global_num_uint // transaction/contract.py:97 - // assert txn.global_num_byte_slice, "global_num_byte_slice" + // assert txn.global_num_bytes, "global_num_bytes" frame_dig -1 gtxns GlobalNumByteSlice - assert // global_num_byte_slice + assert // global_num_bytes // transaction/contract.py:98 // assert txn.local_num_uint, "local_num_uint" frame_dig -1 gtxns LocalNumUint assert // local_num_uint // transaction/contract.py:99 - // assert txn.local_num_byte_slice, "local_num_byte_slice" + // assert txn.local_num_bytes, "local_num_bytes" frame_dig -1 gtxns LocalNumByteSlice - assert // local_num_byte_slice + assert // local_num_bytes // transaction/contract.py:100 // assert txn.extra_program_pages, "extra_program_pages" frame_dig -1 diff --git a/test_cases/transaction/out_unoptimized/TransactionContract.destructured.ir b/test_cases/transaction/out_unoptimized/TransactionContract.destructured.ir index 464da4d7f3..aac6627083 100644 --- a/test_cases/transaction/out_unoptimized/TransactionContract.destructured.ir +++ b/test_cases/transaction/out_unoptimized/TransactionContract.destructured.ir @@ -329,11 +329,11 @@ contract test_cases.transaction.contract.TransactionContract: let tmp%10#0: uint64 = ((gtxns GlobalNumUint) txn#0) (assert tmp%10#0) // global_num_uint let tmp%11#0: uint64 = ((gtxns GlobalNumByteSlice) txn#0) - (assert tmp%11#0) // global_num_byte_slice + (assert tmp%11#0) // global_num_bytes let tmp%12#0: uint64 = ((gtxns LocalNumUint) txn#0) (assert tmp%12#0) // local_num_uint let tmp%13#0: uint64 = ((gtxns LocalNumByteSlice) txn#0) - (assert tmp%13#0) // local_num_byte_slice + (assert tmp%13#0) // local_num_bytes let tmp%14#0: uint64 = ((gtxns ExtraProgramPages) txn#0) (assert tmp%14#0) // extra_program_pages let tmp%15#0: bytes = ((gtxns LastLog) txn#0) diff --git a/test_cases/transaction/puya.log b/test_cases/transaction/puya.log index ee422c826a..a096079743 100644 --- a/test_cases/transaction/puya.log +++ b/test_cases/transaction/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['transaction'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['transaction'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 @@ -1287,4 +1287,5 @@ debug: test_cases.transaction.contract.TransactionContract.any_txn f-stack entry debug: test_cases.transaction.contract.TransactionContract.any_txn f-stack on first store: ['index#0'] info: Writing transaction/out/TransactionContract.approval.teal info: Writing transaction/out/TransactionContract.clear.teal -info: Writing transaction/out/TransactionContract.arc32.json \ No newline at end of file +info: Writing transaction/out/TransactionContract.arc32.json +info: Writing transaction/out/client_TransactionContract.py \ No newline at end of file diff --git a/test_cases/tuple_support/puya.log b/test_cases/tuple_support/puya.log index e981fd6f87..5aa9783924 100644 --- a/test_cases/tuple_support/puya.log +++ b/test_cases/tuple_support/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['tuple_support'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['tuple_support'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/typed_abi_call/logger.py b/test_cases/typed_abi_call/logger.py new file mode 100644 index 0000000000..b79c992342 --- /dev/null +++ b/test_cases/typed_abi_call/logger.py @@ -0,0 +1,67 @@ +import typing + +from puyapy import Account, Application, ARC4Contract, Asset, Bytes, Txn, arc4, log + + +class Logger(ARC4Contract): + @arc4.abimethod + def echo(self, value: arc4.String) -> arc4.String: + return "echo: " + value + + @arc4.abimethod + def log_uint64(self, value: arc4.UInt64) -> None: + log(value) + + @arc4.abimethod + def log_uint512(self, value: arc4.UInt512) -> None: + log(value) + + @arc4.abimethod + def log_string(self, value: arc4.String) -> None: + log(value.decode()) # decode to remove header + + @arc4.abimethod + def log_bool(self, value: arc4.Bool) -> None: + log(Bytes(b"True") if value.decode() else Bytes(b"False")) + + @arc4.abimethod + def log_bytes(self, value: arc4.DynamicBytes) -> None: + log(value.bytes[2:]) # decode to remove header + + @arc4.abimethod + def log_asset_account_app(self, asset: Asset, account: Account, app: Application) -> None: + log(asset.name, account.bytes, app.address) + + @arc4.abimethod + def return_args_after_14th( + self, + _a1: arc4.UInt64, + _a2: arc4.UInt64, + _a3: arc4.UInt64, + _a4: arc4.UInt64, + _a5: arc4.UInt64, + _a6: arc4.UInt64, + _a7: arc4.UInt64, + _a8: arc4.UInt64, + _a9: arc4.UInt64, + _a10: arc4.UInt64, + _a11: arc4.UInt64, + _a12: arc4.UInt64, + _a13: arc4.UInt64, + _a14: arc4.UInt64, + a15: arc4.UInt8, + a16: arc4.UInt8, + a17: arc4.UInt8, + a18: arc4.UInt8, + a19: arc4.Tuple[arc4.UInt8, arc4.UInt8, arc4.UInt8, arc4.UInt8], + a20: arc4.UInt8, + ) -> arc4.DynamicBytes: + last_arg = arc4.Tuple((a15, a16, a17, a18, a19, a20)) + assert Txn.application_args(15) == last_arg.bytes + return arc4.DynamicBytes(last_arg.bytes) + + +class LoggerClient(arc4.ARC4Client, typing.Protocol): + @arc4.abimethod + def echo(self, value: arc4.String) -> arc4.String: + ... diff --git a/test_cases/typed_abi_call/out/Greeter.approval.mir b/test_cases/typed_abi_call/out/Greeter.approval.mir new file mode 100644 index 0000000000..68160f7d0a --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.approval.mir @@ -0,0 +1,676 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 10 + +// test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%0#0 to l-stack (no copy) tmp%0#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%0#0 from l-stack (no copy) tmp%0#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + bz main_bare_routing@9 // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // Implicit fall through to main_abi_routing@1 // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + +main_abi_routing@1: + txna ApplicationArgs 0 // {txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%1#0 to l-stack (no copy) tmp%1#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + method "test_method_selector_kinds(application)void" // tmp%1#0,method<"test_method_selector_kinds(application)void"> class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + method "test_arg_conversion(application)void" // tmp%1#0,method<"test_method_selector_kinds(application)void">,method<"test_arg_conversion(application)void"> class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + method "test_15plus_args(application)void" // tmp%1#0,method<"test_method_selector_kinds(application)void">,method<"test_arg_conversion(application)void">,method<"test_15plus_args(application)void"> class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + method "test_void(application)void" // tmp%1#0,method<"test_method_selector_kinds(application)void">,method<"test_arg_conversion(application)void">,method<"test_15plus_args(application)void">,method<"test_void(application)void"> class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + method "test_ref_types(application,asset)void" // tmp%1#0,method<"test_method_selector_kinds(application)void">,method<"test_arg_conversion(application)void">,method<"test_15plus_args(application)void">,method<"test_void(application)void">,method<"test_ref_types(application,asset)void"> class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + uncover 5 // load tmp%1#0 from l-stack (no copy) method<"test_method_selector_kinds(application)void">,method<"test_arg_conversion(application)void">,method<"test_15plus_args(application)void">,method<"test_void(application)void">,method<"test_ref_types(application,asset)void">,tmp%1#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + match main_test_method_selector_kinds_route@2 main_test_arg_conversion_route@3 main_test_15plus_args_route@4 main_test_void_route@5 main_test_ref_types_route@6 // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + err // reject transaction // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + +main_test_method_selector_kinds_route@2: + txn OnCompletion // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:7 + // virtual: store tmp%2#0 to l-stack (no copy) tmp%2#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + // virtual: load tmp%2#0 from l-stack (no copy) tmp%2#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + ! // {!} arc4.abimethod() typed_abi_call/typed_c2c.py:7 + // virtual: store tmp%3#0 to l-stack (no copy) tmp%3#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + // virtual: load tmp%3#0 from l-stack (no copy) tmp%3#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + assert // OnCompletion is NoOp // arc4.abimethod() typed_abi_call/typed_c2c.py:7 + txn ApplicationID // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:7 + // virtual: store tmp%4#0 to l-stack (no copy) tmp%4#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + // virtual: load tmp%4#0 from l-stack (no copy) tmp%4#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + assert // is not creating // arc4.abimethod() typed_abi_call/typed_c2c.py:7 + txna ApplicationArgs 1 // {txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%5#0 to l-stack (no copy) tmp%5#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%5#0 from l-stack (no copy) tmp%5#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + btoi // {btoi} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%6#0 to l-stack (no copy) tmp%6#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%6#0 from l-stack (no copy) tmp%6#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txnas Applications // {txnas} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%7#0 to l-stack (no copy) tmp%7#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%7#0 from l-stack (no copy) tmp%7#0 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + callsub test_method_selector_kinds // arc4.abimethod() typed_abi_call/typed_c2c.py:7 + int 1 // 1 arc4.abimethod() typed_abi_call/typed_c2c.py:7 + return // arc4.abimethod() typed_abi_call/typed_c2c.py:7 + +main_test_arg_conversion_route@3: + txn OnCompletion // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:20 + // virtual: store tmp%8#0 to l-stack (no copy) tmp%8#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + // virtual: load tmp%8#0 from l-stack (no copy) tmp%8#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + ! // {!} arc4.abimethod() typed_abi_call/typed_c2c.py:20 + // virtual: store tmp%9#0 to l-stack (no copy) tmp%9#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + // virtual: load tmp%9#0 from l-stack (no copy) tmp%9#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + assert // OnCompletion is NoOp // arc4.abimethod() typed_abi_call/typed_c2c.py:20 + txn ApplicationID // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:20 + // virtual: store tmp%10#0 to l-stack (no copy) tmp%10#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + // virtual: load tmp%10#0 from l-stack (no copy) tmp%10#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + assert // is not creating // arc4.abimethod() typed_abi_call/typed_c2c.py:20 + txna ApplicationArgs 1 // {txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%11#0 to l-stack (no copy) tmp%11#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%11#0 from l-stack (no copy) tmp%11#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + btoi // {btoi} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%12#0 to l-stack (no copy) tmp%12#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%12#0 from l-stack (no copy) tmp%12#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txnas Applications // {txnas} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%13#0 to l-stack (no copy) tmp%13#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%13#0 from l-stack (no copy) tmp%13#0 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + callsub test_arg_conversion // arc4.abimethod() typed_abi_call/typed_c2c.py:20 + int 1 // 1 arc4.abimethod() typed_abi_call/typed_c2c.py:20 + return // arc4.abimethod() typed_abi_call/typed_c2c.py:20 + +main_test_15plus_args_route@4: + txn OnCompletion // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:37 + // virtual: store tmp%14#0 to l-stack (no copy) tmp%14#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + // virtual: load tmp%14#0 from l-stack (no copy) tmp%14#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + ! // {!} arc4.abimethod() typed_abi_call/typed_c2c.py:37 + // virtual: store tmp%15#0 to l-stack (no copy) tmp%15#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + // virtual: load tmp%15#0 from l-stack (no copy) tmp%15#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + assert // OnCompletion is NoOp // arc4.abimethod() typed_abi_call/typed_c2c.py:37 + txn ApplicationID // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:37 + // virtual: store tmp%16#0 to l-stack (no copy) tmp%16#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + // virtual: load tmp%16#0 from l-stack (no copy) tmp%16#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + assert // is not creating // arc4.abimethod() typed_abi_call/typed_c2c.py:37 + txna ApplicationArgs 1 // {txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%17#0 to l-stack (no copy) tmp%17#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%17#0 from l-stack (no copy) tmp%17#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + btoi // {btoi} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%18#0 to l-stack (no copy) tmp%18#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%18#0 from l-stack (no copy) tmp%18#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txnas Applications // {txnas} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%19#0 to l-stack (no copy) tmp%19#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%19#0 from l-stack (no copy) tmp%19#0 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + callsub test_15plus_args // arc4.abimethod() typed_abi_call/typed_c2c.py:37 + int 1 // 1 arc4.abimethod() typed_abi_call/typed_c2c.py:37 + return // arc4.abimethod() typed_abi_call/typed_c2c.py:37 + +main_test_void_route@5: + txn OnCompletion // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:66 + // virtual: store tmp%20#0 to l-stack (no copy) tmp%20#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + // virtual: load tmp%20#0 from l-stack (no copy) tmp%20#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + ! // {!} arc4.abimethod() typed_abi_call/typed_c2c.py:66 + // virtual: store tmp%21#0 to l-stack (no copy) tmp%21#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + // virtual: load tmp%21#0 from l-stack (no copy) tmp%21#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + assert // OnCompletion is NoOp // arc4.abimethod() typed_abi_call/typed_c2c.py:66 + txn ApplicationID // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:66 + // virtual: store tmp%22#0 to l-stack (no copy) tmp%22#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + // virtual: load tmp%22#0 from l-stack (no copy) tmp%22#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + assert // is not creating // arc4.abimethod() typed_abi_call/typed_c2c.py:66 + txna ApplicationArgs 1 // {txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%23#0 to l-stack (no copy) tmp%23#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%23#0 from l-stack (no copy) tmp%23#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + btoi // {btoi} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%24#0 to l-stack (no copy) tmp%24#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%24#0 from l-stack (no copy) tmp%24#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txnas Applications // {txnas} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%25#0 to l-stack (no copy) tmp%25#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%25#0 from l-stack (no copy) tmp%25#0 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + callsub test_void // arc4.abimethod() typed_abi_call/typed_c2c.py:66 + int 1 // 1 arc4.abimethod() typed_abi_call/typed_c2c.py:66 + return // arc4.abimethod() typed_abi_call/typed_c2c.py:66 + +main_test_ref_types_route@6: + txn OnCompletion // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: store tmp%26#0 to l-stack (no copy) tmp%26#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: load tmp%26#0 from l-stack (no copy) tmp%26#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + ! // {!} arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: store tmp%27#0 to l-stack (no copy) tmp%27#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: load tmp%27#0 from l-stack (no copy) tmp%27#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + assert // OnCompletion is NoOp // arc4.abimethod() typed_abi_call/typed_c2c.py:80 + txn ApplicationID // {txn} arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: store tmp%28#0 to l-stack (no copy) tmp%28#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: load tmp%28#0 from l-stack (no copy) tmp%28#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + assert // is not creating // arc4.abimethod() typed_abi_call/typed_c2c.py:80 + txna ApplicationArgs 1 // {txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%29#0 to l-stack (no copy) tmp%29#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%29#0 from l-stack (no copy) tmp%29#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + btoi // {btoi} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%30#0 to l-stack (no copy) tmp%30#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%30#0 from l-stack (no copy) tmp%30#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txnas Applications // {txnas} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%31#0 to l-stack (no copy) tmp%31#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txna ApplicationArgs 2 // tmp%31#0,{txna} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%32#0 to l-stack (no copy) tmp%31#0,tmp%32#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%32#0 from l-stack (no copy) tmp%31#0,tmp%32#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + btoi // tmp%31#0,{btoi} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%33#0 to l-stack (no copy) tmp%31#0,tmp%33#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%33#0 from l-stack (no copy) tmp%31#0,tmp%33#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txnas Assets // tmp%31#0,{txnas} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%34#0 to l-stack (no copy) tmp%31#0,tmp%34#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%31#0 from l-stack (no copy) tmp%34#0,tmp%31#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + // virtual: load tmp%34#0 from l-stack (no copy) tmp%31#0,tmp%34#0 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + callsub test_ref_types // arc4.abimethod() typed_abi_call/typed_c2c.py:80 + int 1 // 1 arc4.abimethod() typed_abi_call/typed_c2c.py:80 + return // arc4.abimethod() typed_abi_call/typed_c2c.py:80 + +main_bare_routing@9: + txn OnCompletion // {txn} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%35#0 to l-stack (no copy) tmp%35#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%35#0 from l-stack (no copy) tmp%35#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + ! // {!} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store not%tmp%35#0 to l-stack (no copy) not%tmp%35#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load not%tmp%35#0 from l-stack (no copy) not%tmp%35#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + assert // reject transaction // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + txn ApplicationID // {txn} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%36#0 to l-stack (no copy) tmp%36#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%36#0 from l-stack (no copy) tmp%36#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + ! // {!} class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: store tmp%37#0 to l-stack (no copy) tmp%37#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + // virtual: load tmp%37#0 from l-stack (no copy) tmp%37#0 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + assert // is creating // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + int 1 // 1 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + return // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: +test_method_selector_kinds: + proto 1 0 // (𝕡) app#0 | @arc4.abimethod()\ndef test_method_selector_kinds(self, app: Application) -> None: typed_abi_call/typed_c2c.py:7-8 + +test_method_selector_kinds_block@0: + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:9 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "echo(string)string" // (𝕡) app#0 | method<"echo(string)string"> arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x05test1" // (𝕡) app#0 | "\x00\x05test1" arc4.String("test1") typed_abi_call/typed_c2c.py:9 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: store tmp_itxn_0%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | tmp_itxn_0%%LastLog#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + dup // load tmp_itxn_0%%LastLog#0 from l-stack (copy) (𝕡) app#0 | tmp_itxn_0%%LastLog#0,tmp_itxn_0%%LastLog#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + extract 4 0 // (𝕡) app#0 | tmp_itxn_0%%LastLog#0,{extract} arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + swap // store result#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_0%%LastLog#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: load tmp_itxn_0%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_0%%LastLog#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + extract 0 4 // (𝕡) app#0 | result#0,{extract} arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%3#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%3#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + byte 0x151f7c75 // (𝕡) app#0 | result#0,tmp%3#0,0x151f7c75 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + == // (𝕡) app#0 | result#0,{==} arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: store tmp%4#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%4#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: load tmp%4#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%4#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + assert // ARC4 prefix is valid // (𝕡) app#0 | result#0 arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:9 + // virtual: load result#0 from l-stack (no copy) (𝕡) app#0 | result#0 result == "echo: test1" typed_abi_call/typed_c2c.py:10 + byte "\x00\x0becho: test1" // (𝕡) app#0 | result#0,"\x00\x0becho: test1" "echo: test1" typed_abi_call/typed_c2c.py:10 + == // (𝕡) app#0 | {==} result == "echo: test1" typed_abi_call/typed_c2c.py:10 + // virtual: store tmp%7#0 to l-stack (no copy) (𝕡) app#0 | tmp%7#0 result == "echo: test1" typed_abi_call/typed_c2c.py:10 + // virtual: load tmp%7#0 from l-stack (no copy) (𝕡) app#0 | tmp%7#0 assert result == "echo: test1" typed_abi_call/typed_c2c.py:10 + assert // (𝕡) app#0 | assert result == "echo: test1" typed_abi_call/typed_c2c.py:10 + itxn_begin // (𝕡) app#0 | arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + int appl // (𝕡) app#0 | appl arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:11 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "echo(string)string" // (𝕡) app#0 | method<"echo(string)string"> arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x05test2" // (𝕡) app#0 | "\x00\x05test2" "test2" typed_abi_call/typed_c2c.py:11 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: store tmp_itxn_1%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | tmp_itxn_1%%LastLog#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + dup // load tmp_itxn_1%%LastLog#0 from l-stack (copy) (𝕡) app#0 | tmp_itxn_1%%LastLog#0,tmp_itxn_1%%LastLog#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + extract 4 0 // (𝕡) app#0 | tmp_itxn_1%%LastLog#0,{extract} arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + swap // store result#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_1%%LastLog#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: load tmp_itxn_1%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_1%%LastLog#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + extract 0 4 // (𝕡) app#0 | result#0,{extract} arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: store tmp%11#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%11#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: load tmp%11#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%11#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + byte 0x151f7c75 // (𝕡) app#0 | result#0,tmp%11#0,0x151f7c75 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + == // (𝕡) app#0 | result#0,{==} arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: store tmp%12#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%12#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: load tmp%12#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%12#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + assert // ARC4 prefix is valid // (𝕡) app#0 | result#0 arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:11 + // virtual: load result#0 from l-stack (no copy) (𝕡) app#0 | result#0 result == "echo: test2" typed_abi_call/typed_c2c.py:12 + byte "\x00\x0becho: test2" // (𝕡) app#0 | result#0,"\x00\x0becho: test2" "echo: test2" typed_abi_call/typed_c2c.py:12 + == // (𝕡) app#0 | {==} result == "echo: test2" typed_abi_call/typed_c2c.py:12 + // virtual: store tmp%15#0 to l-stack (no copy) (𝕡) app#0 | tmp%15#0 result == "echo: test2" typed_abi_call/typed_c2c.py:12 + // virtual: load tmp%15#0 from l-stack (no copy) (𝕡) app#0 | tmp%15#0 assert result == "echo: test2" typed_abi_call/typed_c2c.py:12 + assert // (𝕡) app#0 | assert result == "echo: test2" typed_abi_call/typed_c2c.py:12 + itxn_begin // (𝕡) app#0 | arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + int appl // (𝕡) app#0 | appl arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:13 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "echo(string)string" // (𝕡) app#0 | method<"echo(string)string"> arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x05test3" // (𝕡) app#0 | "\x00\x05test3" "test3" typed_abi_call/typed_c2c.py:13 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: store tmp_itxn_2%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | tmp_itxn_2%%LastLog#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + dup // load tmp_itxn_2%%LastLog#0 from l-stack (copy) (𝕡) app#0 | tmp_itxn_2%%LastLog#0,tmp_itxn_2%%LastLog#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + extract 4 0 // (𝕡) app#0 | tmp_itxn_2%%LastLog#0,{extract} arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + swap // store result#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_2%%LastLog#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: load tmp_itxn_2%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_2%%LastLog#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + extract 0 4 // (𝕡) app#0 | result#0,{extract} arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: store tmp%19#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%19#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: load tmp%19#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%19#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + byte 0x151f7c75 // (𝕡) app#0 | result#0,tmp%19#0,0x151f7c75 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + == // (𝕡) app#0 | result#0,{==} arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: store tmp%20#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%20#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: load tmp%20#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%20#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + assert // ARC4 prefix is valid // (𝕡) app#0 | result#0 arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) typed_abi_call/typed_c2c.py:13 + // virtual: load result#0 from l-stack (no copy) (𝕡) app#0 | result#0 result == "echo: test3" typed_abi_call/typed_c2c.py:14 + byte "\x00\x0becho: test3" // (𝕡) app#0 | result#0,"\x00\x0becho: test3" "echo: test3" typed_abi_call/typed_c2c.py:14 + == // (𝕡) app#0 | {==} result == "echo: test3" typed_abi_call/typed_c2c.py:14 + // virtual: store tmp%23#0 to l-stack (no copy) (𝕡) app#0 | tmp%23#0 result == "echo: test3" typed_abi_call/typed_c2c.py:14 + // virtual: load tmp%23#0 from l-stack (no copy) (𝕡) app#0 | tmp%23#0 assert result == "echo: test3" typed_abi_call/typed_c2c.py:14 + assert // (𝕡) app#0 | assert result == "echo: test3" typed_abi_call/typed_c2c.py:14 + itxn_begin // (𝕡) app#0 | arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + int appl // (𝕡) app#0 | appl arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:15 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "echo(string)string" // (𝕡) app#0 | method<"echo(string)string"> arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x05test4" // (𝕡) app#0 | "\x00\x05test4" "test4" typed_abi_call/typed_c2c.py:15 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: store tmp_itxn_3%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | tmp_itxn_3%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + dup // load tmp_itxn_3%%LastLog#0 from l-stack (copy) (𝕡) app#0 | tmp_itxn_3%%LastLog#0,tmp_itxn_3%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + extract 4 0 // (𝕡) app#0 | tmp_itxn_3%%LastLog#0,{extract} arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + swap // store result#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_3%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: load tmp_itxn_3%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_3%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + extract 0 4 // (𝕡) app#0 | result#0,{extract} arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: store tmp%27#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%27#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: load tmp%27#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%27#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + byte 0x151f7c75 // (𝕡) app#0 | result#0,tmp%27#0,0x151f7c75 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + == // (𝕡) app#0 | result#0,{==} arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: store tmp%28#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%28#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: load tmp%28#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%28#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + assert // ARC4 prefix is valid // (𝕡) app#0 | result#0 arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:15 + // virtual: load result#0 from l-stack (no copy) (𝕡) app#0 | result#0 result == "echo: test4" typed_abi_call/typed_c2c.py:16 + byte "\x00\x0becho: test4" // (𝕡) app#0 | result#0,"\x00\x0becho: test4" "echo: test4" typed_abi_call/typed_c2c.py:16 + == // (𝕡) app#0 | {==} result == "echo: test4" typed_abi_call/typed_c2c.py:16 + // virtual: store tmp%31#0 to l-stack (no copy) (𝕡) app#0 | tmp%31#0 result == "echo: test4" typed_abi_call/typed_c2c.py:16 + // virtual: load tmp%31#0 from l-stack (no copy) (𝕡) app#0 | tmp%31#0 assert result == "echo: test4" typed_abi_call/typed_c2c.py:16 + assert // (𝕡) app#0 | assert result == "echo: test4" typed_abi_call/typed_c2c.py:16 + itxn_begin // (𝕡) app#0 | arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + int appl // (𝕡) app#0 | appl arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:17 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "echo(string)string" // (𝕡) app#0 | method<"echo(string)string"> arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x05test5" // (𝕡) app#0 | "\x00\x05test5" "test5" typed_abi_call/typed_c2c.py:17 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: store tmp_itxn_4%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | tmp_itxn_4%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + dup // load tmp_itxn_4%%LastLog#0 from l-stack (copy) (𝕡) app#0 | tmp_itxn_4%%LastLog#0,tmp_itxn_4%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + extract 4 0 // (𝕡) app#0 | tmp_itxn_4%%LastLog#0,{extract} arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + swap // store result#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_4%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: load tmp_itxn_4%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_4%%LastLog#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + extract 0 4 // (𝕡) app#0 | result#0,{extract} arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: store tmp%35#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%35#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: load tmp%35#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%35#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + byte 0x151f7c75 // (𝕡) app#0 | result#0,tmp%35#0,0x151f7c75 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + == // (𝕡) app#0 | result#0,{==} arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: store tmp%36#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%36#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: load tmp%36#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%36#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + assert // ARC4 prefix is valid // (𝕡) app#0 | result#0 arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) typed_abi_call/typed_c2c.py:17 + // virtual: load result#0 from l-stack (no copy) (𝕡) app#0 | result#0 result == "echo: test5" typed_abi_call/typed_c2c.py:18 + byte "\x00\x0becho: test5" // (𝕡) app#0 | result#0,"\x00\x0becho: test5" "echo: test5" typed_abi_call/typed_c2c.py:18 + == // (𝕡) app#0 | {==} result == "echo: test5" typed_abi_call/typed_c2c.py:18 + // virtual: store tmp%39#0 to l-stack (no copy) (𝕡) app#0 | tmp%39#0 result == "echo: test5" typed_abi_call/typed_c2c.py:18 + // virtual: load tmp%39#0 from l-stack (no copy) (𝕡) app#0 | tmp%39#0 assert result == "echo: test5" typed_abi_call/typed_c2c.py:18 + assert // (𝕡) app#0 | assert result == "echo: test5" typed_abi_call/typed_c2c.py:18 + retsub // + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: +test_arg_conversion: + proto 1 0 // (𝕡) app#0 | @arc4.abimethod()\ndef test_arg_conversion(self, app: Application) -> None: typed_abi_call/typed_c2c.py:20-21 + +test_arg_conversion_block@0: + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:22 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:22 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:22 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_string(string)void" // (𝕡) app#0 | method<"log_string(string)void"> arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:22 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\nconverted1" // (𝕡) app#0 | "\x00\nconverted1" "converted1" typed_abi_call/typed_c2c.py:22 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:22 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:22 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:22 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"converted1" typed_abi_call/typed_c2c.py:23 + byte "converted1" // (𝕡) app#0 | txn%%LastLog#0,"converted1" b"converted1" typed_abi_call/typed_c2c.py:23 + == // (𝕡) app#0 | {==} txn.last_log == b"converted1" typed_abi_call/typed_c2c.py:23 + // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) app#0 | tmp%1#0 txn.last_log == b"converted1" typed_abi_call/typed_c2c.py:23 + // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) app#0 | tmp%1#0 assert txn.last_log == b"converted1" typed_abi_call/typed_c2c.py:23 + assert // (𝕡) app#0 | assert txn.last_log == b"converted1" typed_abi_call/typed_c2c.py:23 + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) typed_abi_call/typed_c2c.py:25 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) typed_abi_call/typed_c2c.py:25 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:25 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_uint64(uint64)void" // (𝕡) app#0 | method<"log_uint64(uint64)void"> arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) typed_abi_call/typed_c2c.py:25 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000002 // (𝕡) app#0 | 0x0000000000000002 2 typed_abi_call/typed_c2c.py:25 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) typed_abi_call/typed_c2c.py:25 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) typed_abi_call/typed_c2c.py:25 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) typed_abi_call/typed_c2c.py:25 + int 2 // (𝕡) app#0 | txn%%LastLog#0,2 2 typed_abi_call/typed_c2c.py:26 + itob // (𝕡) app#0 | txn%%LastLog#0,{itob} op.itob(2) typed_abi_call/typed_c2c.py:26 + // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0,tmp%3#0 op.itob(2) typed_abi_call/typed_c2c.py:26 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | tmp%3#0,txn%%LastLog#0 txn.last_log == op.itob(2) typed_abi_call/typed_c2c.py:26 + // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0,tmp%3#0 txn.last_log == op.itob(2) typed_abi_call/typed_c2c.py:26 + == // (𝕡) app#0 | {==} txn.last_log == op.itob(2) typed_abi_call/typed_c2c.py:26 + // virtual: store tmp%4#0 to l-stack (no copy) (𝕡) app#0 | tmp%4#0 txn.last_log == op.itob(2) typed_abi_call/typed_c2c.py:26 + // virtual: load tmp%4#0 from l-stack (no copy) (𝕡) app#0 | tmp%4#0 assert txn.last_log == op.itob(2) typed_abi_call/typed_c2c.py:26 + assert // (𝕡) app#0 | assert txn.last_log == op.itob(2) typed_abi_call/typed_c2c.py:26 + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) typed_abi_call/typed_c2c.py:28 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) typed_abi_call/typed_c2c.py:28 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:28 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_uint512(uint512)void" // (𝕡) app#0 | method<"log_uint512(uint512)void"> arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) typed_abi_call/typed_c2c.py:28 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 // (𝕡) app#0 | 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 3 typed_abi_call/typed_c2c.py:28 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) typed_abi_call/typed_c2c.py:28 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) typed_abi_call/typed_c2c.py:28 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) typed_abi_call/typed_c2c.py:28 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == (op.bzero(56) + op.itob(3)) typed_abi_call/typed_c2c.py:29 + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 // (𝕡) app#0 | txn%%LastLog#0,0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 op.bzero(56) + op.itob(3) typed_abi_call/typed_c2c.py:29 + == // (𝕡) app#0 | {==} txn.last_log == (op.bzero(56) + op.itob(3)) typed_abi_call/typed_c2c.py:29 + // virtual: store tmp%9#0 to l-stack (no copy) (𝕡) app#0 | tmp%9#0 txn.last_log == (op.bzero(56) + op.itob(3)) typed_abi_call/typed_c2c.py:29 + // virtual: load tmp%9#0 from l-stack (no copy) (𝕡) app#0 | tmp%9#0 assert txn.last_log == (op.bzero(56) + op.itob(3)) typed_abi_call/typed_c2c.py:29 + assert // (𝕡) app#0 | assert txn.last_log == (op.bzero(56) + op.itob(3)) typed_abi_call/typed_c2c.py:29 + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:31 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:31 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:31 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_bytes(byte[])void" // (𝕡) app#0 | method<"log_bytes(byte[])void"> arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:31 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x000134 // (𝕡) app#0 | 0x000134 b"4" typed_abi_call/typed_c2c.py:31 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:31 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:31 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:31 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"4" typed_abi_call/typed_c2c.py:32 + byte "4" // (𝕡) app#0 | txn%%LastLog#0,"4" b"4" typed_abi_call/typed_c2c.py:32 + == // (𝕡) app#0 | {==} txn.last_log == b"4" typed_abi_call/typed_c2c.py:32 + // virtual: store tmp%11#0 to l-stack (no copy) (𝕡) app#0 | tmp%11#0 txn.last_log == b"4" typed_abi_call/typed_c2c.py:32 + // virtual: load tmp%11#0 from l-stack (no copy) (𝕡) app#0 | tmp%11#0 assert txn.last_log == b"4" typed_abi_call/typed_c2c.py:32 + assert // (𝕡) app#0 | assert txn.last_log == b"4" typed_abi_call/typed_c2c.py:32 + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) typed_abi_call/typed_c2c.py:34 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) typed_abi_call/typed_c2c.py:34 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:34 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_bool(bool)void" // (𝕡) app#0 | method<"log_bool(bool)void"> arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) typed_abi_call/typed_c2c.py:34 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x80 // (𝕡) app#0 | 0x80 True typed_abi_call/typed_c2c.py:34 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) typed_abi_call/typed_c2c.py:34 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) typed_abi_call/typed_c2c.py:34 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) typed_abi_call/typed_c2c.py:34 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"True" typed_abi_call/typed_c2c.py:35 + byte "True" // (𝕡) app#0 | txn%%LastLog#0,"True" b"True" typed_abi_call/typed_c2c.py:35 + == // (𝕡) app#0 | {==} txn.last_log == b"True" typed_abi_call/typed_c2c.py:35 + // virtual: store tmp%14#0 to l-stack (no copy) (𝕡) app#0 | tmp%14#0 txn.last_log == b"True" typed_abi_call/typed_c2c.py:35 + // virtual: load tmp%14#0 from l-stack (no copy) (𝕡) app#0 | tmp%14#0 assert txn.last_log == b"True" typed_abi_call/typed_c2c.py:35 + assert // (𝕡) app#0 | assert txn.last_log == b"True" typed_abi_call/typed_c2c.py:35 + retsub // + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: +test_15plus_args: + proto 1 0 // (𝕡) app#0 | @arc4.abimethod()\ndef test_15plus_args(self, app: Application) -> None: typed_abi_call/typed_c2c.py:37-38 + +test_15plus_args_block@0: + itxn_begin // (𝕡) app#0 | arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + int appl // (𝕡) app#0 | appl arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:62 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" // (𝕡) app#0 | method<"return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]"> arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000001 // (𝕡) app#0 | 0x0000000000000001 1 typed_abi_call/typed_c2c.py:41 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000002 // (𝕡) app#0 | 0x0000000000000002 2 typed_abi_call/typed_c2c.py:42 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000003 // (𝕡) app#0 | 0x0000000000000003 3 typed_abi_call/typed_c2c.py:43 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000004 // (𝕡) app#0 | 0x0000000000000004 4 typed_abi_call/typed_c2c.py:44 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000005 // (𝕡) app#0 | 0x0000000000000005 5 typed_abi_call/typed_c2c.py:45 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000006 // (𝕡) app#0 | 0x0000000000000006 6 typed_abi_call/typed_c2c.py:46 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000007 // (𝕡) app#0 | 0x0000000000000007 7 typed_abi_call/typed_c2c.py:47 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000008 // (𝕡) app#0 | 0x0000000000000008 8 typed_abi_call/typed_c2c.py:48 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0000000000000009 // (𝕡) app#0 | 0x0000000000000009 9 typed_abi_call/typed_c2c.py:49 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x000000000000000a // (𝕡) app#0 | 0x000000000000000a 10 typed_abi_call/typed_c2c.py:50 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x000000000000000b // (𝕡) app#0 | 0x000000000000000b 11 typed_abi_call/typed_c2c.py:51 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x000000000000000c // (𝕡) app#0 | 0x000000000000000c 12 typed_abi_call/typed_c2c.py:52 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x000000000000000d // (𝕡) app#0 | 0x000000000000000d 13 typed_abi_call/typed_c2c.py:53 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x000000000000000e // (𝕡) app#0 | 0x000000000000000e 14 typed_abi_call/typed_c2c.py:54 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte 0x0f101112deadbeef14 // (𝕡) app#0 | 0x0f101112deadbeef14 15,\n16,\n17,\n18,\narc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(... typed_abi_call/typed_c2c.py:55-60 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: store tmp_itxn_0%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | tmp_itxn_0%%LastLog#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + dup // load tmp_itxn_0%%LastLog#0 from l-stack (copy) (𝕡) app#0 | tmp_itxn_0%%LastLog#0,tmp_itxn_0%%LastLog#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + extract 4 0 // (𝕡) app#0 | tmp_itxn_0%%LastLog#0,{extract} arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + swap // store result#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_0%%LastLog#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: load tmp_itxn_0%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp_itxn_0%%LastLog#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + extract 0 4 // (𝕡) app#0 | result#0,{extract} arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: store tmp%7#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%7#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: load tmp%7#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%7#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + byte 0x151f7c75 // (𝕡) app#0 | result#0,tmp%7#0,0x151f7c75 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + == // (𝕡) app#0 | result#0,{==} arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: store tmp%8#0 to l-stack (no copy) (𝕡) app#0 | result#0,tmp%8#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: load tmp%8#0 from l-stack (no copy) (𝕡) app#0 | result#0,tmp%8#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + assert // ARC4 prefix is valid // (𝕡) app#0 | result#0 arc4.abi_call(\nLogger.return_args_after_14th,\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,... typed_abi_call/typed_c2c.py:39-63 + // virtual: load result#0 from l-stack (no copy) (𝕡) app#0 | result#0 result.decode() typed_abi_call/typed_c2c.py:64 + extract 2 0 // (𝕡) app#0 | {extract} result.decode() typed_abi_call/typed_c2c.py:64 + // virtual: store tmp%11#0 to l-stack (no copy) (𝕡) app#0 | tmp%11#0 result.decode() typed_abi_call/typed_c2c.py:64 + // virtual: load tmp%11#0 from l-stack (no copy) (𝕡) app#0 | tmp%11#0 result.decode() == Bytes.from_hex("0F101112DEADBEEF14") typed_abi_call/typed_c2c.py:64 + byte 0x0f101112deadbeef14 // (𝕡) app#0 | tmp%11#0,0x0f101112deadbeef14 Bytes.from_hex("0F101112DEADBEEF14") typed_abi_call/typed_c2c.py:64 + == // (𝕡) app#0 | {==} result.decode() == Bytes.from_hex("0F101112DEADBEEF14") typed_abi_call/typed_c2c.py:64 + // virtual: store tmp%12#0 to l-stack (no copy) (𝕡) app#0 | tmp%12#0 result.decode() == Bytes.from_hex("0F101112DEADBEEF14") typed_abi_call/typed_c2c.py:64 + // virtual: load tmp%12#0 from l-stack (no copy) (𝕡) app#0 | tmp%12#0 assert result.decode() == Bytes.from_hex("0F101112DEADBEEF14") typed_abi_call/typed_c2c.py:64 + assert // (𝕡) app#0 | assert result.decode() == Bytes.from_hex("0F101112DEADBEEF14") typed_abi_call/typed_c2c.py:64 + retsub // + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: +test_void: + proto 1 0 // (𝕡) app#0 | @arc4.abimethod()\ndef test_void(self, app: Application) -> None: typed_abi_call/typed_c2c.py:66-67 + +test_void_block@0: + itxn_begin // (𝕡) app#0 | arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:68 + int appl // (𝕡) app#0 | appl arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:68 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:68 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_string(string)void" // (𝕡) app#0 | method<"log_string(string)void"> arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:68 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x06World1" // (𝕡) app#0 | "\x00\x06World1" "World1" typed_abi_call/typed_c2c.py:68 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:68 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:68 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) typed_abi_call/typed_c2c.py:68 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"World1" typed_abi_call/typed_c2c.py:69 + byte "World1" // (𝕡) app#0 | txn%%LastLog#0,"World1" b"World1" typed_abi_call/typed_c2c.py:69 + == // (𝕡) app#0 | {==} txn.last_log == b"World1" typed_abi_call/typed_c2c.py:69 + // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) app#0 | tmp%1#0 txn.last_log == b"World1" typed_abi_call/typed_c2c.py:69 + // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) app#0 | tmp%1#0 assert txn.last_log == b"World1" typed_abi_call/typed_c2c.py:69 + assert // (𝕡) app#0 | assert txn.last_log == b"World1" typed_abi_call/typed_c2c.py:69 + itxn_begin // (𝕡) app#0 | arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:71 + int appl // (𝕡) app#0 | appl arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:71 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:71 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_string(string)void" // (𝕡) app#0 | method<"log_string(string)void"> arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:71 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x06World2" // (𝕡) app#0 | "\x00\x06World2" "World2" typed_abi_call/typed_c2c.py:71 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:71 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:71 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) typed_abi_call/typed_c2c.py:71 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"World2" typed_abi_call/typed_c2c.py:72 + byte "World2" // (𝕡) app#0 | txn%%LastLog#0,"World2" b"World2" typed_abi_call/typed_c2c.py:72 + == // (𝕡) app#0 | {==} txn.last_log == b"World2" typed_abi_call/typed_c2c.py:72 + // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) app#0 | tmp%3#0 txn.last_log == b"World2" typed_abi_call/typed_c2c.py:72 + // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) app#0 | tmp%3#0 assert txn.last_log == b"World2" typed_abi_call/typed_c2c.py:72 + assert // (𝕡) app#0 | assert txn.last_log == b"World2" typed_abi_call/typed_c2c.py:72 + itxn_begin // (𝕡) app#0 | arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:74 + int appl // (𝕡) app#0 | appl arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:74 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:74 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_string(string)void" // (𝕡) app#0 | method<"log_string(string)void"> arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:74 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x06World3" // (𝕡) app#0 | "\x00\x06World3" arc4.String("World3") typed_abi_call/typed_c2c.py:74 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:74 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:74 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) typed_abi_call/typed_c2c.py:74 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"World3" typed_abi_call/typed_c2c.py:75 + byte "World3" // (𝕡) app#0 | txn%%LastLog#0,"World3" b"World3" typed_abi_call/typed_c2c.py:75 + == // (𝕡) app#0 | {==} txn.last_log == b"World3" typed_abi_call/typed_c2c.py:75 + // virtual: store tmp%5#0 to l-stack (no copy) (𝕡) app#0 | tmp%5#0 txn.last_log == b"World3" typed_abi_call/typed_c2c.py:75 + // virtual: load tmp%5#0 from l-stack (no copy) (𝕡) app#0 | tmp%5#0 assert txn.last_log == b"World3" typed_abi_call/typed_c2c.py:75 + assert // (𝕡) app#0 | assert txn.last_log == b"World3" typed_abi_call/typed_c2c.py:75 + itxn_begin // (𝕡) app#0 | arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:77 + int appl // (𝕡) app#0 | appl arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:77 + itxn_field TypeEnum // (𝕡) app#0 | + int 0 // (𝕡) app#0 | 0 0 typed_abi_call/typed_c2c.py:77 + itxn_field Fee // (𝕡) app#0 | + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 + itxn_field ApplicationID // (𝕡) app#0 | + method "log_string(string)void" // (𝕡) app#0 | method<"log_string(string)void"> arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:77 + itxn_field ApplicationArgs // (𝕡) app#0 | + byte "\x00\x06World4" // (𝕡) app#0 | "\x00\x06World4" "World4" typed_abi_call/typed_c2c.py:77 + itxn_field ApplicationArgs // (𝕡) app#0 | + itxn_submit // (𝕡) app#0 | arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:77 + itxn LastLog // (𝕡) app#0 | {itxn} arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:77 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) typed_abi_call/typed_c2c.py:77 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0 | txn%%LastLog#0 txn.last_log == b"World4" typed_abi_call/typed_c2c.py:78 + byte "World4" // (𝕡) app#0 | txn%%LastLog#0,"World4" b"World4" typed_abi_call/typed_c2c.py:78 + == // (𝕡) app#0 | {==} txn.last_log == b"World4" typed_abi_call/typed_c2c.py:78 + // virtual: store tmp%7#0 to l-stack (no copy) (𝕡) app#0 | tmp%7#0 txn.last_log == b"World4" typed_abi_call/typed_c2c.py:78 + // virtual: load tmp%7#0 from l-stack (no copy) (𝕡) app#0 | tmp%7#0 assert txn.last_log == b"World4" typed_abi_call/typed_c2c.py:78 + assert // (𝕡) app#0 | assert txn.last_log == b"World4" typed_abi_call/typed_c2c.py:78 + retsub // + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: +test_ref_types: + proto 2 0 // (𝕡) app#0,asset#0 | @arc4.abimethod()\ndef test_ref_types(self, app: Application, asset: Asset) -> None: typed_abi_call/typed_c2c.py:80-81 + +test_ref_types_block@0: + itxn_begin // (𝕡) app#0,asset#0 | arc4.abi_call(\nLogger.log_asset_account_app,\nasset,\nGlobal.current_application_address,\napp,\... typed_abi_call/typed_c2c.py:82-89 + global CurrentApplicationAddress // (𝕡) app#0,asset#0 | {global} Global.current_application_address typed_abi_call/typed_c2c.py:85 + // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) app#0,asset#0 | tmp%1#0 Global.current_application_address typed_abi_call/typed_c2c.py:85 + int appl // (𝕡) app#0,asset#0 | tmp%1#0,appl arc4.abi_call(\nLogger.log_asset_account_app,\nasset,\nGlobal.current_application_address,\napp,\... typed_abi_call/typed_c2c.py:82-89 + itxn_field TypeEnum // (𝕡) app#0,asset#0 | tmp%1#0 + int 0 // (𝕡) app#0,asset#0 | tmp%1#0,0 0 typed_abi_call/typed_c2c.py:88 + itxn_field Fee // (𝕡) app#0,asset#0 | tmp%1#0 + frame_dig -1 // load asset#0 from parameters (𝕡) app#0,asset#0 | tmp%1#0,asset#0 + itxn_field Assets // (𝕡) app#0,asset#0 | tmp%1#0 + frame_dig -2 // load app#0 from parameters (𝕡) app#0,asset#0 | tmp%1#0,app#0 + itxn_field Applications // (𝕡) app#0,asset#0 | tmp%1#0 + frame_dig -2 // load app#0 from parameters (𝕡) app#0,asset#0 | tmp%1#0,app#0 + itxn_field ApplicationID // (𝕡) app#0,asset#0 | tmp%1#0 + method "log_asset_account_app(asset,account,application)void" // (𝕡) app#0,asset#0 | tmp%1#0,method<"log_asset_account_app(asset,account,application)void"> arc4.abi_call(\nLogger.log_asset_account_app,\nasset,\nGlobal.current_application_address,\napp,\... typed_abi_call/typed_c2c.py:82-89 + itxn_field ApplicationArgs // (𝕡) app#0,asset#0 | tmp%1#0 + byte 0x00 // (𝕡) app#0,asset#0 | tmp%1#0,0x00 asset typed_abi_call/typed_c2c.py:84 + itxn_field ApplicationArgs // (𝕡) app#0,asset#0 | tmp%1#0 + byte 0x01 // (𝕡) app#0,asset#0 | tmp%1#0,0x01 Global.current_application_address typed_abi_call/typed_c2c.py:85 + itxn_field ApplicationArgs // (𝕡) app#0,asset#0 | tmp%1#0 + byte 0x01 // (𝕡) app#0,asset#0 | tmp%1#0,0x01 app typed_abi_call/typed_c2c.py:86 + itxn_field ApplicationArgs // (𝕡) app#0,asset#0 | tmp%1#0 + // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) app#0,asset#0 | tmp%1#0 + itxn_field Accounts // (𝕡) app#0,asset#0 | + itxn_submit // (𝕡) app#0,asset#0 | arc4.abi_call(\nLogger.log_asset_account_app,\nasset,\nGlobal.current_application_address,\napp,\... typed_abi_call/typed_c2c.py:82-89 + itxn LastLog // (𝕡) app#0,asset#0 | {itxn} arc4.abi_call(\nLogger.log_asset_account_app,\nasset,\nGlobal.current_application_address,\napp,\... typed_abi_call/typed_c2c.py:82-89 + // virtual: store txn%%LastLog#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0 arc4.abi_call(\nLogger.log_asset_account_app,\nasset,\nGlobal.current_application_address,\napp,\... typed_abi_call/typed_c2c.py:82-89 + frame_dig -1 // load asset#0 from parameters (𝕡) app#0,asset#0 | txn%%LastLog#0,asset#0 asset.name typed_abi_call/typed_c2c.py:92 + asset_params_get AssetName // (𝕡) app#0,asset#0 | txn%%LastLog#0,{asset_params_get}.0,{asset_params_get}.1 asset.name typed_abi_call/typed_c2c.py:92 + // virtual: store check%3#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,check%3#0,{asset_params_get}.0 asset.name typed_abi_call/typed_c2c.py:92 + // virtual: store value%2#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,value%2#0,check%3#0 asset.name typed_abi_call/typed_c2c.py:92 + // virtual: load check%3#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,value%2#0,check%3#0 asset.name typed_abi_call/typed_c2c.py:92 + assert // asset exists // (𝕡) app#0,asset#0 | txn%%LastLog#0,value%2#0 asset.name typed_abi_call/typed_c2c.py:92 + global CurrentApplicationAddress // (𝕡) app#0,asset#0 | txn%%LastLog#0,value%2#0,{global} Global.current_application_address typed_abi_call/typed_c2c.py:92 + // virtual: store tmp%4#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,value%2#0,tmp%4#0 Global.current_application_address typed_abi_call/typed_c2c.py:92 + // virtual: load value%2#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%4#0,value%2#0 asset.name + Global.current_application_address.bytes typed_abi_call/typed_c2c.py:92 + // virtual: load tmp%4#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,value%2#0,tmp%4#0 asset.name + Global.current_application_address.bytes typed_abi_call/typed_c2c.py:92 + concat // (𝕡) app#0,asset#0 | txn%%LastLog#0,{concat} asset.name + Global.current_application_address.bytes typed_abi_call/typed_c2c.py:92 + // virtual: store tmp%5#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0 asset.name + Global.current_application_address.bytes typed_abi_call/typed_c2c.py:92 + frame_dig -2 // load app#0 from parameters (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,app#0 app.address typed_abi_call/typed_c2c.py:92 + app_params_get AppAddress // (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,{app_params_get}.0,{app_params_get}.1 app.address typed_abi_call/typed_c2c.py:92 + // virtual: store check%7#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,check%7#0,{app_params_get}.0 app.address typed_abi_call/typed_c2c.py:92 + // virtual: store value%6#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,value%6#0,check%7#0 app.address typed_abi_call/typed_c2c.py:92 + // virtual: load check%7#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,value%6#0,check%7#0 app.address typed_abi_call/typed_c2c.py:92 + assert // application exists // (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,value%6#0 app.address typed_abi_call/typed_c2c.py:92 + // virtual: load tmp%5#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,value%6#0,tmp%5#0 asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:92 + // virtual: load value%6#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%5#0,value%6#0 asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:92 + concat // (𝕡) app#0,asset#0 | txn%%LastLog#0,{concat} asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:92 + // virtual: store tmp%8#0 to l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%8#0 asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:92 + // virtual: load txn%%LastLog#0 from l-stack (no copy) (𝕡) app#0,asset#0 | tmp%8#0,txn%%LastLog#0 txn.last_log\n== asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:91-92 + // virtual: load tmp%8#0 from l-stack (no copy) (𝕡) app#0,asset#0 | txn%%LastLog#0,tmp%8#0 txn.last_log\n== asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:91-92 + == // (𝕡) app#0,asset#0 | {==} txn.last_log\n== asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:91-92 + // virtual: store tmp%9#0 to l-stack (no copy) (𝕡) app#0,asset#0 | tmp%9#0 txn.last_log\n== asset.name + Global.current_application_address.bytes + app.address.bytes typed_abi_call/typed_c2c.py:91-92 + // virtual: load tmp%9#0 from l-stack (no copy) (𝕡) app#0,asset#0 | tmp%9#0 assert (\ntxn.last_log\n== asset.name + Global.current_application_address.bytes + app.address.by... typed_abi_call/typed_c2c.py:90-93 + assert // (𝕡) app#0,asset#0 | assert (\ntxn.last_log\n== asset.name + Global.current_application_address.bytes + app.address.by... typed_abi_call/typed_c2c.py:90-93 + retsub // + diff --git a/test_cases/typed_abi_call/out/Greeter.approval.teal b/test_cases/typed_abi_call/out/Greeter.approval.teal new file mode 100644 index 0000000000..292f3d64d5 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.approval.teal @@ -0,0 +1,745 @@ +#pragma version 10 + +test_cases.typed_abi_call.typed_c2c.Greeter.approval_program: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txn NumAppArgs + bz main_bare_routing@9 + method "test_method_selector_kinds(application)void" + method "test_arg_conversion(application)void" + method "test_15plus_args(application)void" + method "test_void(application)void" + method "test_ref_types(application,asset)void" + txna ApplicationArgs 0 + match main_test_method_selector_kinds_route@2 main_test_arg_conversion_route@3 main_test_15plus_args_route@4 main_test_void_route@5 main_test_ref_types_route@6 + err // reject transaction + +main_test_method_selector_kinds_route@2: + // typed_abi_call/typed_c2c.py:7 + // @arc4.abimethod() + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:7 + // @arc4.abimethod() + callsub test_method_selector_kinds + int 1 + return + +main_test_arg_conversion_route@3: + // typed_abi_call/typed_c2c.py:20 + // @arc4.abimethod() + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:20 + // @arc4.abimethod() + callsub test_arg_conversion + int 1 + return + +main_test_15plus_args_route@4: + // typed_abi_call/typed_c2c.py:37 + // @arc4.abimethod() + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:37 + // @arc4.abimethod() + callsub test_15plus_args + int 1 + return + +main_test_void_route@5: + // typed_abi_call/typed_c2c.py:66 + // @arc4.abimethod() + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:66 + // @arc4.abimethod() + callsub test_void + int 1 + return + +main_test_ref_types_route@6: + // typed_abi_call/typed_c2c.py:80 + // @arc4.abimethod() + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + txna ApplicationArgs 2 + btoi + txnas Assets + // typed_abi_call/typed_c2c.py:80 + // @arc4.abimethod() + callsub test_ref_types + int 1 + return + +main_bare_routing@9: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txn OnCompletion + ! + assert // reject transaction + txn ApplicationID + ! + assert // is creating + int 1 + return + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: +test_method_selector_kinds: + // typed_abi_call/typed_c2c.py:7-8 + // @arc4.abimethod() + // def test_method_selector_kinds(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:9 + // result, _txn = arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test1" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:10 + // assert result == "echo: test1" + byte "\x00\x0becho: test1" + == + assert + // typed_abi_call/typed_c2c.py:11 + // result, _txn = arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test2" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:12 + // assert result == "echo: test2" + byte "\x00\x0becho: test2" + == + assert + // typed_abi_call/typed_c2c.py:13 + // result, _txn = arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test3" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:14 + // assert result == "echo: test3" + byte "\x00\x0becho: test3" + == + assert + // typed_abi_call/typed_c2c.py:15 + // result, _txn = arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test4" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:16 + // assert result == "echo: test4" + byte "\x00\x0becho: test4" + == + assert + // typed_abi_call/typed_c2c.py:17 + // result, _txn = arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test5" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:18 + // assert result == "echo: test5" + byte "\x00\x0becho: test5" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: +test_arg_conversion: + // typed_abi_call/typed_c2c.py:20-21 + // @arc4.abimethod() + // def test_arg_conversion(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:22 + // txn = arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\nconverted1" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:23 + // assert txn.last_log == b"converted1" + byte "converted1" + == + assert + // typed_abi_call/typed_c2c.py:25 + // txn = arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_uint64(uint64)void" + itxn_field ApplicationArgs + byte 0x0000000000000002 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:26 + // assert txn.last_log == op.itob(2) + int 2 + itob + == + assert + // typed_abi_call/typed_c2c.py:28 + // txn = arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_uint512(uint512)void" + itxn_field ApplicationArgs + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:29 + // assert txn.last_log == (op.bzero(56) + op.itob(3)) + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + == + assert + // typed_abi_call/typed_c2c.py:31 + // txn = arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_bytes(byte[])void" + itxn_field ApplicationArgs + byte 0x000134 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:32 + // assert txn.last_log == b"4" + byte "4" + == + assert + // typed_abi_call/typed_c2c.py:34 + // txn = arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_bool(bool)void" + itxn_field ApplicationArgs + byte 0x80 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:35 + // assert txn.last_log == b"True" + byte "True" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: +test_15plus_args: + // typed_abi_call/typed_c2c.py:37-38 + // @arc4.abimethod() + // def test_15plus_args(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:39-63 + // result, txn = arc4.abi_call( + // Logger.return_args_after_14th, + // 1, + // 2, + // 3, + // 4, + // 5, + // 6, + // 7, + // 8, + // 9, + // 10, + // 11, + // 12, + // 13, + // 14, + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + // app_id=app, + // fee=0, + // ) + itxn_begin + int appl + itxn_field TypeEnum + // typed_abi_call/typed_c2c.py:62 + // fee=0, + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + // typed_abi_call/typed_c2c.py:39-63 + // result, txn = arc4.abi_call( + // Logger.return_args_after_14th, + // 1, + // 2, + // 3, + // 4, + // 5, + // 6, + // 7, + // 8, + // 9, + // 10, + // 11, + // 12, + // 13, + // 14, + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + // app_id=app, + // fee=0, + // ) + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:41 + // 1, + byte 0x0000000000000001 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:42 + // 2, + byte 0x0000000000000002 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:43 + // 3, + byte 0x0000000000000003 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:44 + // 4, + byte 0x0000000000000004 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:45 + // 5, + byte 0x0000000000000005 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:46 + // 6, + byte 0x0000000000000006 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:47 + // 7, + byte 0x0000000000000007 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:48 + // 8, + byte 0x0000000000000008 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:49 + // 9, + byte 0x0000000000000009 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:50 + // 10, + byte 0x000000000000000a + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:51 + // 11, + byte 0x000000000000000b + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:52 + // 12, + byte 0x000000000000000c + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:53 + // 13, + byte 0x000000000000000d + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:54 + // 14, + byte 0x000000000000000e + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + byte 0x0f101112deadbeef14 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:39-63 + // result, txn = arc4.abi_call( + // Logger.return_args_after_14th, + // 1, + // 2, + // 3, + // 4, + // 5, + // 6, + // 7, + // 8, + // 9, + // 10, + // 11, + // 12, + // 13, + // 14, + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + // app_id=app, + // fee=0, + // ) + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:64 + // assert result.decode() == Bytes.from_hex("0F101112DEADBEEF14") + extract 2 0 + byte 0x0f101112deadbeef14 + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: +test_void: + // typed_abi_call/typed_c2c.py:66-67 + // @arc4.abimethod() + // def test_void(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:68 + // txn = arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World1" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:69 + // assert txn.last_log == b"World1" + byte "World1" + == + assert + // typed_abi_call/typed_c2c.py:71 + // txn = arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World2" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:72 + // assert txn.last_log == b"World2" + byte "World2" + == + assert + // typed_abi_call/typed_c2c.py:74 + // txn = arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World3" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:75 + // assert txn.last_log == b"World3" + byte "World3" + == + assert + // typed_abi_call/typed_c2c.py:77 + // txn = arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World4" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:78 + // assert txn.last_log == b"World4" + byte "World4" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: +test_ref_types: + // typed_abi_call/typed_c2c.py:80-81 + // @arc4.abimethod() + // def test_ref_types(self, app: Application, asset: Asset) -> None: + proto 2 0 + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + itxn_begin + // typed_abi_call/typed_c2c.py:85 + // Global.current_application_address, + global CurrentApplicationAddress + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + int appl + itxn_field TypeEnum + // typed_abi_call/typed_c2c.py:88 + // fee=0, + int 0 + itxn_field Fee + frame_dig -1 + itxn_field Assets + frame_dig -2 + itxn_field Applications + frame_dig -2 + itxn_field ApplicationID + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + method "log_asset_account_app(asset,account,application)void" + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:84 + // asset, + byte 0x00 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:85 + // Global.current_application_address, + byte 0x01 + itxn_field ApplicationArgs + // typed_abi_call/typed_c2c.py:86 + // app, + byte 0x01 + itxn_field ApplicationArgs + itxn_field Accounts + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:92 + // == asset.name + Global.current_application_address.bytes + app.address.bytes + frame_dig -1 + asset_params_get AssetName + assert // asset exists + global CurrentApplicationAddress + concat + frame_dig -2 + app_params_get AppAddress + assert // application exists + concat + // typed_abi_call/typed_c2c.py:91-92 + // txn.last_log + // == asset.name + Global.current_application_address.bytes + app.address.bytes + == + // typed_abi_call/typed_c2c.py:90-93 + // assert ( + // txn.last_log + // == asset.name + Global.current_application_address.bytes + app.address.bytes + // ) + assert + retsub diff --git a/test_cases/typed_abi_call/out/Greeter.arc32.json b/test_cases/typed_abi_call/out/Greeter.arc32.json new file mode 100644 index 0000000000..4f39223e51 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.arc32.json @@ -0,0 +1,126 @@ +{ + "hints": { + "test_method_selector_kinds(application)void": { + "call_config": { + "no_op": "CALL" + } + }, + "test_arg_conversion(application)void": { + "call_config": { + "no_op": "CALL" + } + }, + "test_15plus_args(application)void": { + "call_config": { + "no_op": "CALL" + } + }, + "test_void(application)void": { + "call_config": { + "no_op": "CALL" + } + }, + "test_ref_types(application,asset)void": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLnR5cGVkX2MyYy5HcmVldGVyLmFwcHJvdmFsX3Byb2dyYW06CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NgogICAgLy8gY2xhc3MgR3JlZXRlcihBUkM0Q29udHJhY3QpOgogICAgdHhuIE51bUFwcEFyZ3MKICAgIGJ6IG1haW5fYmFyZV9yb3V0aW5nQDkKICAgIG1ldGhvZCAidGVzdF9tZXRob2Rfc2VsZWN0b3Jfa2luZHMoYXBwbGljYXRpb24pdm9pZCIKICAgIG1ldGhvZCAidGVzdF9hcmdfY29udmVyc2lvbihhcHBsaWNhdGlvbil2b2lkIgogICAgbWV0aG9kICJ0ZXN0XzE1cGx1c19hcmdzKGFwcGxpY2F0aW9uKXZvaWQiCiAgICBtZXRob2QgInRlc3Rfdm9pZChhcHBsaWNhdGlvbil2b2lkIgogICAgbWV0aG9kICJ0ZXN0X3JlZl90eXBlcyhhcHBsaWNhdGlvbixhc3NldCl2b2lkIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggbWFpbl90ZXN0X21ldGhvZF9zZWxlY3Rvcl9raW5kc19yb3V0ZUAyIG1haW5fdGVzdF9hcmdfY29udmVyc2lvbl9yb3V0ZUAzIG1haW5fdGVzdF8xNXBsdXNfYXJnc19yb3V0ZUA0IG1haW5fdGVzdF92b2lkX3JvdXRlQDUgbWFpbl90ZXN0X3JlZl90eXBlc19yb3V0ZUA2CiAgICBlcnIgLy8gcmVqZWN0IHRyYW5zYWN0aW9uCgptYWluX3Rlc3RfbWV0aG9kX3NlbGVjdG9yX2tpbmRzX3JvdXRlQDI6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NwogICAgLy8gQGFyYzQuYWJpbWV0aG9kKCkKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo2CiAgICAvLyBjbGFzcyBHcmVldGVyKEFSQzRDb250cmFjdCk6CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICBidG9pCiAgICB0eG5hcyBBcHBsaWNhdGlvbnMKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo3CiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgY2FsbHN1YiB0ZXN0X21ldGhvZF9zZWxlY3Rvcl9raW5kcwogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl90ZXN0X2FyZ19jb252ZXJzaW9uX3JvdXRlQDM6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MjAKICAgIC8vIEBhcmM0LmFiaW1ldGhvZCgpCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NgogICAgLy8gY2xhc3MgR3JlZXRlcihBUkM0Q29udHJhY3QpOgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgYnRvaQogICAgdHhuYXMgQXBwbGljYXRpb25zCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MjAKICAgIC8vIEBhcmM0LmFiaW1ldGhvZCgpCiAgICBjYWxsc3ViIHRlc3RfYXJnX2NvbnZlcnNpb24KICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fdGVzdF8xNXBsdXNfYXJnc19yb3V0ZUA0OgogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjM3CiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjYKICAgIC8vIGNsYXNzIEdyZWV0ZXIoQVJDNENvbnRyYWN0KToKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIGJ0b2kKICAgIHR4bmFzIEFwcGxpY2F0aW9ucwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjM3CiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgY2FsbHN1YiB0ZXN0XzE1cGx1c19hcmdzCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX3Rlc3Rfdm9pZF9yb3V0ZUA1OgogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjY2CiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjYKICAgIC8vIGNsYXNzIEdyZWV0ZXIoQVJDNENvbnRyYWN0KToKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIGJ0b2kKICAgIHR4bmFzIEFwcGxpY2F0aW9ucwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjY2CiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgY2FsbHN1YiB0ZXN0X3ZvaWQKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fdGVzdF9yZWZfdHlwZXNfcm91dGVANjoKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo4MAogICAgLy8gQGFyYzQuYWJpbWV0aG9kKCkKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo2CiAgICAvLyBjbGFzcyBHcmVldGVyKEFSQzRDb250cmFjdCk6CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICBidG9pCiAgICB0eG5hcyBBcHBsaWNhdGlvbnMKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDIKICAgIGJ0b2kKICAgIHR4bmFzIEFzc2V0cwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjgwCiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgY2FsbHN1YiB0ZXN0X3JlZl90eXBlcwogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9iYXJlX3JvdXRpbmdAOToKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo2CiAgICAvLyBjbGFzcyBHcmVldGVyKEFSQzRDb250cmFjdCk6CiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gcmVqZWN0IHRyYW5zYWN0aW9uCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgIQogICAgYXNzZXJ0IC8vIGlzIGNyZWF0aW5nCiAgICBpbnQgMQogICAgcmV0dXJuCgoKLy8gdGVzdF9jYXNlcy50eXBlZF9hYmlfY2FsbC50eXBlZF9jMmMuR3JlZXRlci50ZXN0X21ldGhvZF9zZWxlY3Rvcl9raW5kcyhhcHA6IHVpbnQ2NCkgLT4gdm9pZDoKdGVzdF9tZXRob2Rfc2VsZWN0b3Jfa2luZHM6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6Ny04CiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgLy8gZGVmIHRlc3RfbWV0aG9kX3NlbGVjdG9yX2tpbmRzKHNlbGYsIGFwcDogQXBwbGljYXRpb24pIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo5CiAgICAvLyByZXN1bHQsIF90eG4gPSBhcmM0LmFiaV9jYWxsKExvZ2dlci5lY2hvLCBhcmM0LlN0cmluZygidGVzdDEiKSwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJlY2hvKHN0cmluZylzdHJpbmciCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAiXHgwMFx4MDV0ZXN0MSIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBpdHhuX3N1Ym1pdAogICAgaXR4biBMYXN0TG9nCiAgICBkdXAKICAgIGV4dHJhY3QgNCAwCiAgICBzd2FwCiAgICBleHRyYWN0IDAgNAogICAgYnl0ZSAweDE1MWY3Yzc1CiAgICA9PQogICAgYXNzZXJ0IC8vIEFSQzQgcHJlZml4IGlzIHZhbGlkCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MTAKICAgIC8vIGFzc2VydCByZXN1bHQgPT0gImVjaG86IHRlc3QxIgogICAgYnl0ZSAiXHgwMFx4MGJlY2hvOiB0ZXN0MSIKICAgID09CiAgICBhc3NlcnQKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weToxMQogICAgLy8gcmVzdWx0LCBfdHhuID0gYXJjNC5hYmlfY2FsbChMb2dnZXJDbGllbnQuZWNobywgInRlc3QyIiwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJlY2hvKHN0cmluZylzdHJpbmciCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAiXHgwMFx4MDV0ZXN0MiIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBpdHhuX3N1Ym1pdAogICAgaXR4biBMYXN0TG9nCiAgICBkdXAKICAgIGV4dHJhY3QgNCAwCiAgICBzd2FwCiAgICBleHRyYWN0IDAgNAogICAgYnl0ZSAweDE1MWY3Yzc1CiAgICA9PQogICAgYXNzZXJ0IC8vIEFSQzQgcHJlZml4IGlzIHZhbGlkCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MTIKICAgIC8vIGFzc2VydCByZXN1bHQgPT0gImVjaG86IHRlc3QyIgogICAgYnl0ZSAiXHgwMFx4MGJlY2hvOiB0ZXN0MiIKICAgID09CiAgICBhc3NlcnQKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weToxMwogICAgLy8gcmVzdWx0LCBfdHhuID0gYXJjNC5hYmlfY2FsbFthcmM0LlN0cmluZ10oImVjaG8iLCAidGVzdDMiLCBhcHBfaWQ9YXBwLCBmZWU9MCkKICAgIGl0eG5fYmVnaW4KICAgIGludCBhcHBsCiAgICBpdHhuX2ZpZWxkIFR5cGVFbnVtCiAgICBpbnQgMAogICAgaXR4bl9maWVsZCBGZWUKICAgIGZyYW1lX2RpZyAtMQogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbklECiAgICBtZXRob2QgImVjaG8oc3RyaW5nKXN0cmluZyIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBieXRlICJceDAwXHgwNXRlc3QzIgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGl0eG5fc3VibWl0CiAgICBpdHhuIExhc3RMb2cKICAgIGR1cAogICAgZXh0cmFjdCA0IDAKICAgIHN3YXAKICAgIGV4dHJhY3QgMCA0CiAgICBieXRlIDB4MTUxZjdjNzUKICAgID09CiAgICBhc3NlcnQgLy8gQVJDNCBwcmVmaXggaXMgdmFsaWQKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weToxNAogICAgLy8gYXNzZXJ0IHJlc3VsdCA9PSAiZWNobzogdGVzdDMiCiAgICBieXRlICJceDAwXHgwYmVjaG86IHRlc3QzIgogICAgPT0KICAgIGFzc2VydAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjE1CiAgICAvLyByZXN1bHQsIF90eG4gPSBhcmM0LmFiaV9jYWxsW2FyYzQuU3RyaW5nXSgiZWNobyhzdHJpbmcpIiwgInRlc3Q0IiwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJlY2hvKHN0cmluZylzdHJpbmciCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAiXHgwMFx4MDV0ZXN0NCIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBpdHhuX3N1Ym1pdAogICAgaXR4biBMYXN0TG9nCiAgICBkdXAKICAgIGV4dHJhY3QgNCAwCiAgICBzd2FwCiAgICBleHRyYWN0IDAgNAogICAgYnl0ZSAweDE1MWY3Yzc1CiAgICA9PQogICAgYXNzZXJ0IC8vIEFSQzQgcHJlZml4IGlzIHZhbGlkCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MTYKICAgIC8vIGFzc2VydCByZXN1bHQgPT0gImVjaG86IHRlc3Q0IgogICAgYnl0ZSAiXHgwMFx4MGJlY2hvOiB0ZXN0NCIKICAgID09CiAgICBhc3NlcnQKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weToxNwogICAgLy8gcmVzdWx0LCBfdHhuID0gYXJjNC5hYmlfY2FsbFthcmM0LlN0cmluZ10oImVjaG8oc3RyaW5nKXN0cmluZyIsICJ0ZXN0NSIsIGFwcF9pZD1hcHAsIGZlZT0wKQogICAgaXR4bl9iZWdpbgogICAgaW50IGFwcGwKICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgIGludCAwCiAgICBpdHhuX2ZpZWxkIEZlZQogICAgZnJhbWVfZGlnIC0xCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uSUQKICAgIG1ldGhvZCAiZWNobyhzdHJpbmcpc3RyaW5nIgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGJ5dGUgIlx4MDBceDA1dGVzdDUiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgaXR4bl9zdWJtaXQKICAgIGl0eG4gTGFzdExvZwogICAgZHVwCiAgICBleHRyYWN0IDQgMAogICAgc3dhcAogICAgZXh0cmFjdCAwIDQKICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgPT0KICAgIGFzc2VydCAvLyBBUkM0IHByZWZpeCBpcyB2YWxpZAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjE4CiAgICAvLyBhc3NlcnQgcmVzdWx0ID09ICJlY2hvOiB0ZXN0NSIKICAgIGJ5dGUgIlx4MDBceDBiZWNobzogdGVzdDUiCiAgICA9PQogICAgYXNzZXJ0CiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLnR5cGVkX2MyYy5HcmVldGVyLnRlc3RfYXJnX2NvbnZlcnNpb24oYXBwOiB1aW50NjQpIC0+IHZvaWQ6CnRlc3RfYXJnX2NvbnZlcnNpb246CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MjAtMjEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZCgpCiAgICAvLyBkZWYgdGVzdF9hcmdfY29udmVyc2lvbihzZWxmLCBhcHA6IEFwcGxpY2F0aW9uKSAtPiBOb25lOgogICAgcHJvdG8gMSAwCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MjIKICAgIC8vIHR4biA9IGFyYzQuYWJpX2NhbGwoTG9nZ2VyLmxvZ19zdHJpbmcsICJjb252ZXJ0ZWQxIiwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJsb2dfc3RyaW5nKHN0cmluZyl2b2lkIgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGJ5dGUgIlx4MDBcbmNvbnZlcnRlZDEiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgaXR4bl9zdWJtaXQKICAgIGl0eG4gTGFzdExvZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjIzCiAgICAvLyBhc3NlcnQgdHhuLmxhc3RfbG9nID09IGIiY29udmVydGVkMSIKICAgIGJ5dGUgImNvbnZlcnRlZDEiCiAgICA9PQogICAgYXNzZXJ0CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MjUKICAgIC8vIHR4biA9IGFyYzQuYWJpX2NhbGwoTG9nZ2VyLmxvZ191aW50NjQsIDIsIGFwcF9pZD1hcHAsIGZlZT0wKQogICAgaXR4bl9iZWdpbgogICAgaW50IGFwcGwKICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgIGludCAwCiAgICBpdHhuX2ZpZWxkIEZlZQogICAgZnJhbWVfZGlnIC0xCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uSUQKICAgIG1ldGhvZCAibG9nX3VpbnQ2NCh1aW50NjQpdm9pZCIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBieXRlIDB4MDAwMDAwMDAwMDAwMDAwMgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGl0eG5fc3VibWl0CiAgICBpdHhuIExhc3RMb2cKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weToyNgogICAgLy8gYXNzZXJ0IHR4bi5sYXN0X2xvZyA9PSBvcC5pdG9iKDIpCiAgICBpbnQgMgogICAgaXRvYgogICAgPT0KICAgIGFzc2VydAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjI4CiAgICAvLyB0eG4gPSBhcmM0LmFiaV9jYWxsKExvZ2dlci5sb2dfdWludDUxMiwgMywgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJsb2dfdWludDUxMih1aW50NTEyKXZvaWQiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAzCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgaXR4bl9zdWJtaXQKICAgIGl0eG4gTGFzdExvZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjI5CiAgICAvLyBhc3NlcnQgdHhuLmxhc3RfbG9nID09IChvcC5iemVybyg1NikgKyBvcC5pdG9iKDMpKQogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAzCiAgICA9PQogICAgYXNzZXJ0CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MzEKICAgIC8vIHR4biA9IGFyYzQuYWJpX2NhbGwoTG9nZ2VyLmxvZ19ieXRlcywgYiI0IiwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJsb2dfYnl0ZXMoYnl0ZVtdKXZvaWQiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAweDAwMDEzNAogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGl0eG5fc3VibWl0CiAgICBpdHhuIExhc3RMb2cKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTozMgogICAgLy8gYXNzZXJ0IHR4bi5sYXN0X2xvZyA9PSBiIjQiCiAgICBieXRlICI0IgogICAgPT0KICAgIGFzc2VydAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjM0CiAgICAvLyB0eG4gPSBhcmM0LmFiaV9jYWxsKExvZ2dlci5sb2dfYm9vbCwgVHJ1ZSwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJsb2dfYm9vbChib29sKXZvaWQiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAweDgwCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgaXR4bl9zdWJtaXQKICAgIGl0eG4gTGFzdExvZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjM1CiAgICAvLyBhc3NlcnQgdHhuLmxhc3RfbG9nID09IGIiVHJ1ZSIKICAgIGJ5dGUgIlRydWUiCiAgICA9PQogICAgYXNzZXJ0CiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLnR5cGVkX2MyYy5HcmVldGVyLnRlc3RfMTVwbHVzX2FyZ3MoYXBwOiB1aW50NjQpIC0+IHZvaWQ6CnRlc3RfMTVwbHVzX2FyZ3M6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MzctMzgKICAgIC8vIEBhcmM0LmFiaW1ldGhvZCgpCiAgICAvLyBkZWYgdGVzdF8xNXBsdXNfYXJncyhzZWxmLCBhcHA6IEFwcGxpY2F0aW9uKSAtPiBOb25lOgogICAgcHJvdG8gMSAwCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6MzktNjMKICAgIC8vIHJlc3VsdCwgdHhuID0gYXJjNC5hYmlfY2FsbCgKICAgIC8vICAgICBMb2dnZXIucmV0dXJuX2FyZ3NfYWZ0ZXJfMTR0aCwKICAgIC8vICAgICAxLAogICAgLy8gICAgIDIsCiAgICAvLyAgICAgMywKICAgIC8vICAgICA0LAogICAgLy8gICAgIDUsCiAgICAvLyAgICAgNiwKICAgIC8vICAgICA3LAogICAgLy8gICAgIDgsCiAgICAvLyAgICAgOSwKICAgIC8vICAgICAxMCwKICAgIC8vICAgICAxMSwKICAgIC8vICAgICAxMiwKICAgIC8vICAgICAxMywKICAgIC8vICAgICAxNCwKICAgIC8vICAgICAxNSwKICAgIC8vICAgICAxNiwKICAgIC8vICAgICAxNywKICAgIC8vICAgICAxOCwKICAgIC8vICAgICBhcmM0LlR1cGxlKChhcmM0LlVJbnQ4KDB4REUpLCBhcmM0LlVJbnQ4KDB4QUQpLCBhcmM0LlVJbnQ4KDB4QkUpLCBhcmM0LlVJbnQ4KDB4RUYpKSksCiAgICAvLyAgICAgMjAsCiAgICAvLyAgICAgYXBwX2lkPWFwcCwKICAgIC8vICAgICBmZWU9MCwKICAgIC8vICkKICAgIGl0eG5fYmVnaW4KICAgIGludCBhcHBsCiAgICBpdHhuX2ZpZWxkIFR5cGVFbnVtCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NjIKICAgIC8vIGZlZT0wLAogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjM5LTYzCiAgICAvLyByZXN1bHQsIHR4biA9IGFyYzQuYWJpX2NhbGwoCiAgICAvLyAgICAgTG9nZ2VyLnJldHVybl9hcmdzX2FmdGVyXzE0dGgsCiAgICAvLyAgICAgMSwKICAgIC8vICAgICAyLAogICAgLy8gICAgIDMsCiAgICAvLyAgICAgNCwKICAgIC8vICAgICA1LAogICAgLy8gICAgIDYsCiAgICAvLyAgICAgNywKICAgIC8vICAgICA4LAogICAgLy8gICAgIDksCiAgICAvLyAgICAgMTAsCiAgICAvLyAgICAgMTEsCiAgICAvLyAgICAgMTIsCiAgICAvLyAgICAgMTMsCiAgICAvLyAgICAgMTQsCiAgICAvLyAgICAgMTUsCiAgICAvLyAgICAgMTYsCiAgICAvLyAgICAgMTcsCiAgICAvLyAgICAgMTgsCiAgICAvLyAgICAgYXJjNC5UdXBsZSgoYXJjNC5VSW50OCgweERFKSwgYXJjNC5VSW50OCgweEFEKSwgYXJjNC5VSW50OCgweEJFKSwgYXJjNC5VSW50OCgweEVGKSkpLAogICAgLy8gICAgIDIwLAogICAgLy8gICAgIGFwcF9pZD1hcHAsCiAgICAvLyAgICAgZmVlPTAsCiAgICAvLyApCiAgICBtZXRob2QgInJldHVybl9hcmdzX2FmdGVyXzE0dGgodWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50OCx1aW50OCx1aW50OCx1aW50OCwodWludDgsdWludDgsdWludDgsdWludDgpLHVpbnQ4KWJ5dGVbXSIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NDEKICAgIC8vIDEsCiAgICBieXRlIDB4MDAwMDAwMDAwMDAwMDAwMQogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo0MgogICAgLy8gMiwKICAgIGJ5dGUgMHgwMDAwMDAwMDAwMDAwMDAyCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjQzCiAgICAvLyAzLAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMDMKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NDQKICAgIC8vIDQsCiAgICBieXRlIDB4MDAwMDAwMDAwMDAwMDAwNAogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo0NQogICAgLy8gNSwKICAgIGJ5dGUgMHgwMDAwMDAwMDAwMDAwMDA1CiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjQ2CiAgICAvLyA2LAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMDYKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NDcKICAgIC8vIDcsCiAgICBieXRlIDB4MDAwMDAwMDAwMDAwMDAwNwogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo0OAogICAgLy8gOCwKICAgIGJ5dGUgMHgwMDAwMDAwMDAwMDAwMDA4CiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjQ5CiAgICAvLyA5LAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMDkKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NTAKICAgIC8vIDEwLAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMGEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NTEKICAgIC8vIDExLAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMGIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NTIKICAgIC8vIDEyLAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMGMKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NTMKICAgIC8vIDEzLAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMGQKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NTQKICAgIC8vIDE0LAogICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMGUKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NTUtNjAKICAgIC8vIDE1LAogICAgLy8gMTYsCiAgICAvLyAxNywKICAgIC8vIDE4LAogICAgLy8gYXJjNC5UdXBsZSgoYXJjNC5VSW50OCgweERFKSwgYXJjNC5VSW50OCgweEFEKSwgYXJjNC5VSW50OCgweEJFKSwgYXJjNC5VSW50OCgweEVGKSkpLAogICAgLy8gMjAsCiAgICBieXRlIDB4MGYxMDExMTJkZWFkYmVlZjE0CiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjM5LTYzCiAgICAvLyByZXN1bHQsIHR4biA9IGFyYzQuYWJpX2NhbGwoCiAgICAvLyAgICAgTG9nZ2VyLnJldHVybl9hcmdzX2FmdGVyXzE0dGgsCiAgICAvLyAgICAgMSwKICAgIC8vICAgICAyLAogICAgLy8gICAgIDMsCiAgICAvLyAgICAgNCwKICAgIC8vICAgICA1LAogICAgLy8gICAgIDYsCiAgICAvLyAgICAgNywKICAgIC8vICAgICA4LAogICAgLy8gICAgIDksCiAgICAvLyAgICAgMTAsCiAgICAvLyAgICAgMTEsCiAgICAvLyAgICAgMTIsCiAgICAvLyAgICAgMTMsCiAgICAvLyAgICAgMTQsCiAgICAvLyAgICAgMTUsCiAgICAvLyAgICAgMTYsCiAgICAvLyAgICAgMTcsCiAgICAvLyAgICAgMTgsCiAgICAvLyAgICAgYXJjNC5UdXBsZSgoYXJjNC5VSW50OCgweERFKSwgYXJjNC5VSW50OCgweEFEKSwgYXJjNC5VSW50OCgweEJFKSwgYXJjNC5VSW50OCgweEVGKSkpLAogICAgLy8gICAgIDIwLAogICAgLy8gICAgIGFwcF9pZD1hcHAsCiAgICAvLyAgICAgZmVlPTAsCiAgICAvLyApCiAgICBpdHhuX3N1Ym1pdAogICAgaXR4biBMYXN0TG9nCiAgICBkdXAKICAgIGV4dHJhY3QgNCAwCiAgICBzd2FwCiAgICBleHRyYWN0IDAgNAogICAgYnl0ZSAweDE1MWY3Yzc1CiAgICA9PQogICAgYXNzZXJ0IC8vIEFSQzQgcHJlZml4IGlzIHZhbGlkCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NjQKICAgIC8vIGFzc2VydCByZXN1bHQuZGVjb2RlKCkgPT0gQnl0ZXMuZnJvbV9oZXgoIjBGMTAxMTEyREVBREJFRUYxNCIpCiAgICBleHRyYWN0IDIgMAogICAgYnl0ZSAweDBmMTAxMTEyZGVhZGJlZWYxNAogICAgPT0KICAgIGFzc2VydAogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50eXBlZF9hYmlfY2FsbC50eXBlZF9jMmMuR3JlZXRlci50ZXN0X3ZvaWQoYXBwOiB1aW50NjQpIC0+IHZvaWQ6CnRlc3Rfdm9pZDoKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo2Ni02NwogICAgLy8gQGFyYzQuYWJpbWV0aG9kKCkKICAgIC8vIGRlZiB0ZXN0X3ZvaWQoc2VsZiwgYXBwOiBBcHBsaWNhdGlvbikgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjY4CiAgICAvLyB0eG4gPSBhcmM0LmFiaV9jYWxsKCJsb2dfc3RyaW5nKHN0cmluZyl2b2lkIiwgIldvcmxkMSIsIGFwcF9pZD1hcHAsIGZlZT0wKQogICAgaXR4bl9iZWdpbgogICAgaW50IGFwcGwKICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgIGludCAwCiAgICBpdHhuX2ZpZWxkIEZlZQogICAgZnJhbWVfZGlnIC0xCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uSUQKICAgIG1ldGhvZCAibG9nX3N0cmluZyhzdHJpbmcpdm9pZCIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBieXRlICJceDAwXHgwNldvcmxkMSIKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICBpdHhuX3N1Ym1pdAogICAgaXR4biBMYXN0TG9nCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NjkKICAgIC8vIGFzc2VydCB0eG4ubGFzdF9sb2cgPT0gYiJXb3JsZDEiCiAgICBieXRlICJXb3JsZDEiCiAgICA9PQogICAgYXNzZXJ0CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NzEKICAgIC8vIHR4biA9IGFyYzQuYWJpX2NhbGwoImxvZ19zdHJpbmcoc3RyaW5nKSIsICJXb3JsZDIiLCBhcHBfaWQ9YXBwLCBmZWU9MCkKICAgIGl0eG5fYmVnaW4KICAgIGludCBhcHBsCiAgICBpdHhuX2ZpZWxkIFR5cGVFbnVtCiAgICBpbnQgMAogICAgaXR4bl9maWVsZCBGZWUKICAgIGZyYW1lX2RpZyAtMQogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbklECiAgICBtZXRob2QgImxvZ19zdHJpbmcoc3RyaW5nKXZvaWQiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAiXHgwMFx4MDZXb3JsZDIiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgaXR4bl9zdWJtaXQKICAgIGl0eG4gTGFzdExvZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjcyCiAgICAvLyBhc3NlcnQgdHhuLmxhc3RfbG9nID09IGIiV29ybGQyIgogICAgYnl0ZSAiV29ybGQyIgogICAgPT0KICAgIGFzc2VydAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5Ojc0CiAgICAvLyB0eG4gPSBhcmM0LmFiaV9jYWxsKCJsb2dfc3RyaW5nIiwgYXJjNC5TdHJpbmcoIldvcmxkMyIpLCBhcHBfaWQ9YXBwLCBmZWU9MCkKICAgIGl0eG5fYmVnaW4KICAgIGludCBhcHBsCiAgICBpdHhuX2ZpZWxkIFR5cGVFbnVtCiAgICBpbnQgMAogICAgaXR4bl9maWVsZCBGZWUKICAgIGZyYW1lX2RpZyAtMQogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbklECiAgICBtZXRob2QgImxvZ19zdHJpbmcoc3RyaW5nKXZvaWQiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgYnl0ZSAiXHgwMFx4MDZXb3JsZDMiCiAgICBpdHhuX2ZpZWxkIEFwcGxpY2F0aW9uQXJncwogICAgaXR4bl9zdWJtaXQKICAgIGl0eG4gTGFzdExvZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5Ojc1CiAgICAvLyBhc3NlcnQgdHhuLmxhc3RfbG9nID09IGIiV29ybGQzIgogICAgYnl0ZSAiV29ybGQzIgogICAgPT0KICAgIGFzc2VydAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5Ojc3CiAgICAvLyB0eG4gPSBhcmM0LmFiaV9jYWxsKExvZ2dlci5sb2dfc3RyaW5nLCAiV29ybGQ0IiwgYXBwX2lkPWFwcCwgZmVlPTApCiAgICBpdHhuX2JlZ2luCiAgICBpbnQgYXBwbAogICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgaW50IDAKICAgIGl0eG5fZmllbGQgRmVlCiAgICBmcmFtZV9kaWcgLTEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25JRAogICAgbWV0aG9kICJsb2dfc3RyaW5nKHN0cmluZyl2b2lkIgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGJ5dGUgIlx4MDBceDA2V29ybGQ0IgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGl0eG5fc3VibWl0CiAgICBpdHhuIExhc3RMb2cKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo3OAogICAgLy8gYXNzZXJ0IHR4bi5sYXN0X2xvZyA9PSBiIldvcmxkNCIKICAgIGJ5dGUgIldvcmxkNCIKICAgID09CiAgICBhc3NlcnQKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHlwZWRfYWJpX2NhbGwudHlwZWRfYzJjLkdyZWV0ZXIudGVzdF9yZWZfdHlwZXMoYXBwOiB1aW50NjQsIGFzc2V0OiB1aW50NjQpIC0+IHZvaWQ6CnRlc3RfcmVmX3R5cGVzOgogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjgwLTgxCiAgICAvLyBAYXJjNC5hYmltZXRob2QoKQogICAgLy8gZGVmIHRlc3RfcmVmX3R5cGVzKHNlbGYsIGFwcDogQXBwbGljYXRpb24sIGFzc2V0OiBBc3NldCkgLT4gTm9uZToKICAgIHByb3RvIDIgMAogICAgLy8gdHlwZWRfYWJpX2NhbGwvdHlwZWRfYzJjLnB5OjgyLTg5CiAgICAvLyB0eG4gPSBhcmM0LmFiaV9jYWxsKAogICAgLy8gICAgIExvZ2dlci5sb2dfYXNzZXRfYWNjb3VudF9hcHAsCiAgICAvLyAgICAgYXNzZXQsCiAgICAvLyAgICAgR2xvYmFsLmN1cnJlbnRfYXBwbGljYXRpb25fYWRkcmVzcywKICAgIC8vICAgICBhcHAsCiAgICAvLyAgICAgYXBwX2lkPWFwcCwKICAgIC8vICAgICBmZWU9MCwKICAgIC8vICkKICAgIGl0eG5fYmVnaW4KICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo4NQogICAgLy8gR2xvYmFsLmN1cnJlbnRfYXBwbGljYXRpb25fYWRkcmVzcywKICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6ODItODkKICAgIC8vIHR4biA9IGFyYzQuYWJpX2NhbGwoCiAgICAvLyAgICAgTG9nZ2VyLmxvZ19hc3NldF9hY2NvdW50X2FwcCwKICAgIC8vICAgICBhc3NldCwKICAgIC8vICAgICBHbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzLAogICAgLy8gICAgIGFwcCwKICAgIC8vICAgICBhcHBfaWQ9YXBwLAogICAgLy8gICAgIGZlZT0wLAogICAgLy8gKQogICAgaW50IGFwcGwKICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo4OAogICAgLy8gZmVlPTAsCiAgICBpbnQgMAogICAgaXR4bl9maWVsZCBGZWUKICAgIGZyYW1lX2RpZyAtMQogICAgaXR4bl9maWVsZCBBc3NldHMKICAgIGZyYW1lX2RpZyAtMgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbnMKICAgIGZyYW1lX2RpZyAtMgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbklECiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6ODItODkKICAgIC8vIHR4biA9IGFyYzQuYWJpX2NhbGwoCiAgICAvLyAgICAgTG9nZ2VyLmxvZ19hc3NldF9hY2NvdW50X2FwcCwKICAgIC8vICAgICBhc3NldCwKICAgIC8vICAgICBHbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzLAogICAgLy8gICAgIGFwcCwKICAgIC8vICAgICBhcHBfaWQ9YXBwLAogICAgLy8gICAgIGZlZT0wLAogICAgLy8gKQogICAgbWV0aG9kICJsb2dfYXNzZXRfYWNjb3VudF9hcHAoYXNzZXQsYWNjb3VudCxhcHBsaWNhdGlvbil2b2lkIgogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo4NAogICAgLy8gYXNzZXQsCiAgICBieXRlIDB4MDAKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6ODUKICAgIC8vIEdsb2JhbC5jdXJyZW50X2FwcGxpY2F0aW9uX2FkZHJlc3MsCiAgICBieXRlIDB4MDEKICAgIGl0eG5fZmllbGQgQXBwbGljYXRpb25BcmdzCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6ODYKICAgIC8vIGFwcCwKICAgIGJ5dGUgMHgwMQogICAgaXR4bl9maWVsZCBBcHBsaWNhdGlvbkFyZ3MKICAgIGl0eG5fZmllbGQgQWNjb3VudHMKICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo4Mi04OQogICAgLy8gdHhuID0gYXJjNC5hYmlfY2FsbCgKICAgIC8vICAgICBMb2dnZXIubG9nX2Fzc2V0X2FjY291bnRfYXBwLAogICAgLy8gICAgIGFzc2V0LAogICAgLy8gICAgIEdsb2JhbC5jdXJyZW50X2FwcGxpY2F0aW9uX2FkZHJlc3MsCiAgICAvLyAgICAgYXBwLAogICAgLy8gICAgIGFwcF9pZD1hcHAsCiAgICAvLyAgICAgZmVlPTAsCiAgICAvLyApCiAgICBpdHhuX3N1Ym1pdAogICAgaXR4biBMYXN0TG9nCiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6OTIKICAgIC8vID09IGFzc2V0Lm5hbWUgKyBHbG9iYWwuY3VycmVudF9hcHBsaWNhdGlvbl9hZGRyZXNzLmJ5dGVzICsgYXBwLmFkZHJlc3MuYnl0ZXMKICAgIGZyYW1lX2RpZyAtMQogICAgYXNzZXRfcGFyYW1zX2dldCBBc3NldE5hbWUKICAgIGFzc2VydCAvLyBhc3NldCBleGlzdHMKICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICBjb25jYXQKICAgIGZyYW1lX2RpZyAtMgogICAgYXBwX3BhcmFtc19nZXQgQXBwQWRkcmVzcwogICAgYXNzZXJ0IC8vIGFwcGxpY2F0aW9uIGV4aXN0cwogICAgY29uY2F0CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6OTEtOTIKICAgIC8vIHR4bi5sYXN0X2xvZwogICAgLy8gPT0gYXNzZXQubmFtZSArIEdsb2JhbC5jdXJyZW50X2FwcGxpY2F0aW9uX2FkZHJlc3MuYnl0ZXMgKyBhcHAuYWRkcmVzcy5ieXRlcwogICAgPT0KICAgIC8vIHR5cGVkX2FiaV9jYWxsL3R5cGVkX2MyYy5weTo5MC05MwogICAgLy8gYXNzZXJ0ICgKICAgIC8vICAgICB0eG4ubGFzdF9sb2cKICAgIC8vICAgICA9PSBhc3NldC5uYW1lICsgR2xvYmFsLmN1cnJlbnRfYXBwbGljYXRpb25fYWRkcmVzcy5ieXRlcyArIGFwcC5hZGRyZXNzLmJ5dGVzCiAgICAvLyApCiAgICBhc3NlcnQKICAgIHJldHN1Ygo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLnR5cGVkX2MyYy5HcmVldGVyLmNsZWFyX3N0YXRlX3Byb2dyYW06CiAgICAvLyB0eXBlZF9hYmlfY2FsbC90eXBlZF9jMmMucHk6NgogICAgLy8gY2xhc3MgR3JlZXRlcihBUkM0Q29udHJhY3QpOgogICAgaW50IDEKICAgIHJldHVybgo=" + }, + "state": { + "global": { + "num_byte_slices": 0, + "num_uints": 0 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": {}, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "Greeter", + "methods": [ + { + "name": "test_method_selector_kinds", + "args": [ + { + "type": "application", + "name": "app" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "test_arg_conversion", + "args": [ + { + "type": "application", + "name": "app" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "test_15plus_args", + "args": [ + { + "type": "application", + "name": "app" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "test_void", + "args": [ + { + "type": "application", + "name": "app" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "test_ref_types", + "args": [ + { + "type": "application", + "name": "app" + }, + { + "type": "asset", + "name": "asset" + } + ], + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.clear.mir b/test_cases/typed_abi_call/out/Greeter.clear.mir new file mode 100644 index 0000000000..93315f49c3 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.clear.mir @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 10 + +// test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + return // class Greeter(ARC4Contract): typed_abi_call/typed_c2c.py:6 + diff --git a/test_cases/typed_abi_call/out/Greeter.clear.teal b/test_cases/typed_abi_call/out/Greeter.clear.teal new file mode 100644 index 0000000000..1abfdf3763 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 + +test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + int 1 + return diff --git a/test_cases/typed_abi_call/out/Greeter.destructured.ir b/test_cases/typed_abi_call/out/Greeter.destructured.ir new file mode 100644 index 0000000000..ff0dce0af3 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.destructured.ir @@ -0,0 +1,313 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#0 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#0 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#0 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#0 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#0 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#0 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#0 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#0 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) 0x0f101112deadbeef14) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#0 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#0 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#0 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.ir b/test_cases/typed_abi_call/out/Greeter.ssa.ir new file mode 100644 index 0000000000..c26c08f9fa --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.ir @@ -0,0 +1,2280 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@7} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (== tmp%2#0 NoOp) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (== tmp%8#0 NoOp) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (== tmp%14#0 NoOp) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (== tmp%20#0 NoOp) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (== tmp%26#0 NoOp) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@7: // switch_case_default_L6 + goto block@8 + block@8: // switch_case_next_L6 + goto block@12 + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + switch tmp%35#0 {0u => block@10, * => block@11} + block@10: // create_L6 + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + block@11: // reject_bare_on_completion_L6 + fail // reject transaction + block@12: // after_if_else_L6 + fail // reject transaction + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + let inner_txn_params%0%%Accounts_length#0: uint64 = 0u + let inner_txn_params%0%%Amount_length#0: uint64 = 0u + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test1" + let inner_txn_params%0%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%0%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%Applications_length#0: uint64 = 0u + let inner_txn_params%0%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%0%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%0%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%0%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%0%%Assets_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%Fee_length#0: uint64 = 1u + let inner_txn_params%0%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%0%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%0%%Note_length#0: uint64 = 0u + let inner_txn_params%0%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%0%%Receiver_length#0: uint64 = 0u + let inner_txn_params%0%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%0%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%0%%Sender_length#0: uint64 = 0u + let inner_txn_params%0%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%0%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%0%%Type_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%0%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%0%%VotePK_length#0: uint64 = 0u + let inner_txn_params%0%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%0%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%0%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + goto block@1 + block@1: // next_txn_L9 + itxn_submit + let %%inner_txn_submit_id#0: uint64 = 1u + let tmp_itxn_0%%Amount#0: uint64 = (itxn Amount) + let tmp_itxn_0%%ApplicationID#0: uint64 = (itxn ApplicationID) + let tmp_itxn_0%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let tmp_itxn_0%%AssetAmount#0: uint64 = (itxn AssetAmount) + let tmp_itxn_0%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let tmp_itxn_0%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let tmp_itxn_0%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let tmp_itxn_0%%AssetSender#0: bytes = (itxn AssetSender) + let tmp_itxn_0%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let tmp_itxn_0%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let tmp_itxn_0%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let tmp_itxn_0%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let tmp_itxn_0%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let tmp_itxn_0%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let tmp_itxn_0%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let tmp_itxn_0%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let tmp_itxn_0%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let tmp_itxn_0%%Fee#0: uint64 = (itxn Fee) + let tmp_itxn_0%%FirstValid#0: uint64 = (itxn FirstValid) + let tmp_itxn_0%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let tmp_itxn_0%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let tmp_itxn_0%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let tmp_itxn_0%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let tmp_itxn_0%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let tmp_itxn_0%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let tmp_itxn_0%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let tmp_itxn_0%%GroupIndex#0: uint64 = (itxn GroupIndex) + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let tmp_itxn_0%%LastValid#0: uint64 = (itxn LastValid) + let tmp_itxn_0%%Lease#0: bytes = (itxn Lease) + let tmp_itxn_0%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let tmp_itxn_0%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let tmp_itxn_0%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let tmp_itxn_0%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let tmp_itxn_0%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let tmp_itxn_0%%Note#0: bytes = (itxn Note) + let tmp_itxn_0%%NumAccounts#0: uint64 = (itxn NumAccounts) + let tmp_itxn_0%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let tmp_itxn_0%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let tmp_itxn_0%%NumApplications#0: uint64 = (itxn NumApplications) + let tmp_itxn_0%%NumAssets#0: uint64 = (itxn NumAssets) + let tmp_itxn_0%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let tmp_itxn_0%%NumLogs#0: uint64 = (itxn NumLogs) + let tmp_itxn_0%%OnCompletion#0: uint64 = (itxn OnCompletion) + let tmp_itxn_0%%Receiver#0: bytes = (itxn Receiver) + let tmp_itxn_0%%RekeyTo#0: bytes = (itxn RekeyTo) + let tmp_itxn_0%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let tmp_itxn_0%%SelectionPK#0: bytes = (itxn SelectionPK) + let tmp_itxn_0%%Sender#0: bytes = (itxn Sender) + let tmp_itxn_0%%StateProofPK#0: bytes = (itxn StateProofPK) + let tmp_itxn_0%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let tmp_itxn_0%%TxID#0: bytes = (itxn TxID) + let tmp_itxn_0%%TypeEnum#0: uint64 = (itxn TypeEnum) + let tmp_itxn_0%%Type#0: bytes = (itxn Type) + let tmp_itxn_0%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let tmp_itxn_0%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let tmp_itxn_0%%VoteFirst#0: uint64 = (itxn VoteFirst) + let tmp_itxn_0%%VotePK#0: bytes = (itxn VotePK) + let tmp_itxn_0%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let tmp_itxn_0%%VoteLast#0: uint64 = (itxn VoteLast) + let tmp_itxn_0%%XferAsset#0: uint64 = (itxn XferAsset) + let awst_tmp%1#0: bytes = tmp_itxn_0%%LastLog#0 + let tmp%2#0: bytes = ((extract 4 0) awst_tmp%1#0) + let tmp%3#0: bytes = ((extract 0 4) awst_tmp%1#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + let (value%5#0: bytes, check%6#0: uint64) = (tmp%2#0, tmp%4#0) + (assert check%6#0) // ARC4 prefix is valid + let result#0: bytes = value%5#0 + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + let inner_txn_params%8%%Accounts_length#0: uint64 = 0u + let inner_txn_params%8%%Amount_length#0: uint64 = 0u + let inner_txn_params%8%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%8%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test2" + let inner_txn_params%8%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%8%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%8%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%8%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%8%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%8%%Applications_length#0: uint64 = 0u + let inner_txn_params%8%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%8%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%8%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%8%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%8%%Assets_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%8%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%8%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%8%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%8%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%8%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%8%%Fee_length#0: uint64 = 1u + let inner_txn_params%8%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%8%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%8%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%8%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%8%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%8%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%8%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%8%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%8%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%8%%Note_length#0: uint64 = 0u + let inner_txn_params%8%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%8%%Receiver_length#0: uint64 = 0u + let inner_txn_params%8%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%8%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%8%%Sender_length#0: uint64 = 0u + let inner_txn_params%8%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%8%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%8%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%8%%Type_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%8%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%8%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%8%%VotePK_length#0: uint64 = 0u + let inner_txn_params%8%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%8%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%8%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%8%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%8%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%8%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%8%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%8%%param_ApplicationArgs_idx_1#0) + goto block@2 + block@2: // next_txn_L11 + itxn_submit + let %%inner_txn_submit_id#1: uint64 = 2u + let tmp_itxn_1%%Amount#0: uint64 = (itxn Amount) + let tmp_itxn_1%%ApplicationID#0: uint64 = (itxn ApplicationID) + let tmp_itxn_1%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let tmp_itxn_1%%AssetAmount#0: uint64 = (itxn AssetAmount) + let tmp_itxn_1%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let tmp_itxn_1%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let tmp_itxn_1%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let tmp_itxn_1%%AssetSender#0: bytes = (itxn AssetSender) + let tmp_itxn_1%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let tmp_itxn_1%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let tmp_itxn_1%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let tmp_itxn_1%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let tmp_itxn_1%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let tmp_itxn_1%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let tmp_itxn_1%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let tmp_itxn_1%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let tmp_itxn_1%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let tmp_itxn_1%%Fee#0: uint64 = (itxn Fee) + let tmp_itxn_1%%FirstValid#0: uint64 = (itxn FirstValid) + let tmp_itxn_1%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let tmp_itxn_1%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let tmp_itxn_1%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let tmp_itxn_1%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let tmp_itxn_1%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let tmp_itxn_1%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let tmp_itxn_1%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let tmp_itxn_1%%GroupIndex#0: uint64 = (itxn GroupIndex) + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let tmp_itxn_1%%LastValid#0: uint64 = (itxn LastValid) + let tmp_itxn_1%%Lease#0: bytes = (itxn Lease) + let tmp_itxn_1%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let tmp_itxn_1%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let tmp_itxn_1%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let tmp_itxn_1%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let tmp_itxn_1%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let tmp_itxn_1%%Note#0: bytes = (itxn Note) + let tmp_itxn_1%%NumAccounts#0: uint64 = (itxn NumAccounts) + let tmp_itxn_1%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let tmp_itxn_1%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let tmp_itxn_1%%NumApplications#0: uint64 = (itxn NumApplications) + let tmp_itxn_1%%NumAssets#0: uint64 = (itxn NumAssets) + let tmp_itxn_1%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let tmp_itxn_1%%NumLogs#0: uint64 = (itxn NumLogs) + let tmp_itxn_1%%OnCompletion#0: uint64 = (itxn OnCompletion) + let tmp_itxn_1%%Receiver#0: bytes = (itxn Receiver) + let tmp_itxn_1%%RekeyTo#0: bytes = (itxn RekeyTo) + let tmp_itxn_1%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let tmp_itxn_1%%SelectionPK#0: bytes = (itxn SelectionPK) + let tmp_itxn_1%%Sender#0: bytes = (itxn Sender) + let tmp_itxn_1%%StateProofPK#0: bytes = (itxn StateProofPK) + let tmp_itxn_1%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let tmp_itxn_1%%TxID#0: bytes = (itxn TxID) + let tmp_itxn_1%%TypeEnum#0: uint64 = (itxn TypeEnum) + let tmp_itxn_1%%Type#0: bytes = (itxn Type) + let tmp_itxn_1%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let tmp_itxn_1%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let tmp_itxn_1%%VoteFirst#0: uint64 = (itxn VoteFirst) + let tmp_itxn_1%%VotePK#0: bytes = (itxn VotePK) + let tmp_itxn_1%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let tmp_itxn_1%%VoteLast#0: uint64 = (itxn VoteLast) + let tmp_itxn_1%%XferAsset#0: uint64 = (itxn XferAsset) + let awst_tmp%9#0: bytes = tmp_itxn_1%%LastLog#0 + let tmp%10#0: bytes = ((extract 4 0) awst_tmp%9#0) + let tmp%11#0: bytes = ((extract 0 4) awst_tmp%9#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + let (value%13#0: bytes, check%14#0: uint64) = (tmp%10#0, tmp%12#0) + (assert check%14#0) // ARC4 prefix is valid + let result#1: bytes = value%13#0 + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + let inner_txn_params%16%%Accounts_length#0: uint64 = 0u + let inner_txn_params%16%%Amount_length#0: uint64 = 0u + let inner_txn_params%16%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%16%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test3" + let inner_txn_params%16%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%16%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%16%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%16%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%16%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%16%%Applications_length#0: uint64 = 0u + let inner_txn_params%16%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%16%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%16%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%16%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%16%%Assets_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%16%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%16%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%16%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%16%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%16%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%16%%Fee_length#0: uint64 = 1u + let inner_txn_params%16%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%16%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%16%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%16%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%16%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%16%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%16%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%16%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%16%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%16%%Note_length#0: uint64 = 0u + let inner_txn_params%16%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%16%%Receiver_length#0: uint64 = 0u + let inner_txn_params%16%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%16%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%16%%Sender_length#0: uint64 = 0u + let inner_txn_params%16%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%16%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%16%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%16%%Type_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%16%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%16%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%16%%VotePK_length#0: uint64 = 0u + let inner_txn_params%16%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%16%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%16%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%16%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%16%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%16%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%16%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%16%%param_ApplicationArgs_idx_1#0) + goto block@3 + block@3: // next_txn_L13 + itxn_submit + let %%inner_txn_submit_id#2: uint64 = 3u + let tmp_itxn_2%%Amount#0: uint64 = (itxn Amount) + let tmp_itxn_2%%ApplicationID#0: uint64 = (itxn ApplicationID) + let tmp_itxn_2%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let tmp_itxn_2%%AssetAmount#0: uint64 = (itxn AssetAmount) + let tmp_itxn_2%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let tmp_itxn_2%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let tmp_itxn_2%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let tmp_itxn_2%%AssetSender#0: bytes = (itxn AssetSender) + let tmp_itxn_2%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let tmp_itxn_2%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let tmp_itxn_2%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let tmp_itxn_2%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let tmp_itxn_2%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let tmp_itxn_2%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let tmp_itxn_2%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let tmp_itxn_2%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let tmp_itxn_2%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let tmp_itxn_2%%Fee#0: uint64 = (itxn Fee) + let tmp_itxn_2%%FirstValid#0: uint64 = (itxn FirstValid) + let tmp_itxn_2%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let tmp_itxn_2%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let tmp_itxn_2%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let tmp_itxn_2%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let tmp_itxn_2%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let tmp_itxn_2%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let tmp_itxn_2%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let tmp_itxn_2%%GroupIndex#0: uint64 = (itxn GroupIndex) + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let tmp_itxn_2%%LastValid#0: uint64 = (itxn LastValid) + let tmp_itxn_2%%Lease#0: bytes = (itxn Lease) + let tmp_itxn_2%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let tmp_itxn_2%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let tmp_itxn_2%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let tmp_itxn_2%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let tmp_itxn_2%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let tmp_itxn_2%%Note#0: bytes = (itxn Note) + let tmp_itxn_2%%NumAccounts#0: uint64 = (itxn NumAccounts) + let tmp_itxn_2%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let tmp_itxn_2%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let tmp_itxn_2%%NumApplications#0: uint64 = (itxn NumApplications) + let tmp_itxn_2%%NumAssets#0: uint64 = (itxn NumAssets) + let tmp_itxn_2%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let tmp_itxn_2%%NumLogs#0: uint64 = (itxn NumLogs) + let tmp_itxn_2%%OnCompletion#0: uint64 = (itxn OnCompletion) + let tmp_itxn_2%%Receiver#0: bytes = (itxn Receiver) + let tmp_itxn_2%%RekeyTo#0: bytes = (itxn RekeyTo) + let tmp_itxn_2%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let tmp_itxn_2%%SelectionPK#0: bytes = (itxn SelectionPK) + let tmp_itxn_2%%Sender#0: bytes = (itxn Sender) + let tmp_itxn_2%%StateProofPK#0: bytes = (itxn StateProofPK) + let tmp_itxn_2%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let tmp_itxn_2%%TxID#0: bytes = (itxn TxID) + let tmp_itxn_2%%TypeEnum#0: uint64 = (itxn TypeEnum) + let tmp_itxn_2%%Type#0: bytes = (itxn Type) + let tmp_itxn_2%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let tmp_itxn_2%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let tmp_itxn_2%%VoteFirst#0: uint64 = (itxn VoteFirst) + let tmp_itxn_2%%VotePK#0: bytes = (itxn VotePK) + let tmp_itxn_2%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let tmp_itxn_2%%VoteLast#0: uint64 = (itxn VoteLast) + let tmp_itxn_2%%XferAsset#0: uint64 = (itxn XferAsset) + let awst_tmp%17#0: bytes = tmp_itxn_2%%LastLog#0 + let tmp%18#0: bytes = ((extract 4 0) awst_tmp%17#0) + let tmp%19#0: bytes = ((extract 0 4) awst_tmp%17#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + let (value%21#0: bytes, check%22#0: uint64) = (tmp%18#0, tmp%20#0) + (assert check%22#0) // ARC4 prefix is valid + let result#2: bytes = value%21#0 + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + let inner_txn_params%24%%Accounts_length#0: uint64 = 0u + let inner_txn_params%24%%Amount_length#0: uint64 = 0u + let inner_txn_params%24%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%24%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test4" + let inner_txn_params%24%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%24%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%24%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%24%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%24%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%24%%Applications_length#0: uint64 = 0u + let inner_txn_params%24%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%24%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%24%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%24%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%24%%Assets_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%24%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%24%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%24%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%24%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%24%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%24%%Fee_length#0: uint64 = 1u + let inner_txn_params%24%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%24%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%24%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%24%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%24%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%24%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%24%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%24%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%24%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%24%%Note_length#0: uint64 = 0u + let inner_txn_params%24%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%24%%Receiver_length#0: uint64 = 0u + let inner_txn_params%24%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%24%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%24%%Sender_length#0: uint64 = 0u + let inner_txn_params%24%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%24%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%24%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%24%%Type_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%24%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%24%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%24%%VotePK_length#0: uint64 = 0u + let inner_txn_params%24%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%24%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%24%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%24%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%24%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%24%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%24%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%24%%param_ApplicationArgs_idx_1#0) + goto block@4 + block@4: // next_txn_L15 + itxn_submit + let %%inner_txn_submit_id#3: uint64 = 4u + let tmp_itxn_3%%Amount#0: uint64 = (itxn Amount) + let tmp_itxn_3%%ApplicationID#0: uint64 = (itxn ApplicationID) + let tmp_itxn_3%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let tmp_itxn_3%%AssetAmount#0: uint64 = (itxn AssetAmount) + let tmp_itxn_3%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let tmp_itxn_3%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let tmp_itxn_3%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let tmp_itxn_3%%AssetSender#0: bytes = (itxn AssetSender) + let tmp_itxn_3%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let tmp_itxn_3%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let tmp_itxn_3%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let tmp_itxn_3%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let tmp_itxn_3%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let tmp_itxn_3%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let tmp_itxn_3%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let tmp_itxn_3%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let tmp_itxn_3%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let tmp_itxn_3%%Fee#0: uint64 = (itxn Fee) + let tmp_itxn_3%%FirstValid#0: uint64 = (itxn FirstValid) + let tmp_itxn_3%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let tmp_itxn_3%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let tmp_itxn_3%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let tmp_itxn_3%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let tmp_itxn_3%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let tmp_itxn_3%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let tmp_itxn_3%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let tmp_itxn_3%%GroupIndex#0: uint64 = (itxn GroupIndex) + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let tmp_itxn_3%%LastValid#0: uint64 = (itxn LastValid) + let tmp_itxn_3%%Lease#0: bytes = (itxn Lease) + let tmp_itxn_3%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let tmp_itxn_3%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let tmp_itxn_3%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let tmp_itxn_3%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let tmp_itxn_3%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let tmp_itxn_3%%Note#0: bytes = (itxn Note) + let tmp_itxn_3%%NumAccounts#0: uint64 = (itxn NumAccounts) + let tmp_itxn_3%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let tmp_itxn_3%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let tmp_itxn_3%%NumApplications#0: uint64 = (itxn NumApplications) + let tmp_itxn_3%%NumAssets#0: uint64 = (itxn NumAssets) + let tmp_itxn_3%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let tmp_itxn_3%%NumLogs#0: uint64 = (itxn NumLogs) + let tmp_itxn_3%%OnCompletion#0: uint64 = (itxn OnCompletion) + let tmp_itxn_3%%Receiver#0: bytes = (itxn Receiver) + let tmp_itxn_3%%RekeyTo#0: bytes = (itxn RekeyTo) + let tmp_itxn_3%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let tmp_itxn_3%%SelectionPK#0: bytes = (itxn SelectionPK) + let tmp_itxn_3%%Sender#0: bytes = (itxn Sender) + let tmp_itxn_3%%StateProofPK#0: bytes = (itxn StateProofPK) + let tmp_itxn_3%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let tmp_itxn_3%%TxID#0: bytes = (itxn TxID) + let tmp_itxn_3%%TypeEnum#0: uint64 = (itxn TypeEnum) + let tmp_itxn_3%%Type#0: bytes = (itxn Type) + let tmp_itxn_3%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let tmp_itxn_3%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let tmp_itxn_3%%VoteFirst#0: uint64 = (itxn VoteFirst) + let tmp_itxn_3%%VotePK#0: bytes = (itxn VotePK) + let tmp_itxn_3%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let tmp_itxn_3%%VoteLast#0: uint64 = (itxn VoteLast) + let tmp_itxn_3%%XferAsset#0: uint64 = (itxn XferAsset) + let awst_tmp%25#0: bytes = tmp_itxn_3%%LastLog#0 + let tmp%26#0: bytes = ((extract 4 0) awst_tmp%25#0) + let tmp%27#0: bytes = ((extract 0 4) awst_tmp%25#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + let (value%29#0: bytes, check%30#0: uint64) = (tmp%26#0, tmp%28#0) + (assert check%30#0) // ARC4 prefix is valid + let result#3: bytes = value%29#0 + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + let inner_txn_params%32%%Accounts_length#0: uint64 = 0u + let inner_txn_params%32%%Amount_length#0: uint64 = 0u + let inner_txn_params%32%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%32%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test5" + let inner_txn_params%32%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%32%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%32%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%32%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%32%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%32%%Applications_length#0: uint64 = 0u + let inner_txn_params%32%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%32%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%32%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%32%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%32%%Assets_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%32%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%32%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%32%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%32%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%32%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%32%%Fee_length#0: uint64 = 1u + let inner_txn_params%32%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%32%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%32%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%32%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%32%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%32%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%32%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%32%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%32%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%32%%Note_length#0: uint64 = 0u + let inner_txn_params%32%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%32%%Receiver_length#0: uint64 = 0u + let inner_txn_params%32%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%32%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%32%%Sender_length#0: uint64 = 0u + let inner_txn_params%32%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%32%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%32%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%32%%Type_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%32%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%32%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%32%%VotePK_length#0: uint64 = 0u + let inner_txn_params%32%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%32%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%32%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%32%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%32%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%32%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%32%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%32%%param_ApplicationArgs_idx_1#0) + goto block@5 + block@5: // next_txn_L17 + itxn_submit + let %%inner_txn_submit_id#4: uint64 = 5u + let tmp_itxn_4%%Amount#0: uint64 = (itxn Amount) + let tmp_itxn_4%%ApplicationID#0: uint64 = (itxn ApplicationID) + let tmp_itxn_4%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let tmp_itxn_4%%AssetAmount#0: uint64 = (itxn AssetAmount) + let tmp_itxn_4%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let tmp_itxn_4%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let tmp_itxn_4%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let tmp_itxn_4%%AssetSender#0: bytes = (itxn AssetSender) + let tmp_itxn_4%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let tmp_itxn_4%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let tmp_itxn_4%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let tmp_itxn_4%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let tmp_itxn_4%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let tmp_itxn_4%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let tmp_itxn_4%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let tmp_itxn_4%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let tmp_itxn_4%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let tmp_itxn_4%%Fee#0: uint64 = (itxn Fee) + let tmp_itxn_4%%FirstValid#0: uint64 = (itxn FirstValid) + let tmp_itxn_4%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let tmp_itxn_4%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let tmp_itxn_4%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let tmp_itxn_4%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let tmp_itxn_4%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let tmp_itxn_4%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let tmp_itxn_4%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let tmp_itxn_4%%GroupIndex#0: uint64 = (itxn GroupIndex) + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let tmp_itxn_4%%LastValid#0: uint64 = (itxn LastValid) + let tmp_itxn_4%%Lease#0: bytes = (itxn Lease) + let tmp_itxn_4%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let tmp_itxn_4%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let tmp_itxn_4%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let tmp_itxn_4%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let tmp_itxn_4%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let tmp_itxn_4%%Note#0: bytes = (itxn Note) + let tmp_itxn_4%%NumAccounts#0: uint64 = (itxn NumAccounts) + let tmp_itxn_4%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let tmp_itxn_4%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let tmp_itxn_4%%NumApplications#0: uint64 = (itxn NumApplications) + let tmp_itxn_4%%NumAssets#0: uint64 = (itxn NumAssets) + let tmp_itxn_4%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let tmp_itxn_4%%NumLogs#0: uint64 = (itxn NumLogs) + let tmp_itxn_4%%OnCompletion#0: uint64 = (itxn OnCompletion) + let tmp_itxn_4%%Receiver#0: bytes = (itxn Receiver) + let tmp_itxn_4%%RekeyTo#0: bytes = (itxn RekeyTo) + let tmp_itxn_4%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let tmp_itxn_4%%SelectionPK#0: bytes = (itxn SelectionPK) + let tmp_itxn_4%%Sender#0: bytes = (itxn Sender) + let tmp_itxn_4%%StateProofPK#0: bytes = (itxn StateProofPK) + let tmp_itxn_4%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let tmp_itxn_4%%TxID#0: bytes = (itxn TxID) + let tmp_itxn_4%%TypeEnum#0: uint64 = (itxn TypeEnum) + let tmp_itxn_4%%Type#0: bytes = (itxn Type) + let tmp_itxn_4%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let tmp_itxn_4%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let tmp_itxn_4%%VoteFirst#0: uint64 = (itxn VoteFirst) + let tmp_itxn_4%%VotePK#0: bytes = (itxn VotePK) + let tmp_itxn_4%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let tmp_itxn_4%%VoteLast#0: uint64 = (itxn VoteLast) + let tmp_itxn_4%%XferAsset#0: uint64 = (itxn XferAsset) + let awst_tmp%33#0: bytes = tmp_itxn_4%%LastLog#0 + let tmp%34#0: bytes = ((extract 4 0) awst_tmp%33#0) + let tmp%35#0: bytes = ((extract 0 4) awst_tmp%33#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + let (value%37#0: bytes, check%38#0: uint64) = (tmp%34#0, tmp%36#0) + (assert check%38#0) // ARC4 prefix is valid + let result#4: bytes = value%37#0 + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + let inner_txn_params%0%%Accounts_length#0: uint64 = 0u + let inner_txn_params%0%%Amount_length#0: uint64 = 0u + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = "\x00\nconverted1" + let inner_txn_params%0%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%0%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%Applications_length#0: uint64 = 0u + let inner_txn_params%0%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%0%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%0%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%0%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%0%%Assets_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%Fee_length#0: uint64 = 1u + let inner_txn_params%0%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%0%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%0%%Note_length#0: uint64 = 0u + let inner_txn_params%0%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%0%%Receiver_length#0: uint64 = 0u + let inner_txn_params%0%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%0%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%0%%Sender_length#0: uint64 = 0u + let inner_txn_params%0%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%0%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%0%%Type_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%0%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%0%%VotePK_length#0: uint64 = 0u + let inner_txn_params%0%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%0%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%0%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + goto block@1 + block@1: // next_txn_L22 + itxn_submit + let %%inner_txn_submit_id#0: uint64 = 1u + let txn%%Amount#0: uint64 = (itxn Amount) + let txn%%ApplicationID#0: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#0: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let txn%%AssetSender#0: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#0: uint64 = (itxn Fee) + let txn%%FirstValid#0: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#0: uint64 = (itxn GroupIndex) + let txn%%LastLog#0: bytes = (itxn LastLog) + let txn%%LastValid#0: uint64 = (itxn LastValid) + let txn%%Lease#0: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let txn%%Note#0: bytes = (itxn Note) + let txn%%NumAccounts#0: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#0: uint64 = (itxn NumApplications) + let txn%%NumAssets#0: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#0: uint64 = (itxn NumLogs) + let txn%%OnCompletion#0: uint64 = (itxn OnCompletion) + let txn%%Receiver#0: bytes = (itxn Receiver) + let txn%%RekeyTo#0: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#0: bytes = (itxn SelectionPK) + let txn%%Sender#0: bytes = (itxn Sender) + let txn%%StateProofPK#0: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#0: bytes = (itxn TxID) + let txn%%TypeEnum#0: uint64 = (itxn TypeEnum) + let txn%%Type#0: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#0: uint64 = (itxn VoteFirst) + let txn%%VotePK#0: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#0: uint64 = (itxn VoteLast) + let txn%%XferAsset#0: uint64 = (itxn XferAsset) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + let inner_txn_params%2%%Accounts_length#0: uint64 = 0u + let inner_txn_params%2%%Amount_length#0: uint64 = 0u + let inner_txn_params%2%%param_ApplicationArgs_idx_0#0: bytes = method "log_uint64(uint64)void" + let inner_txn_params%2%%param_ApplicationArgs_idx_1#0: bytes = 0x0000000000000002 + let inner_txn_params%2%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%2%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%2%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%2%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%2%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%2%%Applications_length#0: uint64 = 0u + let inner_txn_params%2%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%2%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%2%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%2%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%2%%Assets_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%2%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%2%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%2%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%2%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%2%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%2%%Fee_length#0: uint64 = 1u + let inner_txn_params%2%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%2%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%2%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%2%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%2%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%2%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%2%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%2%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%2%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%2%%Note_length#0: uint64 = 0u + let inner_txn_params%2%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%2%%Receiver_length#0: uint64 = 0u + let inner_txn_params%2%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%2%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%2%%Sender_length#0: uint64 = 0u + let inner_txn_params%2%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%2%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%2%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%2%%Type_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%2%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%2%%VotePK_length#0: uint64 = 0u + let inner_txn_params%2%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%2%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%2%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%2%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%2%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%2%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_1#0) + goto block@2 + block@2: // next_txn_L25 + itxn_submit + let %%inner_txn_submit_id#1: uint64 = 2u + let txn%%Amount#1: uint64 = (itxn Amount) + let txn%%ApplicationID#1: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#1: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#1: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#1: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#1: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#1: bytes = (itxn AssetReceiver) + let txn%%AssetSender#1: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#1: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#1: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#1: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#1: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#1: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#1: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#1: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#1: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#1: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#1: uint64 = (itxn Fee) + let txn%%FirstValid#1: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#1: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#1: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#1: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#1: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#1: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#1: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#1: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#1: uint64 = (itxn GroupIndex) + let txn%%LastLog#1: bytes = (itxn LastLog) + let txn%%LastValid#1: uint64 = (itxn LastValid) + let txn%%Lease#1: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#1: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#1: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#1: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#1: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#1: uint64 = (itxn Nonparticipation) + let txn%%Note#1: bytes = (itxn Note) + let txn%%NumAccounts#1: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#1: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#1: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#1: uint64 = (itxn NumApplications) + let txn%%NumAssets#1: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#1: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#1: uint64 = (itxn NumLogs) + let txn%%OnCompletion#1: uint64 = (itxn OnCompletion) + let txn%%Receiver#1: bytes = (itxn Receiver) + let txn%%RekeyTo#1: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#1: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#1: bytes = (itxn SelectionPK) + let txn%%Sender#1: bytes = (itxn Sender) + let txn%%StateProofPK#1: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#1: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#1: bytes = (itxn TxID) + let txn%%TypeEnum#1: uint64 = (itxn TypeEnum) + let txn%%Type#1: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#1: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#1: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#1: uint64 = (itxn VoteFirst) + let txn%%VotePK#1: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#1: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#1: uint64 = (itxn VoteLast) + let txn%%XferAsset#1: uint64 = (itxn XferAsset) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + let inner_txn_params%5%%Accounts_length#0: uint64 = 0u + let inner_txn_params%5%%Amount_length#0: uint64 = 0u + let inner_txn_params%5%%param_ApplicationArgs_idx_0#0: bytes = method "log_uint512(uint512)void" + let inner_txn_params%5%%param_ApplicationArgs_idx_1#0: bytes = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + let inner_txn_params%5%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%5%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%5%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%5%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%5%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%5%%Applications_length#0: uint64 = 0u + let inner_txn_params%5%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%5%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%5%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%5%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%5%%Assets_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%5%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%5%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%5%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%5%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%5%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%5%%Fee_length#0: uint64 = 1u + let inner_txn_params%5%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%5%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%5%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%5%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%5%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%5%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%5%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%5%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%5%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%5%%Note_length#0: uint64 = 0u + let inner_txn_params%5%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%5%%Receiver_length#0: uint64 = 0u + let inner_txn_params%5%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%5%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%5%%Sender_length#0: uint64 = 0u + let inner_txn_params%5%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%5%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%5%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%5%%Type_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%5%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%5%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%5%%VotePK_length#0: uint64 = 0u + let inner_txn_params%5%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%5%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%5%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%5%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%5%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%5%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%5%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%5%%param_ApplicationArgs_idx_1#0) + goto block@3 + block@3: // next_txn_L28 + itxn_submit + let %%inner_txn_submit_id#2: uint64 = 3u + let txn%%Amount#2: uint64 = (itxn Amount) + let txn%%ApplicationID#2: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#2: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#2: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#2: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#2: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#2: bytes = (itxn AssetReceiver) + let txn%%AssetSender#2: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#2: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#2: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#2: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#2: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#2: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#2: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#2: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#2: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#2: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#2: uint64 = (itxn Fee) + let txn%%FirstValid#2: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#2: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#2: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#2: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#2: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#2: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#2: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#2: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#2: uint64 = (itxn GroupIndex) + let txn%%LastLog#2: bytes = (itxn LastLog) + let txn%%LastValid#2: uint64 = (itxn LastValid) + let txn%%Lease#2: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#2: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#2: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#2: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#2: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#2: uint64 = (itxn Nonparticipation) + let txn%%Note#2: bytes = (itxn Note) + let txn%%NumAccounts#2: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#2: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#2: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#2: uint64 = (itxn NumApplications) + let txn%%NumAssets#2: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#2: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#2: uint64 = (itxn NumLogs) + let txn%%OnCompletion#2: uint64 = (itxn OnCompletion) + let txn%%Receiver#2: bytes = (itxn Receiver) + let txn%%RekeyTo#2: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#2: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#2: bytes = (itxn SelectionPK) + let txn%%Sender#2: bytes = (itxn Sender) + let txn%%StateProofPK#2: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#2: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#2: bytes = (itxn TxID) + let txn%%TypeEnum#2: uint64 = (itxn TypeEnum) + let txn%%Type#2: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#2: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#2: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#2: uint64 = (itxn VoteFirst) + let txn%%VotePK#2: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#2: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#2: uint64 = (itxn VoteLast) + let txn%%XferAsset#2: uint64 = (itxn XferAsset) + let tmp%6#0: bytes = (bzero 56u) + let tmp%7#0: bytes = (itob 3u) + let tmp%8#0: bytes = (concat tmp%6#0 tmp%7#0) + let tmp%9#0: uint64 = (== txn%%LastLog#2 tmp%8#0) + (assert tmp%9#0) + itxn_begin + let inner_txn_params%10%%Accounts_length#0: uint64 = 0u + let inner_txn_params%10%%Amount_length#0: uint64 = 0u + let inner_txn_params%10%%param_ApplicationArgs_idx_0#0: bytes = method "log_bytes(byte[])void" + let inner_txn_params%10%%param_ApplicationArgs_idx_1#0: bytes = 0x000134 + let inner_txn_params%10%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%10%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%10%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%10%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%10%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%10%%Applications_length#0: uint64 = 0u + let inner_txn_params%10%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%10%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%10%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%10%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%10%%Assets_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%10%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%10%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%10%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%10%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%10%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%10%%Fee_length#0: uint64 = 1u + let inner_txn_params%10%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%10%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%10%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%10%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%10%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%10%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%10%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%10%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%10%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%10%%Note_length#0: uint64 = 0u + let inner_txn_params%10%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%10%%Receiver_length#0: uint64 = 0u + let inner_txn_params%10%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%10%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%10%%Sender_length#0: uint64 = 0u + let inner_txn_params%10%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%10%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%10%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%10%%Type_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%10%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%10%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%10%%VotePK_length#0: uint64 = 0u + let inner_txn_params%10%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%10%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%10%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%10%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%10%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%10%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%10%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%10%%param_ApplicationArgs_idx_1#0) + goto block@4 + block@4: // next_txn_L31 + itxn_submit + let %%inner_txn_submit_id#3: uint64 = 4u + let txn%%Amount#3: uint64 = (itxn Amount) + let txn%%ApplicationID#3: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#3: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#3: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#3: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#3: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#3: bytes = (itxn AssetReceiver) + let txn%%AssetSender#3: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#3: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#3: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#3: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#3: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#3: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#3: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#3: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#3: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#3: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#3: uint64 = (itxn Fee) + let txn%%FirstValid#3: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#3: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#3: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#3: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#3: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#3: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#3: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#3: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#3: uint64 = (itxn GroupIndex) + let txn%%LastLog#3: bytes = (itxn LastLog) + let txn%%LastValid#3: uint64 = (itxn LastValid) + let txn%%Lease#3: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#3: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#3: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#3: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#3: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#3: uint64 = (itxn Nonparticipation) + let txn%%Note#3: bytes = (itxn Note) + let txn%%NumAccounts#3: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#3: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#3: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#3: uint64 = (itxn NumApplications) + let txn%%NumAssets#3: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#3: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#3: uint64 = (itxn NumLogs) + let txn%%OnCompletion#3: uint64 = (itxn OnCompletion) + let txn%%Receiver#3: bytes = (itxn Receiver) + let txn%%RekeyTo#3: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#3: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#3: bytes = (itxn SelectionPK) + let txn%%Sender#3: bytes = (itxn Sender) + let txn%%StateProofPK#3: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#3: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#3: bytes = (itxn TxID) + let txn%%TypeEnum#3: uint64 = (itxn TypeEnum) + let txn%%Type#3: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#3: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#3: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#3: uint64 = (itxn VoteFirst) + let txn%%VotePK#3: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#3: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#3: uint64 = (itxn VoteLast) + let txn%%XferAsset#3: uint64 = (itxn XferAsset) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + let inner_txn_params%12%%Accounts_length#0: uint64 = 0u + let inner_txn_params%12%%Amount_length#0: uint64 = 0u + let tmp%13#0: any = (setbit 0x00 0u 1u) + let inner_txn_params%12%%param_ApplicationArgs_idx_0#0: bytes = method "log_bool(bool)void" + let inner_txn_params%12%%param_ApplicationArgs_idx_1#0: any = tmp%13#0 + let inner_txn_params%12%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%12%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%12%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%12%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%12%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%12%%Applications_length#0: uint64 = 0u + let inner_txn_params%12%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%12%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%12%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%12%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%12%%Assets_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%12%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%12%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%12%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%12%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%12%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%12%%Fee_length#0: uint64 = 1u + let inner_txn_params%12%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%12%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%12%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%12%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%12%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%12%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%12%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%12%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%12%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%12%%Note_length#0: uint64 = 0u + let inner_txn_params%12%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%12%%Receiver_length#0: uint64 = 0u + let inner_txn_params%12%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%12%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%12%%Sender_length#0: uint64 = 0u + let inner_txn_params%12%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%12%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%12%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%12%%Type_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%12%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%12%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%12%%VotePK_length#0: uint64 = 0u + let inner_txn_params%12%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%12%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%12%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%12%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%12%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%12%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%12%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%12%%param_ApplicationArgs_idx_1#0) + goto block@5 + block@5: // next_txn_L34 + itxn_submit + let %%inner_txn_submit_id#4: uint64 = 5u + let txn%%Amount#4: uint64 = (itxn Amount) + let txn%%ApplicationID#4: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#4: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#4: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#4: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#4: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#4: bytes = (itxn AssetReceiver) + let txn%%AssetSender#4: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#4: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#4: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#4: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#4: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#4: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#4: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#4: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#4: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#4: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#4: uint64 = (itxn Fee) + let txn%%FirstValid#4: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#4: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#4: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#4: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#4: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#4: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#4: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#4: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#4: uint64 = (itxn GroupIndex) + let txn%%LastLog#4: bytes = (itxn LastLog) + let txn%%LastValid#4: uint64 = (itxn LastValid) + let txn%%Lease#4: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#4: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#4: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#4: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#4: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#4: uint64 = (itxn Nonparticipation) + let txn%%Note#4: bytes = (itxn Note) + let txn%%NumAccounts#4: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#4: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#4: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#4: uint64 = (itxn NumApplications) + let txn%%NumAssets#4: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#4: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#4: uint64 = (itxn NumLogs) + let txn%%OnCompletion#4: uint64 = (itxn OnCompletion) + let txn%%Receiver#4: bytes = (itxn Receiver) + let txn%%RekeyTo#4: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#4: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#4: bytes = (itxn SelectionPK) + let txn%%Sender#4: bytes = (itxn Sender) + let txn%%StateProofPK#4: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#4: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#4: bytes = (itxn TxID) + let txn%%TypeEnum#4: uint64 = (itxn TypeEnum) + let txn%%Type#4: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#4: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#4: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#4: uint64 = (itxn VoteFirst) + let txn%%VotePK#4: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#4: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#4: uint64 = (itxn VoteLast) + let txn%%XferAsset#4: uint64 = (itxn XferAsset) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let inner_txn_params%0%%Accounts_length#0: uint64 = 0u + let inner_txn_params%0%%Amount_length#0: uint64 = 0u + let current_tail_offset%1#0: uint64 = 4u + let encoded_tuple_buffer%2#0: bytes = 0x + let encoded_tuple_buffer%2#1: bytes = (concat encoded_tuple_buffer%2#0 0xde) + let encoded_tuple_buffer%2#2: bytes = (concat encoded_tuple_buffer%2#1 0xad) + let encoded_tuple_buffer%2#3: bytes = (concat encoded_tuple_buffer%2#2 0xbe) + let encoded_tuple_buffer%2#4: bytes = (concat encoded_tuple_buffer%2#3 0xef) + let current_tail_offset%3#0: uint64 = 9u + let encoded_tuple_buffer%4#0: bytes = 0x + let encoded_tuple_buffer%4#1: bytes = (concat encoded_tuple_buffer%4#0 0x0f) + let encoded_tuple_buffer%4#2: bytes = (concat encoded_tuple_buffer%4#1 0x10) + let encoded_tuple_buffer%4#3: bytes = (concat encoded_tuple_buffer%4#2 0x11) + let encoded_tuple_buffer%4#4: bytes = (concat encoded_tuple_buffer%4#3 0x12) + let encoded_tuple_buffer%4#5: bytes = (concat encoded_tuple_buffer%4#4 encoded_tuple_buffer%2#4) + let encoded_tuple_buffer%4#6: bytes = (concat encoded_tuple_buffer%4#5 0x14) + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = 0x0000000000000001 + let inner_txn_params%0%%param_ApplicationArgs_idx_2#0: bytes = 0x0000000000000002 + let inner_txn_params%0%%param_ApplicationArgs_idx_3#0: bytes = 0x0000000000000003 + let inner_txn_params%0%%param_ApplicationArgs_idx_4#0: bytes = 0x0000000000000004 + let inner_txn_params%0%%param_ApplicationArgs_idx_5#0: bytes = 0x0000000000000005 + let inner_txn_params%0%%param_ApplicationArgs_idx_6#0: bytes = 0x0000000000000006 + let inner_txn_params%0%%param_ApplicationArgs_idx_7#0: bytes = 0x0000000000000007 + let inner_txn_params%0%%param_ApplicationArgs_idx_8#0: bytes = 0x0000000000000008 + let inner_txn_params%0%%param_ApplicationArgs_idx_9#0: bytes = 0x0000000000000009 + let inner_txn_params%0%%param_ApplicationArgs_idx_10#0: bytes = 0x000000000000000a + let inner_txn_params%0%%param_ApplicationArgs_idx_11#0: bytes = 0x000000000000000b + let inner_txn_params%0%%param_ApplicationArgs_idx_12#0: bytes = 0x000000000000000c + let inner_txn_params%0%%param_ApplicationArgs_idx_13#0: bytes = 0x000000000000000d + let inner_txn_params%0%%param_ApplicationArgs_idx_14#0: bytes = 0x000000000000000e + let inner_txn_params%0%%param_ApplicationArgs_idx_15#0: bytes = encoded_tuple_buffer%4#6 + let inner_txn_params%0%%ApplicationArgs_length#0: uint64 = 16u + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%0%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%Applications_length#0: uint64 = 0u + let inner_txn_params%0%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%0%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%0%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%0%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%0%%Assets_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%Fee_length#0: uint64 = 1u + let inner_txn_params%0%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%0%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%0%%Note_length#0: uint64 = 0u + let inner_txn_params%0%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%0%%Receiver_length#0: uint64 = 0u + let inner_txn_params%0%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%0%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%0%%Sender_length#0: uint64 = 0u + let inner_txn_params%0%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%0%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%0%%Type_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%0%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%0%%VotePK_length#0: uint64 = 0u + let inner_txn_params%0%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%0%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%0%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_2#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_3#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_4#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_5#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_6#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_7#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_8#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_9#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_10#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_11#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_12#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_13#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_14#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_15#0) + goto block@1 + block@1: // next_txn_L39 + itxn_submit + let %%inner_txn_submit_id#0: uint64 = 1u + let tmp_itxn_0%%Amount#0: uint64 = (itxn Amount) + let tmp_itxn_0%%ApplicationID#0: uint64 = (itxn ApplicationID) + let tmp_itxn_0%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let tmp_itxn_0%%AssetAmount#0: uint64 = (itxn AssetAmount) + let tmp_itxn_0%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let tmp_itxn_0%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let tmp_itxn_0%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let tmp_itxn_0%%AssetSender#0: bytes = (itxn AssetSender) + let tmp_itxn_0%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let tmp_itxn_0%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let tmp_itxn_0%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let tmp_itxn_0%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let tmp_itxn_0%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let tmp_itxn_0%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let tmp_itxn_0%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let tmp_itxn_0%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let tmp_itxn_0%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let tmp_itxn_0%%Fee#0: uint64 = (itxn Fee) + let tmp_itxn_0%%FirstValid#0: uint64 = (itxn FirstValid) + let tmp_itxn_0%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let tmp_itxn_0%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let tmp_itxn_0%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let tmp_itxn_0%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let tmp_itxn_0%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let tmp_itxn_0%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let tmp_itxn_0%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let tmp_itxn_0%%GroupIndex#0: uint64 = (itxn GroupIndex) + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let tmp_itxn_0%%LastValid#0: uint64 = (itxn LastValid) + let tmp_itxn_0%%Lease#0: bytes = (itxn Lease) + let tmp_itxn_0%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let tmp_itxn_0%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let tmp_itxn_0%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let tmp_itxn_0%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let tmp_itxn_0%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let tmp_itxn_0%%Note#0: bytes = (itxn Note) + let tmp_itxn_0%%NumAccounts#0: uint64 = (itxn NumAccounts) + let tmp_itxn_0%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let tmp_itxn_0%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let tmp_itxn_0%%NumApplications#0: uint64 = (itxn NumApplications) + let tmp_itxn_0%%NumAssets#0: uint64 = (itxn NumAssets) + let tmp_itxn_0%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let tmp_itxn_0%%NumLogs#0: uint64 = (itxn NumLogs) + let tmp_itxn_0%%OnCompletion#0: uint64 = (itxn OnCompletion) + let tmp_itxn_0%%Receiver#0: bytes = (itxn Receiver) + let tmp_itxn_0%%RekeyTo#0: bytes = (itxn RekeyTo) + let tmp_itxn_0%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let tmp_itxn_0%%SelectionPK#0: bytes = (itxn SelectionPK) + let tmp_itxn_0%%Sender#0: bytes = (itxn Sender) + let tmp_itxn_0%%StateProofPK#0: bytes = (itxn StateProofPK) + let tmp_itxn_0%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let tmp_itxn_0%%TxID#0: bytes = (itxn TxID) + let tmp_itxn_0%%TypeEnum#0: uint64 = (itxn TypeEnum) + let tmp_itxn_0%%Type#0: bytes = (itxn Type) + let tmp_itxn_0%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let tmp_itxn_0%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let tmp_itxn_0%%VoteFirst#0: uint64 = (itxn VoteFirst) + let tmp_itxn_0%%VotePK#0: bytes = (itxn VotePK) + let tmp_itxn_0%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let tmp_itxn_0%%VoteLast#0: uint64 = (itxn VoteLast) + let tmp_itxn_0%%XferAsset#0: uint64 = (itxn XferAsset) + let awst_tmp%5#0: bytes = tmp_itxn_0%%LastLog#0 + let tmp%6#0: bytes = ((extract 4 0) awst_tmp%5#0) + let tmp%7#0: bytes = ((extract 0 4) awst_tmp%5#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + let (value%9#0: bytes, check%10#0: uint64) = (tmp%6#0, tmp%8#0) + (assert check%10#0) // ARC4 prefix is valid + let result#0: bytes = value%9#0 + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + let inner_txn_params%0%%Accounts_length#0: uint64 = 0u + let inner_txn_params%0%%Amount_length#0: uint64 = 0u + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World1" + let inner_txn_params%0%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%0%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%Applications_length#0: uint64 = 0u + let inner_txn_params%0%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%0%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%0%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%0%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%0%%Assets_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%Fee_length#0: uint64 = 1u + let inner_txn_params%0%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%0%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%0%%Note_length#0: uint64 = 0u + let inner_txn_params%0%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%0%%Receiver_length#0: uint64 = 0u + let inner_txn_params%0%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%0%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%0%%Sender_length#0: uint64 = 0u + let inner_txn_params%0%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%0%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%0%%Type_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%0%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%0%%VotePK_length#0: uint64 = 0u + let inner_txn_params%0%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%0%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%0%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + goto block@1 + block@1: // next_txn_L68 + itxn_submit + let %%inner_txn_submit_id#0: uint64 = 1u + let txn%%Amount#0: uint64 = (itxn Amount) + let txn%%ApplicationID#0: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#0: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let txn%%AssetSender#0: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#0: uint64 = (itxn Fee) + let txn%%FirstValid#0: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#0: uint64 = (itxn GroupIndex) + let txn%%LastLog#0: bytes = (itxn LastLog) + let txn%%LastValid#0: uint64 = (itxn LastValid) + let txn%%Lease#0: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let txn%%Note#0: bytes = (itxn Note) + let txn%%NumAccounts#0: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#0: uint64 = (itxn NumApplications) + let txn%%NumAssets#0: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#0: uint64 = (itxn NumLogs) + let txn%%OnCompletion#0: uint64 = (itxn OnCompletion) + let txn%%Receiver#0: bytes = (itxn Receiver) + let txn%%RekeyTo#0: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#0: bytes = (itxn SelectionPK) + let txn%%Sender#0: bytes = (itxn Sender) + let txn%%StateProofPK#0: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#0: bytes = (itxn TxID) + let txn%%TypeEnum#0: uint64 = (itxn TypeEnum) + let txn%%Type#0: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#0: uint64 = (itxn VoteFirst) + let txn%%VotePK#0: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#0: uint64 = (itxn VoteLast) + let txn%%XferAsset#0: uint64 = (itxn XferAsset) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + let inner_txn_params%2%%Accounts_length#0: uint64 = 0u + let inner_txn_params%2%%Amount_length#0: uint64 = 0u + let inner_txn_params%2%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%2%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World2" + let inner_txn_params%2%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%2%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%2%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%2%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%2%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%2%%Applications_length#0: uint64 = 0u + let inner_txn_params%2%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%2%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%2%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%2%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%2%%Assets_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%2%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%2%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%2%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%2%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%2%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%2%%Fee_length#0: uint64 = 1u + let inner_txn_params%2%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%2%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%2%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%2%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%2%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%2%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%2%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%2%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%2%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%2%%Note_length#0: uint64 = 0u + let inner_txn_params%2%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%2%%Receiver_length#0: uint64 = 0u + let inner_txn_params%2%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%2%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%2%%Sender_length#0: uint64 = 0u + let inner_txn_params%2%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%2%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%2%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%2%%Type_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%2%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%2%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%2%%VotePK_length#0: uint64 = 0u + let inner_txn_params%2%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%2%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%2%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%2%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%2%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%2%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_1#0) + goto block@2 + block@2: // next_txn_L71 + itxn_submit + let %%inner_txn_submit_id#1: uint64 = 2u + let txn%%Amount#1: uint64 = (itxn Amount) + let txn%%ApplicationID#1: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#1: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#1: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#1: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#1: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#1: bytes = (itxn AssetReceiver) + let txn%%AssetSender#1: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#1: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#1: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#1: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#1: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#1: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#1: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#1: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#1: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#1: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#1: uint64 = (itxn Fee) + let txn%%FirstValid#1: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#1: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#1: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#1: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#1: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#1: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#1: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#1: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#1: uint64 = (itxn GroupIndex) + let txn%%LastLog#1: bytes = (itxn LastLog) + let txn%%LastValid#1: uint64 = (itxn LastValid) + let txn%%Lease#1: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#1: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#1: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#1: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#1: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#1: uint64 = (itxn Nonparticipation) + let txn%%Note#1: bytes = (itxn Note) + let txn%%NumAccounts#1: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#1: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#1: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#1: uint64 = (itxn NumApplications) + let txn%%NumAssets#1: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#1: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#1: uint64 = (itxn NumLogs) + let txn%%OnCompletion#1: uint64 = (itxn OnCompletion) + let txn%%Receiver#1: bytes = (itxn Receiver) + let txn%%RekeyTo#1: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#1: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#1: bytes = (itxn SelectionPK) + let txn%%Sender#1: bytes = (itxn Sender) + let txn%%StateProofPK#1: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#1: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#1: bytes = (itxn TxID) + let txn%%TypeEnum#1: uint64 = (itxn TypeEnum) + let txn%%Type#1: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#1: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#1: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#1: uint64 = (itxn VoteFirst) + let txn%%VotePK#1: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#1: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#1: uint64 = (itxn VoteLast) + let txn%%XferAsset#1: uint64 = (itxn XferAsset) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + let inner_txn_params%4%%Accounts_length#0: uint64 = 0u + let inner_txn_params%4%%Amount_length#0: uint64 = 0u + let inner_txn_params%4%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%4%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World3" + let inner_txn_params%4%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%4%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%4%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%4%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%4%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%4%%Applications_length#0: uint64 = 0u + let inner_txn_params%4%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%4%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%4%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%4%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%4%%Assets_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%4%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%4%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%4%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%4%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%4%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%4%%Fee_length#0: uint64 = 1u + let inner_txn_params%4%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%4%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%4%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%4%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%4%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%4%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%4%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%4%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%4%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%4%%Note_length#0: uint64 = 0u + let inner_txn_params%4%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%4%%Receiver_length#0: uint64 = 0u + let inner_txn_params%4%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%4%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%4%%Sender_length#0: uint64 = 0u + let inner_txn_params%4%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%4%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%4%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%4%%Type_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%4%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%4%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%4%%VotePK_length#0: uint64 = 0u + let inner_txn_params%4%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%4%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%4%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%4%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%4%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%4%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%4%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%4%%param_ApplicationArgs_idx_1#0) + goto block@3 + block@3: // next_txn_L74 + itxn_submit + let %%inner_txn_submit_id#2: uint64 = 3u + let txn%%Amount#2: uint64 = (itxn Amount) + let txn%%ApplicationID#2: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#2: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#2: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#2: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#2: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#2: bytes = (itxn AssetReceiver) + let txn%%AssetSender#2: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#2: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#2: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#2: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#2: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#2: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#2: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#2: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#2: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#2: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#2: uint64 = (itxn Fee) + let txn%%FirstValid#2: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#2: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#2: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#2: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#2: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#2: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#2: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#2: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#2: uint64 = (itxn GroupIndex) + let txn%%LastLog#2: bytes = (itxn LastLog) + let txn%%LastValid#2: uint64 = (itxn LastValid) + let txn%%Lease#2: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#2: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#2: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#2: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#2: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#2: uint64 = (itxn Nonparticipation) + let txn%%Note#2: bytes = (itxn Note) + let txn%%NumAccounts#2: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#2: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#2: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#2: uint64 = (itxn NumApplications) + let txn%%NumAssets#2: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#2: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#2: uint64 = (itxn NumLogs) + let txn%%OnCompletion#2: uint64 = (itxn OnCompletion) + let txn%%Receiver#2: bytes = (itxn Receiver) + let txn%%RekeyTo#2: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#2: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#2: bytes = (itxn SelectionPK) + let txn%%Sender#2: bytes = (itxn Sender) + let txn%%StateProofPK#2: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#2: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#2: bytes = (itxn TxID) + let txn%%TypeEnum#2: uint64 = (itxn TypeEnum) + let txn%%Type#2: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#2: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#2: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#2: uint64 = (itxn VoteFirst) + let txn%%VotePK#2: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#2: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#2: uint64 = (itxn VoteLast) + let txn%%XferAsset#2: uint64 = (itxn XferAsset) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + let inner_txn_params%6%%Accounts_length#0: uint64 = 0u + let inner_txn_params%6%%Amount_length#0: uint64 = 0u + let inner_txn_params%6%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%6%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World4" + let inner_txn_params%6%%ApplicationArgs_length#0: uint64 = 2u + let inner_txn_params%6%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%6%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%6%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%6%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%6%%Applications_length#0: uint64 = 0u + let inner_txn_params%6%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%6%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%6%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%6%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%6%%Assets_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%6%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%6%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%6%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%6%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%6%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%6%%Fee_length#0: uint64 = 1u + let inner_txn_params%6%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%6%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%6%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%6%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%6%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%6%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%6%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%6%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%6%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%6%%Note_length#0: uint64 = 0u + let inner_txn_params%6%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%6%%Receiver_length#0: uint64 = 0u + let inner_txn_params%6%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%6%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%6%%Sender_length#0: uint64 = 0u + let inner_txn_params%6%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%6%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%6%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%6%%Type_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%6%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%6%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%6%%VotePK_length#0: uint64 = 0u + let inner_txn_params%6%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%6%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%6%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%6%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%6%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%6%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%6%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%6%%param_ApplicationArgs_idx_1#0) + goto block@4 + block@4: // next_txn_L77 + itxn_submit + let %%inner_txn_submit_id#3: uint64 = 4u + let txn%%Amount#3: uint64 = (itxn Amount) + let txn%%ApplicationID#3: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#3: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#3: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#3: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#3: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#3: bytes = (itxn AssetReceiver) + let txn%%AssetSender#3: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#3: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#3: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#3: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#3: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#3: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#3: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#3: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#3: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#3: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#3: uint64 = (itxn Fee) + let txn%%FirstValid#3: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#3: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#3: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#3: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#3: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#3: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#3: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#3: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#3: uint64 = (itxn GroupIndex) + let txn%%LastLog#3: bytes = (itxn LastLog) + let txn%%LastValid#3: uint64 = (itxn LastValid) + let txn%%Lease#3: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#3: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#3: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#3: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#3: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#3: uint64 = (itxn Nonparticipation) + let txn%%Note#3: bytes = (itxn Note) + let txn%%NumAccounts#3: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#3: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#3: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#3: uint64 = (itxn NumApplications) + let txn%%NumAssets#3: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#3: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#3: uint64 = (itxn NumLogs) + let txn%%OnCompletion#3: uint64 = (itxn OnCompletion) + let txn%%Receiver#3: bytes = (itxn Receiver) + let txn%%RekeyTo#3: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#3: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#3: bytes = (itxn SelectionPK) + let txn%%Sender#3: bytes = (itxn Sender) + let txn%%StateProofPK#3: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#3: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#3: bytes = (itxn TxID) + let txn%%TypeEnum#3: uint64 = (itxn TypeEnum) + let txn%%Type#3: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#3: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#3: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#3: uint64 = (itxn VoteFirst) + let txn%%VotePK#3: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#3: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#3: uint64 = (itxn VoteLast) + let txn%%XferAsset#3: uint64 = (itxn XferAsset) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let inner_txn_params%0%%param_Accounts_idx_0#0: bytes = tmp%1#0 + let inner_txn_params%0%%Accounts_length#0: uint64 = 1u + let inner_txn_params%0%%Amount_length#0: uint64 = 0u + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "log_asset_account_app(asset,account,application)void" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = 0x00 + let inner_txn_params%0%%param_ApplicationArgs_idx_2#0: bytes = 0x01 + let inner_txn_params%0%%param_ApplicationArgs_idx_3#0: bytes = 0x01 + let inner_txn_params%0%%ApplicationArgs_length#0: uint64 = 4u + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%ApplicationID_length#0: uint64 = 1u + let inner_txn_params%0%%ApprovalProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ApprovalProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%param_Applications_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%Applications_length#0: uint64 = 1u + let inner_txn_params%0%%AssetAmount_length#0: uint64 = 0u + let inner_txn_params%0%%AssetCloseTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetName_length#0: uint64 = 0u + let inner_txn_params%0%%AssetReceiver_length#0: uint64 = 0u + let inner_txn_params%0%%AssetSender_length#0: uint64 = 0u + let inner_txn_params%0%%param_Assets_idx_0#0: uint64 = asset#0 + let inner_txn_params%0%%Assets_length#0: uint64 = 1u + let inner_txn_params%0%%ConfigAssetClawback_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgram_length#0: uint64 = 0u + let inner_txn_params%0%%ClearStateProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%CloseRemainderTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAsset_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDecimals_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%ExtraProgramPages_length#0: uint64 = 0u + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%Fee_length#0: uint64 = 1u + let inner_txn_params%0%%ConfigAssetFreeze_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetAccount_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAsset_length#0: uint64 = 0u + let inner_txn_params%0%%FreezeAssetFrozen_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%GlobalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumByteSlice_length#0: uint64 = 0u + let inner_txn_params%0%%LocalNumUint_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetManager_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetMetadataHash_length#0: uint64 = 0u + let inner_txn_params%0%%Nonparticipation_length#0: uint64 = 0u + let inner_txn_params%0%%Note_length#0: uint64 = 0u + let inner_txn_params%0%%OnCompletion_length#0: uint64 = 0u + let inner_txn_params%0%%Receiver_length#0: uint64 = 0u + let inner_txn_params%0%%RekeyTo_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetReserve_length#0: uint64 = 0u + let inner_txn_params%0%%SelectionPK_length#0: uint64 = 0u + let inner_txn_params%0%%Sender_length#0: uint64 = 0u + let inner_txn_params%0%%StateProofPK_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetTotal_length#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + let inner_txn_params%0%%TypeEnum_length#0: uint64 = 1u + let inner_txn_params%0%%Type_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetUnitName_length#0: uint64 = 0u + let inner_txn_params%0%%ConfigAssetURL_length#0: uint64 = 0u + let inner_txn_params%0%%VoteFirst_length#0: uint64 = 0u + let inner_txn_params%0%%VotePK_length#0: uint64 = 0u + let inner_txn_params%0%%VoteKeyDilution_length#0: uint64 = 0u + let inner_txn_params%0%%VoteLast_length#0: uint64 = 0u + let inner_txn_params%0%%XferAsset_length#0: uint64 = 0u + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field Assets) inner_txn_params%0%%param_Assets_idx_0#0) + ((itxn_field Applications) inner_txn_params%0%%param_Applications_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_2#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_3#0) + ((itxn_field Accounts) inner_txn_params%0%%param_Accounts_idx_0#0) + goto block@1 + block@1: // next_txn_L82 + itxn_submit + let %%inner_txn_submit_id#0: uint64 = 1u + let txn%%Amount#0: uint64 = (itxn Amount) + let txn%%ApplicationID#0: uint64 = (itxn ApplicationID) + let txn%%ApprovalProgram#0: bytes = (itxn ApprovalProgram) + let txn%%AssetAmount#0: uint64 = (itxn AssetAmount) + let txn%%AssetCloseTo#0: bytes = (itxn AssetCloseTo) + let txn%%ConfigAssetName#0: bytes = (itxn ConfigAssetName) + let txn%%AssetReceiver#0: bytes = (itxn AssetReceiver) + let txn%%AssetSender#0: bytes = (itxn AssetSender) + let txn%%ConfigAssetClawback#0: bytes = (itxn ConfigAssetClawback) + let txn%%ClearStateProgram#0: bytes = (itxn ClearStateProgram) + let txn%%CloseRemainderTo#0: bytes = (itxn CloseRemainderTo) + let txn%%ConfigAsset#0: uint64 = (itxn ConfigAsset) + let txn%%CreatedApplicationID#0: uint64 = (itxn CreatedApplicationID) + let txn%%CreatedAssetID#0: uint64 = (itxn CreatedAssetID) + let txn%%ConfigAssetDecimals#0: uint64 = (itxn ConfigAssetDecimals) + let txn%%ConfigAssetDefaultFrozen#0: uint64 = (itxn ConfigAssetDefaultFrozen) + let txn%%ExtraProgramPages#0: uint64 = (itxn ExtraProgramPages) + let txn%%Fee#0: uint64 = (itxn Fee) + let txn%%FirstValid#0: uint64 = (itxn FirstValid) + let txn%%FirstValidTime#0: uint64 = (itxn FirstValidTime) + let txn%%ConfigAssetFreeze#0: bytes = (itxn ConfigAssetFreeze) + let txn%%FreezeAssetAccount#0: bytes = (itxn FreezeAssetAccount) + let txn%%FreezeAsset#0: uint64 = (itxn FreezeAsset) + let txn%%FreezeAssetFrozen#0: uint64 = (itxn FreezeAssetFrozen) + let txn%%GlobalNumByteSlice#0: uint64 = (itxn GlobalNumByteSlice) + let txn%%GlobalNumUint#0: uint64 = (itxn GlobalNumUint) + let txn%%GroupIndex#0: uint64 = (itxn GroupIndex) + let txn%%LastLog#0: bytes = (itxn LastLog) + let txn%%LastValid#0: uint64 = (itxn LastValid) + let txn%%Lease#0: bytes = (itxn Lease) + let txn%%LocalNumByteSlice#0: uint64 = (itxn LocalNumByteSlice) + let txn%%LocalNumUint#0: uint64 = (itxn LocalNumUint) + let txn%%ConfigAssetManager#0: bytes = (itxn ConfigAssetManager) + let txn%%ConfigAssetMetadataHash#0: bytes = (itxn ConfigAssetMetadataHash) + let txn%%Nonparticipation#0: uint64 = (itxn Nonparticipation) + let txn%%Note#0: bytes = (itxn Note) + let txn%%NumAccounts#0: uint64 = (itxn NumAccounts) + let txn%%NumAppArgs#0: uint64 = (itxn NumAppArgs) + let txn%%NumApprovalProgramPages#0: uint64 = (itxn NumApprovalProgramPages) + let txn%%NumApplications#0: uint64 = (itxn NumApplications) + let txn%%NumAssets#0: uint64 = (itxn NumAssets) + let txn%%NumClearStateProgramPages#0: uint64 = (itxn NumClearStateProgramPages) + let txn%%NumLogs#0: uint64 = (itxn NumLogs) + let txn%%OnCompletion#0: uint64 = (itxn OnCompletion) + let txn%%Receiver#0: bytes = (itxn Receiver) + let txn%%RekeyTo#0: bytes = (itxn RekeyTo) + let txn%%ConfigAssetReserve#0: bytes = (itxn ConfigAssetReserve) + let txn%%SelectionPK#0: bytes = (itxn SelectionPK) + let txn%%Sender#0: bytes = (itxn Sender) + let txn%%StateProofPK#0: bytes = (itxn StateProofPK) + let txn%%ConfigAssetTotal#0: uint64 = (itxn ConfigAssetTotal) + let txn%%TxID#0: bytes = (itxn TxID) + let txn%%TypeEnum#0: uint64 = (itxn TypeEnum) + let txn%%Type#0: bytes = (itxn Type) + let txn%%ConfigAssetUnitName#0: bytes = (itxn ConfigAssetUnitName) + let txn%%ConfigAssetURL#0: bytes = (itxn ConfigAssetURL) + let txn%%VoteFirst#0: uint64 = (itxn VoteFirst) + let txn%%VotePK#0: bytes = (itxn VotePK) + let txn%%VoteKeyDilution#0: uint64 = (itxn VoteKeyDilution) + let txn%%VoteLast#0: uint64 = (itxn VoteLast) + let txn%%XferAsset#0: uint64 = (itxn XferAsset) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_1.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..84dd6abc7e --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_1.ir @@ -0,0 +1,325 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%8#0: bytes = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + let tmp%9#0: uint64 = (== txn%%LastLog#2 tmp%8#0) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + let tmp%13#0: any = 0x80 + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) tmp%13#0) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%2#1: bytes = 0xde + let encoded_tuple_buffer%2#2: bytes = (concat encoded_tuple_buffer%2#1 0xad) + let encoded_tuple_buffer%2#3: bytes = (concat encoded_tuple_buffer%2#2 0xbe) + let encoded_tuple_buffer%2#4: bytes = (concat encoded_tuple_buffer%2#3 0xef) + let encoded_tuple_buffer%4#1: bytes = 0x0f + let encoded_tuple_buffer%4#2: bytes = (concat encoded_tuple_buffer%4#1 0x10) + let encoded_tuple_buffer%4#3: bytes = (concat encoded_tuple_buffer%4#2 0x11) + let encoded_tuple_buffer%4#4: bytes = (concat encoded_tuple_buffer%4#3 0x12) + let encoded_tuple_buffer%4#5: bytes = (concat encoded_tuple_buffer%4#4 encoded_tuple_buffer%2#4) + let encoded_tuple_buffer%4#6: bytes = (concat encoded_tuple_buffer%4#5 0x14) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) encoded_tuple_buffer%4#6) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_2.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..1e20dc8918 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_2.ir @@ -0,0 +1,321 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#2 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%2#2: bytes = 0xdead + let encoded_tuple_buffer%2#3: bytes = (concat encoded_tuple_buffer%2#2 0xbe) + let encoded_tuple_buffer%2#4: bytes = (concat encoded_tuple_buffer%2#3 0xef) + let encoded_tuple_buffer%4#2: bytes = 0x0f10 + let encoded_tuple_buffer%4#3: bytes = (concat encoded_tuple_buffer%4#2 0x11) + let encoded_tuple_buffer%4#4: bytes = (concat encoded_tuple_buffer%4#3 0x12) + let encoded_tuple_buffer%4#5: bytes = (concat encoded_tuple_buffer%4#4 encoded_tuple_buffer%2#4) + let encoded_tuple_buffer%4#6: bytes = (concat encoded_tuple_buffer%4#5 0x14) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) encoded_tuple_buffer%4#6) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_3.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..e166f4bc62 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_3.ir @@ -0,0 +1,319 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#2 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%2#3: bytes = 0xdeadbe + let encoded_tuple_buffer%2#4: bytes = (concat encoded_tuple_buffer%2#3 0xef) + let encoded_tuple_buffer%4#3: bytes = 0x0f1011 + let encoded_tuple_buffer%4#4: bytes = (concat encoded_tuple_buffer%4#3 0x12) + let encoded_tuple_buffer%4#5: bytes = (concat encoded_tuple_buffer%4#4 encoded_tuple_buffer%2#4) + let encoded_tuple_buffer%4#6: bytes = (concat encoded_tuple_buffer%4#5 0x14) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) encoded_tuple_buffer%4#6) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_4.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..d138610773 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_4.ir @@ -0,0 +1,317 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#2 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%2#4: bytes = 0xdeadbeef + let encoded_tuple_buffer%4#4: bytes = 0x0f101112 + let encoded_tuple_buffer%4#5: bytes = (concat encoded_tuple_buffer%4#4 encoded_tuple_buffer%2#4) + let encoded_tuple_buffer%4#6: bytes = (concat encoded_tuple_buffer%4#5 0x14) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) encoded_tuple_buffer%4#6) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_5.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..acde8242e7 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_5.ir @@ -0,0 +1,315 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#2 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%4#5: bytes = 0x0f101112deadbeef + let encoded_tuple_buffer%4#6: bytes = (concat encoded_tuple_buffer%4#5 0x14) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) encoded_tuple_buffer%4#6) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_6.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..8e9b1bb6d2 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_6.ir @@ -0,0 +1,314 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#2 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%4#6: bytes = 0x0f101112deadbeef14 + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) encoded_tuple_buffer%4#6) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_7.ir b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_7.ir new file mode 100644 index 0000000000..76bab81515 --- /dev/null +++ b/test_cases/typed_abi_call/out/Greeter.ssa.opt_pass_7.ir @@ -0,0 +1,313 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#1: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#1 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#2: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#2 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#3: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#3 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#4: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#4 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#1 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#2 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#3 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#4: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#4 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) 0x0f101112deadbeef14) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#1: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#1 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#2: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#2 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#3: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#3 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Logger.approval.mir b/test_cases/typed_abi_call/out/Logger.approval.mir new file mode 100644 index 0000000000..c96771e363 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.approval.mir @@ -0,0 +1,508 @@ +// Op // Op Description Stack (out) Live (out) X stack Source code Source line + +#pragma version 10 + +// test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%0#0 to l-stack (no copy) tmp%0#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%0#0 from l-stack (no copy) tmp%0#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + bz main_bare_routing@12 // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // Implicit fall through to main_abi_routing@1 // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + +main_abi_routing@1: + txna ApplicationArgs 0 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%1#0 to l-stack (no copy) tmp%1#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "echo(string)string" // tmp%1#0,method<"echo(string)string"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "log_uint64(uint64)void" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "log_uint512(uint512)void" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "log_string(string)void" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void">,method<"log_string(string)void"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "log_bool(bool)void" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void">,method<"log_string(string)void">,method<"log_bool(bool)void"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "log_bytes(byte[])void" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void">,method<"log_string(string)void">,method<"log_bool(bool)void">,method<"log_bytes(byte[])void"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "log_asset_account_app(asset,account,application)void" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void">,method<"log_string(string)void">,method<"log_bool(bool)void">,method<"log_bytes(byte[])void">,method<"log_asset_account_app(asset,account,application)void"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" // tmp%1#0,method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void">,method<"log_string(string)void">,method<"log_bool(bool)void">,method<"log_bytes(byte[])void">,method<"log_asset_account_app(asset,account,application)void">,method<"return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]"> class Logger(ARC4Contract): typed_abi_call/logger.py:6 + uncover 8 // load tmp%1#0 from l-stack (no copy) method<"echo(string)string">,method<"log_uint64(uint64)void">,method<"log_uint512(uint512)void">,method<"log_string(string)void">,method<"log_bool(bool)void">,method<"log_bytes(byte[])void">,method<"log_asset_account_app(asset,account,application)void">,method<"return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]">,tmp%1#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + match main_echo_route@2 main_log_uint64_route@3 main_log_uint512_route@4 main_log_string_route@5 main_log_bool_route@6 main_log_bytes_route@7 main_log_asset_account_app_route@8 main_return_args_after_14th_route@9 // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + err // reject transaction // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + +main_echo_route@2: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:7 + // virtual: store tmp%2#0 to l-stack (no copy) tmp%2#0 arc4.abimethod typed_abi_call/logger.py:7 + // virtual: load tmp%2#0 from l-stack (no copy) tmp%2#0 arc4.abimethod typed_abi_call/logger.py:7 + ! // {!} arc4.abimethod typed_abi_call/logger.py:7 + // virtual: store tmp%3#0 to l-stack (no copy) tmp%3#0 arc4.abimethod typed_abi_call/logger.py:7 + // virtual: load tmp%3#0 from l-stack (no copy) tmp%3#0 arc4.abimethod typed_abi_call/logger.py:7 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:7 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:7 + // virtual: store tmp%4#0 to l-stack (no copy) tmp%4#0 arc4.abimethod typed_abi_call/logger.py:7 + // virtual: load tmp%4#0 from l-stack (no copy) tmp%4#0 arc4.abimethod typed_abi_call/logger.py:7 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:7 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%5#0 to l-stack (no copy) tmp%5#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%5#0 from l-stack (no copy) tmp%5#0 arc4.abimethod typed_abi_call/logger.py:7 + callsub echo // {echo} arc4.abimethod typed_abi_call/logger.py:7 + // virtual: store tmp%6#0 to l-stack (no copy) tmp%6#0 arc4.abimethod typed_abi_call/logger.py:7 + byte 0x151f7c75 // tmp%6#0,0x151f7c75 arc4.abimethod typed_abi_call/logger.py:7 + swap // load tmp%6#0 from l-stack (no copy) 0x151f7c75,tmp%6#0 arc4.abimethod typed_abi_call/logger.py:7 + concat // {concat} arc4.abimethod typed_abi_call/logger.py:7 + // virtual: store tmp%7#0 to l-stack (no copy) tmp%7#0 arc4.abimethod typed_abi_call/logger.py:7 + // virtual: load tmp%7#0 from l-stack (no copy) tmp%7#0 arc4.abimethod typed_abi_call/logger.py:7 + log // arc4.abimethod typed_abi_call/logger.py:7 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:7 + return // arc4.abimethod typed_abi_call/logger.py:7 + +main_log_uint64_route@3: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:11 + // virtual: store tmp%8#0 to l-stack (no copy) tmp%8#0 arc4.abimethod typed_abi_call/logger.py:11 + // virtual: load tmp%8#0 from l-stack (no copy) tmp%8#0 arc4.abimethod typed_abi_call/logger.py:11 + ! // {!} arc4.abimethod typed_abi_call/logger.py:11 + // virtual: store tmp%9#0 to l-stack (no copy) tmp%9#0 arc4.abimethod typed_abi_call/logger.py:11 + // virtual: load tmp%9#0 from l-stack (no copy) tmp%9#0 arc4.abimethod typed_abi_call/logger.py:11 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:11 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:11 + // virtual: store tmp%10#0 to l-stack (no copy) tmp%10#0 arc4.abimethod typed_abi_call/logger.py:11 + // virtual: load tmp%10#0 from l-stack (no copy) tmp%10#0 arc4.abimethod typed_abi_call/logger.py:11 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:11 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%11#0 to l-stack (no copy) tmp%11#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%11#0 from l-stack (no copy) tmp%11#0 arc4.abimethod typed_abi_call/logger.py:11 + callsub log_uint64 // arc4.abimethod typed_abi_call/logger.py:11 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:11 + return // arc4.abimethod typed_abi_call/logger.py:11 + +main_log_uint512_route@4: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:15 + // virtual: store tmp%12#0 to l-stack (no copy) tmp%12#0 arc4.abimethod typed_abi_call/logger.py:15 + // virtual: load tmp%12#0 from l-stack (no copy) tmp%12#0 arc4.abimethod typed_abi_call/logger.py:15 + ! // {!} arc4.abimethod typed_abi_call/logger.py:15 + // virtual: store tmp%13#0 to l-stack (no copy) tmp%13#0 arc4.abimethod typed_abi_call/logger.py:15 + // virtual: load tmp%13#0 from l-stack (no copy) tmp%13#0 arc4.abimethod typed_abi_call/logger.py:15 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:15 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:15 + // virtual: store tmp%14#0 to l-stack (no copy) tmp%14#0 arc4.abimethod typed_abi_call/logger.py:15 + // virtual: load tmp%14#0 from l-stack (no copy) tmp%14#0 arc4.abimethod typed_abi_call/logger.py:15 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:15 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%15#0 to l-stack (no copy) tmp%15#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%15#0 from l-stack (no copy) tmp%15#0 arc4.abimethod typed_abi_call/logger.py:15 + callsub log_uint512 // arc4.abimethod typed_abi_call/logger.py:15 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:15 + return // arc4.abimethod typed_abi_call/logger.py:15 + +main_log_string_route@5: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:19 + // virtual: store tmp%16#0 to l-stack (no copy) tmp%16#0 arc4.abimethod typed_abi_call/logger.py:19 + // virtual: load tmp%16#0 from l-stack (no copy) tmp%16#0 arc4.abimethod typed_abi_call/logger.py:19 + ! // {!} arc4.abimethod typed_abi_call/logger.py:19 + // virtual: store tmp%17#0 to l-stack (no copy) tmp%17#0 arc4.abimethod typed_abi_call/logger.py:19 + // virtual: load tmp%17#0 from l-stack (no copy) tmp%17#0 arc4.abimethod typed_abi_call/logger.py:19 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:19 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:19 + // virtual: store tmp%18#0 to l-stack (no copy) tmp%18#0 arc4.abimethod typed_abi_call/logger.py:19 + // virtual: load tmp%18#0 from l-stack (no copy) tmp%18#0 arc4.abimethod typed_abi_call/logger.py:19 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:19 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%19#0 to l-stack (no copy) tmp%19#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%19#0 from l-stack (no copy) tmp%19#0 arc4.abimethod typed_abi_call/logger.py:19 + callsub log_string // arc4.abimethod typed_abi_call/logger.py:19 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:19 + return // arc4.abimethod typed_abi_call/logger.py:19 + +main_log_bool_route@6: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:23 + // virtual: store tmp%20#0 to l-stack (no copy) tmp%20#0 arc4.abimethod typed_abi_call/logger.py:23 + // virtual: load tmp%20#0 from l-stack (no copy) tmp%20#0 arc4.abimethod typed_abi_call/logger.py:23 + ! // {!} arc4.abimethod typed_abi_call/logger.py:23 + // virtual: store tmp%21#0 to l-stack (no copy) tmp%21#0 arc4.abimethod typed_abi_call/logger.py:23 + // virtual: load tmp%21#0 from l-stack (no copy) tmp%21#0 arc4.abimethod typed_abi_call/logger.py:23 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:23 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:23 + // virtual: store tmp%22#0 to l-stack (no copy) tmp%22#0 arc4.abimethod typed_abi_call/logger.py:23 + // virtual: load tmp%22#0 from l-stack (no copy) tmp%22#0 arc4.abimethod typed_abi_call/logger.py:23 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:23 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%23#0 to l-stack (no copy) tmp%23#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%23#0 from l-stack (no copy) tmp%23#0 arc4.abimethod typed_abi_call/logger.py:23 + callsub log_bool // arc4.abimethod typed_abi_call/logger.py:23 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:23 + return // arc4.abimethod typed_abi_call/logger.py:23 + +main_log_bytes_route@7: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:27 + // virtual: store tmp%24#0 to l-stack (no copy) tmp%24#0 arc4.abimethod typed_abi_call/logger.py:27 + // virtual: load tmp%24#0 from l-stack (no copy) tmp%24#0 arc4.abimethod typed_abi_call/logger.py:27 + ! // {!} arc4.abimethod typed_abi_call/logger.py:27 + // virtual: store tmp%25#0 to l-stack (no copy) tmp%25#0 arc4.abimethod typed_abi_call/logger.py:27 + // virtual: load tmp%25#0 from l-stack (no copy) tmp%25#0 arc4.abimethod typed_abi_call/logger.py:27 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:27 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:27 + // virtual: store tmp%26#0 to l-stack (no copy) tmp%26#0 arc4.abimethod typed_abi_call/logger.py:27 + // virtual: load tmp%26#0 from l-stack (no copy) tmp%26#0 arc4.abimethod typed_abi_call/logger.py:27 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:27 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%27#0 to l-stack (no copy) tmp%27#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%27#0 from l-stack (no copy) tmp%27#0 arc4.abimethod typed_abi_call/logger.py:27 + callsub log_bytes // arc4.abimethod typed_abi_call/logger.py:27 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:27 + return // arc4.abimethod typed_abi_call/logger.py:27 + +main_log_asset_account_app_route@8: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:31 + // virtual: store tmp%28#0 to l-stack (no copy) tmp%28#0 arc4.abimethod typed_abi_call/logger.py:31 + // virtual: load tmp%28#0 from l-stack (no copy) tmp%28#0 arc4.abimethod typed_abi_call/logger.py:31 + ! // {!} arc4.abimethod typed_abi_call/logger.py:31 + // virtual: store tmp%29#0 to l-stack (no copy) tmp%29#0 arc4.abimethod typed_abi_call/logger.py:31 + // virtual: load tmp%29#0 from l-stack (no copy) tmp%29#0 arc4.abimethod typed_abi_call/logger.py:31 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:31 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:31 + // virtual: store tmp%30#0 to l-stack (no copy) tmp%30#0 arc4.abimethod typed_abi_call/logger.py:31 + // virtual: load tmp%30#0 from l-stack (no copy) tmp%30#0 arc4.abimethod typed_abi_call/logger.py:31 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:31 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%31#0 to l-stack (no copy) tmp%31#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%31#0 from l-stack (no copy) tmp%31#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + btoi // {btoi} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%32#0 to l-stack (no copy) tmp%32#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%32#0 from l-stack (no copy) tmp%32#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txnas Assets // {txnas} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%33#0 to l-stack (no copy) tmp%33#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 2 // tmp%33#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%34#0 to l-stack (no copy) tmp%33#0,tmp%34#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%34#0 from l-stack (no copy) tmp%33#0,tmp%34#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + btoi // tmp%33#0,{btoi} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%35#0 to l-stack (no copy) tmp%33#0,tmp%35#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%35#0 from l-stack (no copy) tmp%33#0,tmp%35#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txnas Accounts // tmp%33#0,{txnas} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%36#0 to l-stack (no copy) tmp%33#0,tmp%36#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 3 // tmp%33#0,tmp%36#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%37#0 to l-stack (no copy) tmp%33#0,tmp%36#0,tmp%37#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%37#0 from l-stack (no copy) tmp%33#0,tmp%36#0,tmp%37#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + btoi // tmp%33#0,tmp%36#0,{btoi} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%38#0 to l-stack (no copy) tmp%33#0,tmp%36#0,tmp%38#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%38#0 from l-stack (no copy) tmp%33#0,tmp%36#0,tmp%38#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txnas Applications // tmp%33#0,tmp%36#0,{txnas} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%39#0 to l-stack (no copy) tmp%33#0,tmp%36#0,tmp%39#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + uncover 2 // load tmp%33#0 from l-stack (no copy) tmp%36#0,tmp%39#0,tmp%33#0 arc4.abimethod typed_abi_call/logger.py:31 + uncover 2 // load tmp%36#0 from l-stack (no copy) tmp%39#0,tmp%33#0,tmp%36#0 arc4.abimethod typed_abi_call/logger.py:31 + uncover 2 // load tmp%39#0 from l-stack (no copy) tmp%33#0,tmp%36#0,tmp%39#0 arc4.abimethod typed_abi_call/logger.py:31 + callsub log_asset_account_app // arc4.abimethod typed_abi_call/logger.py:31 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:31 + return // arc4.abimethod typed_abi_call/logger.py:31 + +main_return_args_after_14th_route@9: + txn OnCompletion // {txn} arc4.abimethod typed_abi_call/logger.py:35 + // virtual: store tmp%40#0 to l-stack (no copy) tmp%40#0 arc4.abimethod typed_abi_call/logger.py:35 + // virtual: load tmp%40#0 from l-stack (no copy) tmp%40#0 arc4.abimethod typed_abi_call/logger.py:35 + ! // {!} arc4.abimethod typed_abi_call/logger.py:35 + // virtual: store tmp%41#0 to l-stack (no copy) tmp%41#0 arc4.abimethod typed_abi_call/logger.py:35 + // virtual: load tmp%41#0 from l-stack (no copy) tmp%41#0 arc4.abimethod typed_abi_call/logger.py:35 + assert // OnCompletion is NoOp // arc4.abimethod typed_abi_call/logger.py:35 + txn ApplicationID // {txn} arc4.abimethod typed_abi_call/logger.py:35 + // virtual: store tmp%42#0 to l-stack (no copy) tmp%42#0 arc4.abimethod typed_abi_call/logger.py:35 + // virtual: load tmp%42#0 from l-stack (no copy) tmp%42#0 arc4.abimethod typed_abi_call/logger.py:35 + assert // is not creating // arc4.abimethod typed_abi_call/logger.py:35 + txna ApplicationArgs 1 // {txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%43#0 to l-stack (no copy) tmp%43#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 2 // tmp%43#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%44#0 to l-stack (no copy) tmp%43#0,tmp%44#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 3 // tmp%43#0,tmp%44#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%45#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 4 // tmp%43#0,tmp%44#0,tmp%45#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%46#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 5 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%47#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 6 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%48#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 7 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%49#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 8 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%50#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 9 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%51#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 10 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%52#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 11 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%53#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 12 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%54#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 13 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%55#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 14 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%56#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 15 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%57#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%57#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%57#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%57#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + extract 0 1 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,{extract} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%58#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 15 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%59#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%59#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%59#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%59#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + extract 1 1 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,{extract} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%60#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 15 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%61#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%61#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%61#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%61#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + extract 2 1 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,{extract} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%62#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 15 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%63#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%63#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%63#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%63#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + extract 3 1 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,{extract} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%64#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 15 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%65#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%65#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%65#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%65#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + extract 4 4 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,{extract} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%66#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txna ApplicationArgs 15 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,{txna} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%67#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%67#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%67#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%67#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + extract 8 1 // tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,{extract} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%68#0 to l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + uncover 19 // load tmp%43#0 from l-stack (no copy) tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%44#0 from l-stack (no copy) tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%45#0 from l-stack (no copy) tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%46#0 from l-stack (no copy) tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%47#0 from l-stack (no copy) tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%48#0 from l-stack (no copy) tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%49#0 from l-stack (no copy) tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%50#0 from l-stack (no copy) tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%51#0 from l-stack (no copy) tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%52#0 from l-stack (no copy) tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%53#0 from l-stack (no copy) tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%54#0 from l-stack (no copy) tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%55#0 from l-stack (no copy) tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%56#0 from l-stack (no copy) tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%58#0 from l-stack (no copy) tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%60#0 from l-stack (no copy) tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%62#0 from l-stack (no copy) tmp%64#0,tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%64#0 from l-stack (no copy) tmp%66#0,tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%66#0 from l-stack (no copy) tmp%68#0,tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0 arc4.abimethod typed_abi_call/logger.py:35 + uncover 19 // load tmp%68#0 from l-stack (no copy) tmp%43#0,tmp%44#0,tmp%45#0,tmp%46#0,tmp%47#0,tmp%48#0,tmp%49#0,tmp%50#0,tmp%51#0,tmp%52#0,tmp%53#0,tmp%54#0,tmp%55#0,tmp%56#0,tmp%58#0,tmp%60#0,tmp%62#0,tmp%64#0,tmp%66#0,tmp%68#0 arc4.abimethod typed_abi_call/logger.py:35 + callsub return_args_after_14th // {return_args_after_14th} arc4.abimethod typed_abi_call/logger.py:35 + // virtual: store tmp%69#0 to l-stack (no copy) tmp%69#0 arc4.abimethod typed_abi_call/logger.py:35 + byte 0x151f7c75 // tmp%69#0,0x151f7c75 arc4.abimethod typed_abi_call/logger.py:35 + swap // load tmp%69#0 from l-stack (no copy) 0x151f7c75,tmp%69#0 arc4.abimethod typed_abi_call/logger.py:35 + concat // {concat} arc4.abimethod typed_abi_call/logger.py:35 + // virtual: store tmp%70#0 to l-stack (no copy) tmp%70#0 arc4.abimethod typed_abi_call/logger.py:35 + // virtual: load tmp%70#0 from l-stack (no copy) tmp%70#0 arc4.abimethod typed_abi_call/logger.py:35 + log // arc4.abimethod typed_abi_call/logger.py:35 + int 1 // 1 arc4.abimethod typed_abi_call/logger.py:35 + return // arc4.abimethod typed_abi_call/logger.py:35 + +main_bare_routing@12: + txn OnCompletion // {txn} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%71#0 to l-stack (no copy) tmp%71#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%71#0 from l-stack (no copy) tmp%71#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + ! // {!} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store not%tmp%71#0 to l-stack (no copy) not%tmp%71#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load not%tmp%71#0 from l-stack (no copy) not%tmp%71#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + assert // reject transaction // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + txn ApplicationID // {txn} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%72#0 to l-stack (no copy) tmp%72#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%72#0 from l-stack (no copy) tmp%72#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + ! // {!} class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: store tmp%73#0 to l-stack (no copy) tmp%73#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + // virtual: load tmp%73#0 from l-stack (no copy) tmp%73#0 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + assert // is creating // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + int 1 // 1 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + return // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + + +// test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: +echo: + proto 1 1 // (𝕡) value#0 | @arc4.abimethod\ndef echo(self, value: arc4.String) -> arc4.String: typed_abi_call/logger.py:7-8 + +echo_block@0: + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | value#0 "echo: " + value typed_abi_call/logger.py:9 + extract 2 0 // (𝕡) value#0 | {extract} "echo: " + value typed_abi_call/logger.py:9 + // virtual: store expr_value_trimmed%1#0 to l-stack (no copy) (𝕡) value#0 | expr_value_trimmed%1#0 "echo: " + value typed_abi_call/logger.py:9 + byte "echo: " // (𝕡) value#0 | expr_value_trimmed%1#0,"echo: " "echo: " + value typed_abi_call/logger.py:9 + swap // load expr_value_trimmed%1#0 from l-stack (no copy) (𝕡) value#0 | "echo: ",expr_value_trimmed%1#0 "echo: " + value typed_abi_call/logger.py:9 + concat // (𝕡) value#0 | {concat} "echo: " + value typed_abi_call/logger.py:9 + // virtual: store concatenated%2#0 to l-stack (no copy) (𝕡) value#0 | concatenated%2#0 "echo: " + value typed_abi_call/logger.py:9 + dup // load concatenated%2#0 from l-stack (copy) (𝕡) value#0 | concatenated%2#0,concatenated%2#0 "echo: " + value typed_abi_call/logger.py:9 + len // (𝕡) value#0 | concatenated%2#0,{len} "echo: " + value typed_abi_call/logger.py:9 + // virtual: store len_%3#0 to l-stack (no copy) (𝕡) value#0 | concatenated%2#0,len_%3#0 "echo: " + value typed_abi_call/logger.py:9 + // virtual: load len_%3#0 from l-stack (no copy) (𝕡) value#0 | concatenated%2#0,len_%3#0 "echo: " + value typed_abi_call/logger.py:9 + itob // (𝕡) value#0 | concatenated%2#0,{itob} "echo: " + value typed_abi_call/logger.py:9 + // virtual: store len_bytes%4#0 to l-stack (no copy) (𝕡) value#0 | concatenated%2#0,len_bytes%4#0 "echo: " + value typed_abi_call/logger.py:9 + // virtual: load len_bytes%4#0 from l-stack (no copy) (𝕡) value#0 | concatenated%2#0,len_bytes%4#0 "echo: " + value typed_abi_call/logger.py:9 + extract 6 0 // (𝕡) value#0 | concatenated%2#0,{extract} "echo: " + value typed_abi_call/logger.py:9 + // virtual: store len_16_bit%5#0 to l-stack (no copy) (𝕡) value#0 | concatenated%2#0,len_16_bit%5#0 "echo: " + value typed_abi_call/logger.py:9 + // virtual: load len_16_bit%5#0 from l-stack (no copy) (𝕡) value#0 | concatenated%2#0,len_16_bit%5#0 "echo: " + value typed_abi_call/logger.py:9 + swap // load concatenated%2#0 from l-stack (no copy) (𝕡) value#0 | len_16_bit%5#0,concatenated%2#0 "echo: " + value typed_abi_call/logger.py:9 + concat // (𝕡) value#0 | {concat} "echo: " + value typed_abi_call/logger.py:9 + // virtual: store concat_result%6#0 to l-stack (no copy) (𝕡) value#0 | concat_result%6#0 "echo: " + value typed_abi_call/logger.py:9 + // virtual: load concat_result%6#0 from l-stack (no copy) (𝕡) value#0 | concat_result%6#0 return "echo: " + value typed_abi_call/logger.py:9 + retsub // concat_result%6#0 return "echo: " + value typed_abi_call/logger.py:9 + + +// test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: +log_uint64: + proto 1 0 // (𝕡) value#0 | @arc4.abimethod\ndef log_uint64(self, value: arc4.UInt64) -> None: typed_abi_call/logger.py:11-12 + +log_uint64_block@0: + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | value#0 log(value) typed_abi_call/logger.py:13 + log // (𝕡) value#0 | log(value) typed_abi_call/logger.py:13 + retsub // + + +// test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: +log_uint512: + proto 1 0 // (𝕡) value#0 | @arc4.abimethod\ndef log_uint512(self, value: arc4.UInt512) -> None: typed_abi_call/logger.py:15-16 + +log_uint512_block@0: + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | value#0 log(value) typed_abi_call/logger.py:17 + log // (𝕡) value#0 | log(value) typed_abi_call/logger.py:17 + retsub // + + +// test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: +log_string: + proto 1 0 // (𝕡) value#0 | @arc4.abimethod\ndef log_string(self, value: arc4.String) -> None: typed_abi_call/logger.py:19-20 + +log_string_block@0: + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | value#0 value.decode() typed_abi_call/logger.py:21 + extract 2 0 // (𝕡) value#0 | {extract} value.decode() typed_abi_call/logger.py:21 + // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) value#0 | tmp%0#0 value.decode() typed_abi_call/logger.py:21 + // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) value#0 | tmp%0#0 log(value.decode()) typed_abi_call/logger.py:21 + log // (𝕡) value#0 | log(value.decode()) typed_abi_call/logger.py:21 + retsub // + + +// test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: +log_bool: + proto 1 0 // (𝕡) value#0 | @arc4.abimethod\ndef log_bool(self, value: arc4.Bool) -> None: typed_abi_call/logger.py:23-24 + +log_bool_block@0: + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | value#0 value.decode() typed_abi_call/logger.py:25 + int 0 // (𝕡) value#0 | value#0,0 + getbit // (𝕡) value#0 | {getbit} value.decode() typed_abi_call/logger.py:25 + // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) value#0 | tmp%0#0 value.decode() typed_abi_call/logger.py:25 + // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) value#0 | tmp%0#0 Bytes(b"True") if value.decode() else Bytes(b"False") typed_abi_call/logger.py:25 + bz log_bool_ternary_false@2 // (𝕡) value#0 | Bytes(b"True") if value.decode() else Bytes(b"False") typed_abi_call/logger.py:25 + // Implicit fall through to log_bool_ternary_true@1 // (𝕡) value#0 | Bytes(b"True") if value.decode() else Bytes(b"False") typed_abi_call/logger.py:25 + +log_bool_ternary_true@1: + byte "True" // (𝕡) value#0 | "True" b"True" typed_abi_call/logger.py:25 + // virtual: store ternary_result%1#0 to x-stack (no copy) (𝕡) value#0 | (𝕏) ternary_result%1#0 | Bytes(b"True") if value.decode() else Bytes(b"False") typed_abi_call/logger.py:25 + b log_bool_ternary_merge@3 // (𝕡) value#0 | (𝕏) ternary_result%1#0 | ternary_result%1#0 + +log_bool_ternary_false@2: + byte "False" // (𝕡) value#0 | "False" b"False" typed_abi_call/logger.py:25 + // virtual: store ternary_result%1#0 to x-stack (no copy) (𝕡) value#0 | (𝕏) ternary_result%1#0 | Bytes(b"True") if value.decode() else Bytes(b"False") typed_abi_call/logger.py:25 + // Implicit fall through to log_bool_ternary_merge@3 // (𝕡) value#0 | (𝕏) ternary_result%1#0 | ternary_result%1#0 + +log_bool_ternary_merge@3: + // virtual: load ternary_result%1#0 from x-stack (𝕡) value#0 | ternary_result%1#0 ternary_result%1#0 log(Bytes(b"True") if value.decode() else Bytes(b"False")) typed_abi_call/logger.py:25 + log // (𝕡) value#0 | log(Bytes(b"True") if value.decode() else Bytes(b"False")) typed_abi_call/logger.py:25 + retsub // + + +// test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: +log_bytes: + proto 1 0 // (𝕡) value#0 | @arc4.abimethod\ndef log_bytes(self, value: arc4.DynamicBytes) -> None: typed_abi_call/logger.py:27-28 + +log_bytes_block@0: + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | value#0 value.bytes[2:] typed_abi_call/logger.py:29 + len // (𝕡) value#0 | {len} value.bytes[2:] typed_abi_call/logger.py:29 + // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) value#0 | tmp%1#0 value.bytes[2:] typed_abi_call/logger.py:29 + int 2 // (𝕡) value#0 | tmp%1#0,2 2 typed_abi_call/logger.py:29 + dig 1 // load tmp%1#0 from l-stack (copy) (𝕡) value#0 | tmp%1#0,2,tmp%1#0 value.bytes[2:] typed_abi_call/logger.py:29 + < // (𝕡) value#0 | tmp%1#0,{<} value.bytes[2:] typed_abi_call/logger.py:29 + swap // store tmp%3#0 to l-stack (no copy) (𝕡) value#0 | tmp%3#0,tmp%1#0 value.bytes[2:] typed_abi_call/logger.py:29 + dup // load tmp%1#0 from l-stack (copy) (𝕡) value#0 | tmp%3#0,tmp%1#0,tmp%1#0 value.bytes[2:] typed_abi_call/logger.py:29 + int 2 // (𝕡) value#0 | tmp%3#0,tmp%1#0,tmp%1#0,2 2 typed_abi_call/logger.py:29 + uncover 3 // load tmp%3#0 from l-stack (no copy) (𝕡) value#0 | tmp%1#0,tmp%1#0,2,tmp%3#0 value.bytes[2:] typed_abi_call/logger.py:29 + select // (𝕡) value#0 | tmp%1#0,{select} value.bytes[2:] typed_abi_call/logger.py:29 + // virtual: store tmp%4#0 to l-stack (no copy) (𝕡) value#0 | tmp%1#0,tmp%4#0 value.bytes[2:] typed_abi_call/logger.py:29 + frame_dig -1 // load value#0 from parameters (𝕡) value#0 | tmp%1#0,tmp%4#0,value#0 value.bytes[2:] typed_abi_call/logger.py:29 + swap // load tmp%4#0 from l-stack (no copy) (𝕡) value#0 | tmp%1#0,value#0,tmp%4#0 value.bytes[2:] typed_abi_call/logger.py:29 + uncover 2 // load tmp%1#0 from l-stack (no copy) (𝕡) value#0 | value#0,tmp%4#0,tmp%1#0 value.bytes[2:] typed_abi_call/logger.py:29 + substring3 // (𝕡) value#0 | {substring3} value.bytes[2:] typed_abi_call/logger.py:29 + // virtual: store tmp%6#0 to l-stack (no copy) (𝕡) value#0 | tmp%6#0 value.bytes[2:] typed_abi_call/logger.py:29 + // virtual: load tmp%6#0 from l-stack (no copy) (𝕡) value#0 | tmp%6#0 log(value.bytes[2:]) typed_abi_call/logger.py:29 + log // (𝕡) value#0 | log(value.bytes[2:]) typed_abi_call/logger.py:29 + retsub // + + +// test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: +log_asset_account_app: + proto 3 0 // (𝕡) asset#0,account#0,app#0 | @arc4.abimethod\ndef log_asset_account_app(self, asset: Asset, account: Account, app: Application... typed_abi_call/logger.py:31-32 + +log_asset_account_app_block@0: + frame_dig -3 // load asset#0 from parameters (𝕡) asset#0,account#0,app#0 | asset#0 asset.name typed_abi_call/logger.py:33 + asset_params_get AssetName // (𝕡) asset#0,account#0,app#0 | {asset_params_get}.0,{asset_params_get}.1 asset.name typed_abi_call/logger.py:33 + // virtual: store check%1#0 to l-stack (no copy) (𝕡) asset#0,account#0,app#0 | check%1#0,{asset_params_get}.0 asset.name typed_abi_call/logger.py:33 + // virtual: store value%0#0 to l-stack (no copy) (𝕡) asset#0,account#0,app#0 | value%0#0,check%1#0 asset.name typed_abi_call/logger.py:33 + // virtual: load check%1#0 from l-stack (no copy) (𝕡) asset#0,account#0,app#0 | value%0#0,check%1#0 asset.name typed_abi_call/logger.py:33 + assert // asset exists // (𝕡) asset#0,account#0,app#0 | value%0#0 asset.name typed_abi_call/logger.py:33 + // virtual: load value%0#0 from l-stack (no copy) (𝕡) asset#0,account#0,app#0 | value%0#0 account.bytes typed_abi_call/logger.py:33 + frame_dig -2 // load account#0 from parameters (𝕡) asset#0,account#0,app#0 | value%0#0,account#0 account.bytes typed_abi_call/logger.py:33 + concat // (𝕡) asset#0,account#0,app#0 | {concat} account.bytes typed_abi_call/logger.py:33 + // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%3#0 account.bytes typed_abi_call/logger.py:33 + frame_dig -1 // load app#0 from parameters (𝕡) asset#0,account#0,app#0 | tmp%3#0,app#0 app.address typed_abi_call/logger.py:33 + app_params_get AppAddress // (𝕡) asset#0,account#0,app#0 | tmp%3#0,{app_params_get}.0,{app_params_get}.1 app.address typed_abi_call/logger.py:33 + // virtual: store check%6#0 to l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%3#0,check%6#0,{app_params_get}.0 app.address typed_abi_call/logger.py:33 + // virtual: store value%5#0 to l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%3#0,value%5#0,check%6#0 app.address typed_abi_call/logger.py:33 + // virtual: load check%6#0 from l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%3#0,value%5#0,check%6#0 app.address typed_abi_call/logger.py:33 + assert // application exists // (𝕡) asset#0,account#0,app#0 | tmp%3#0,value%5#0 app.address typed_abi_call/logger.py:33 + // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) asset#0,account#0,app#0 | value%5#0,tmp%3#0 app.address typed_abi_call/logger.py:33 + // virtual: load value%5#0 from l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%3#0,value%5#0 app.address typed_abi_call/logger.py:33 + concat // (𝕡) asset#0,account#0,app#0 | {concat} app.address typed_abi_call/logger.py:33 + // virtual: store tmp%7#0 to l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%7#0 app.address typed_abi_call/logger.py:33 + // virtual: load tmp%7#0 from l-stack (no copy) (𝕡) asset#0,account#0,app#0 | tmp%7#0 log(asset.name, account.bytes, app.address) typed_abi_call/logger.py:33 + log // (𝕡) asset#0,account#0,app#0 | log(asset.name, account.bytes, app.address) typed_abi_call/logger.py:33 + retsub // + + +// test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: +return_args_after_14th: + proto 20 1 // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | @arc4.abimethod\ndef return_args_after_14th(\nself,\n_a1: arc4.UInt64,\n_a2: arc4.UInt64,\n_a3: a... typed_abi_call/logger.py:35-58 + +return_args_after_14th_block@0: + frame_dig -6 // load a15#0 from parameters (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | a15#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + frame_dig -5 // load a16#0 from parameters (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | a15#0,a16#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + concat // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | {concat} arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: store encoded_tuple_buffer%1#2 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: load encoded_tuple_buffer%1#2 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + frame_dig -4 // load a17#0 from parameters (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2,a17#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + concat // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | {concat} arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: store encoded_tuple_buffer%1#2 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: load encoded_tuple_buffer%1#2 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + frame_dig -3 // load a18#0 from parameters (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2,a18#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + concat // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | {concat} arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: store encoded_tuple_buffer%1#2 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: load encoded_tuple_buffer%1#2 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + frame_dig -2 // load a19#0 from parameters (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2,a19#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + concat // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | {concat} arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: store encoded_tuple_buffer%1#2 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: load encoded_tuple_buffer%1#2 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + frame_dig -1 // load a20#0 from parameters (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | encoded_tuple_buffer%1#2,a20#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + concat // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | {concat} arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + // virtual: store last_arg#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0 arc4.Tuple((a15, a16, a17, a18, a19, a20)) typed_abi_call/logger.py:59 + txna ApplicationArgs 15 // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,{txna} Txn.application_args(15) typed_abi_call/logger.py:60 + // virtual: store tmp%2#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,tmp%2#0 Txn.application_args(15) typed_abi_call/logger.py:60 + // virtual: load tmp%2#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,tmp%2#0 Txn.application_args(15) == last_arg.bytes typed_abi_call/logger.py:60 + dig 1 // load last_arg#0 from l-stack (copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,tmp%2#0,last_arg#0 Txn.application_args(15) == last_arg.bytes typed_abi_call/logger.py:60 + == // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,{==} Txn.application_args(15) == last_arg.bytes typed_abi_call/logger.py:60 + // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,tmp%3#0 Txn.application_args(15) == last_arg.bytes typed_abi_call/logger.py:60 + // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,tmp%3#0 assert Txn.application_args(15) == last_arg.bytes typed_abi_call/logger.py:60 + assert // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0 assert Txn.application_args(15) == last_arg.bytes typed_abi_call/logger.py:60 + dup // load last_arg#0 from l-stack (copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,last_arg#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + len // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,{len} arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: store length%4#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,length%4#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: load length%4#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,length%4#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + itob // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,{itob} arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: store value_as_bytes%5#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,value_as_bytes%5#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: load value_as_bytes%5#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,value_as_bytes%5#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + extract 6 2 // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,{extract} arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: store value_as_uint16%6#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,value_as_uint16%6#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: load value_as_uint16%6#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | last_arg#0,value_as_uint16%6#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + swap // load last_arg#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | value_as_uint16%6#0,last_arg#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + concat // (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | {concat} arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: store tmp%7#0 to l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | tmp%7#0 arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + // virtual: load tmp%7#0 from l-stack (no copy) (𝕡) _a1#0,_a2#0,_a3#0,_a4#0,_a5#0,_a6#0,_a7#0,_a8#0,_a9#0,_a10#0,_a11#0,_a12#0,_a13#0,_a14#0,a15#0,a16#0,a17#0,a18#0,a19#0,a20#0 | tmp%7#0 return arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + retsub // tmp%7#0 return arc4.DynamicBytes(last_arg.bytes) typed_abi_call/logger.py:61 + diff --git a/test_cases/typed_abi_call/out/Logger.approval.teal b/test_cases/typed_abi_call/out/Logger.approval.teal new file mode 100644 index 0000000000..7d93ffa5ba --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.approval.teal @@ -0,0 +1,401 @@ +#pragma version 10 + +test_cases.typed_abi_call.logger.Logger.approval_program: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txn NumAppArgs + bz main_bare_routing@12 + method "echo(string)string" + method "log_uint64(uint64)void" + method "log_uint512(uint512)void" + method "log_string(string)void" + method "log_bool(bool)void" + method "log_bytes(byte[])void" + method "log_asset_account_app(asset,account,application)void" + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + txna ApplicationArgs 0 + match main_echo_route@2 main_log_uint64_route@3 main_log_uint512_route@4 main_log_string_route@5 main_log_bool_route@6 main_log_bytes_route@7 main_log_asset_account_app_route@8 main_return_args_after_14th_route@9 + err // reject transaction + +main_echo_route@2: + // typed_abi_call/logger.py:7 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:7 + // @arc4.abimethod + callsub echo + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_log_uint64_route@3: + // typed_abi_call/logger.py:11 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:11 + // @arc4.abimethod + callsub log_uint64 + int 1 + return + +main_log_uint512_route@4: + // typed_abi_call/logger.py:15 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:15 + // @arc4.abimethod + callsub log_uint512 + int 1 + return + +main_log_string_route@5: + // typed_abi_call/logger.py:19 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:19 + // @arc4.abimethod + callsub log_string + int 1 + return + +main_log_bool_route@6: + // typed_abi_call/logger.py:23 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:23 + // @arc4.abimethod + callsub log_bool + int 1 + return + +main_log_bytes_route@7: + // typed_abi_call/logger.py:27 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:27 + // @arc4.abimethod + callsub log_bytes + int 1 + return + +main_log_asset_account_app_route@8: + // typed_abi_call/logger.py:31 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Accounts + txna ApplicationArgs 3 + btoi + txnas Applications + // typed_abi_call/logger.py:31 + // @arc4.abimethod + callsub log_asset_account_app + int 1 + return + +main_return_args_after_14th_route@9: + // typed_abi_call/logger.py:35 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + txna ApplicationArgs 2 + txna ApplicationArgs 3 + txna ApplicationArgs 4 + txna ApplicationArgs 5 + txna ApplicationArgs 6 + txna ApplicationArgs 7 + txna ApplicationArgs 8 + txna ApplicationArgs 9 + txna ApplicationArgs 10 + txna ApplicationArgs 11 + txna ApplicationArgs 12 + txna ApplicationArgs 13 + txna ApplicationArgs 14 + txna ApplicationArgs 15 + extract 0 1 + txna ApplicationArgs 15 + extract 1 1 + txna ApplicationArgs 15 + extract 2 1 + txna ApplicationArgs 15 + extract 3 1 + txna ApplicationArgs 15 + extract 4 4 + txna ApplicationArgs 15 + extract 8 1 + // typed_abi_call/logger.py:35 + // @arc4.abimethod + callsub return_args_after_14th + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_bare_routing@12: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txn OnCompletion + ! + assert // reject transaction + txn ApplicationID + ! + assert // is creating + int 1 + return + + +// test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: +echo: + // typed_abi_call/logger.py:7-8 + // @arc4.abimethod + // def echo(self, value: arc4.String) -> arc4.String: + proto 1 1 + // typed_abi_call/logger.py:9 + // return "echo: " + value + frame_dig -1 + extract 2 0 + byte "echo: " + swap + concat + dup + len + itob + extract 6 0 + swap + concat + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: +log_uint64: + // typed_abi_call/logger.py:11-12 + // @arc4.abimethod + // def log_uint64(self, value: arc4.UInt64) -> None: + proto 1 0 + // typed_abi_call/logger.py:13 + // log(value) + frame_dig -1 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: +log_uint512: + // typed_abi_call/logger.py:15-16 + // @arc4.abimethod + // def log_uint512(self, value: arc4.UInt512) -> None: + proto 1 0 + // typed_abi_call/logger.py:17 + // log(value) + frame_dig -1 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: +log_string: + // typed_abi_call/logger.py:19-20 + // @arc4.abimethod + // def log_string(self, value: arc4.String) -> None: + proto 1 0 + // typed_abi_call/logger.py:21 + // log(value.decode()) # decode to remove header + frame_dig -1 + extract 2 0 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: +log_bool: + // typed_abi_call/logger.py:23-24 + // @arc4.abimethod + // def log_bool(self, value: arc4.Bool) -> None: + proto 1 0 + // typed_abi_call/logger.py:25 + // log(Bytes(b"True") if value.decode() else Bytes(b"False")) + frame_dig -1 + int 0 + getbit + bz log_bool_ternary_false@2 + byte "True" + b log_bool_ternary_merge@3 + +log_bool_ternary_false@2: + // typed_abi_call/logger.py:25 + // log(Bytes(b"True") if value.decode() else Bytes(b"False")) + byte "False" + +log_bool_ternary_merge@3: + // typed_abi_call/logger.py:25 + // log(Bytes(b"True") if value.decode() else Bytes(b"False")) + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: +log_bytes: + // typed_abi_call/logger.py:27-28 + // @arc4.abimethod + // def log_bytes(self, value: arc4.DynamicBytes) -> None: + proto 1 0 + // typed_abi_call/logger.py:29 + // log(value.bytes[2:]) # decode to remove header + frame_dig -1 + len + int 2 + dig 1 + < + swap + dup + int 2 + uncover 3 + select + frame_dig -1 + swap + uncover 2 + substring3 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: +log_asset_account_app: + // typed_abi_call/logger.py:31-32 + // @arc4.abimethod + // def log_asset_account_app(self, asset: Asset, account: Account, app: Application) -> None: + proto 3 0 + // typed_abi_call/logger.py:33 + // log(asset.name, account.bytes, app.address) + frame_dig -3 + asset_params_get AssetName + assert // asset exists + frame_dig -2 + concat + frame_dig -1 + app_params_get AppAddress + assert // application exists + concat + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: +return_args_after_14th: + // typed_abi_call/logger.py:35-58 + // @arc4.abimethod + // def return_args_after_14th( + // self, + // _a1: arc4.UInt64, + // _a2: arc4.UInt64, + // _a3: arc4.UInt64, + // _a4: arc4.UInt64, + // _a5: arc4.UInt64, + // _a6: arc4.UInt64, + // _a7: arc4.UInt64, + // _a8: arc4.UInt64, + // _a9: arc4.UInt64, + // _a10: arc4.UInt64, + // _a11: arc4.UInt64, + // _a12: arc4.UInt64, + // _a13: arc4.UInt64, + // _a14: arc4.UInt64, + // a15: arc4.UInt8, + // a16: arc4.UInt8, + // a17: arc4.UInt8, + // a18: arc4.UInt8, + // a19: arc4.Tuple[arc4.UInt8, arc4.UInt8, arc4.UInt8, arc4.UInt8], + // a20: arc4.UInt8, + // ) -> arc4.DynamicBytes: + proto 20 1 + // typed_abi_call/logger.py:59 + // last_arg = arc4.Tuple((a15, a16, a17, a18, a19, a20)) + frame_dig -6 + frame_dig -5 + concat + frame_dig -4 + concat + frame_dig -3 + concat + frame_dig -2 + concat + frame_dig -1 + concat + // typed_abi_call/logger.py:60 + // assert Txn.application_args(15) == last_arg.bytes + txna ApplicationArgs 15 + dig 1 + == + assert + // typed_abi_call/logger.py:61 + // return arc4.DynamicBytes(last_arg.bytes) + dup + len + itob + extract 6 2 + swap + concat + retsub diff --git a/test_cases/typed_abi_call/out/Logger.arc32.json b/test_cases/typed_abi_call/out/Logger.arc32.json new file mode 100644 index 0000000000..7234af6be5 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.arc32.json @@ -0,0 +1,257 @@ +{ + "hints": { + "echo(string)string": { + "call_config": { + "no_op": "CALL" + } + }, + "log_uint64(uint64)void": { + "call_config": { + "no_op": "CALL" + } + }, + "log_uint512(uint512)void": { + "call_config": { + "no_op": "CALL" + } + }, + "log_string(string)void": { + "call_config": { + "no_op": "CALL" + } + }, + "log_bool(bool)void": { + "call_config": { + "no_op": "CALL" + } + }, + "log_bytes(byte[])void": { + "call_config": { + "no_op": "CALL" + } + }, + "log_asset_account_app(asset,account,application)void": { + "call_config": { + "no_op": "CALL" + } + }, + "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLmxvZ2dlci5Mb2dnZXIuYXBwcm92YWxfcHJvZ3JhbToKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo2CiAgICAvLyBjbGFzcyBMb2dnZXIoQVJDNENvbnRyYWN0KToKICAgIHR4biBOdW1BcHBBcmdzCiAgICBieiBtYWluX2JhcmVfcm91dGluZ0AxMgogICAgbWV0aG9kICJlY2hvKHN0cmluZylzdHJpbmciCiAgICBtZXRob2QgImxvZ191aW50NjQodWludDY0KXZvaWQiCiAgICBtZXRob2QgImxvZ191aW50NTEyKHVpbnQ1MTIpdm9pZCIKICAgIG1ldGhvZCAibG9nX3N0cmluZyhzdHJpbmcpdm9pZCIKICAgIG1ldGhvZCAibG9nX2Jvb2woYm9vbCl2b2lkIgogICAgbWV0aG9kICJsb2dfYnl0ZXMoYnl0ZVtdKXZvaWQiCiAgICBtZXRob2QgImxvZ19hc3NldF9hY2NvdW50X2FwcChhc3NldCxhY2NvdW50LGFwcGxpY2F0aW9uKXZvaWQiCiAgICBtZXRob2QgInJldHVybl9hcmdzX2FmdGVyXzE0dGgodWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0LHVpbnQ2NCx1aW50OCx1aW50OCx1aW50OCx1aW50OCwodWludDgsdWludDgsdWludDgsdWludDgpLHVpbnQ4KWJ5dGVbXSIKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDAKICAgIG1hdGNoIG1haW5fZWNob19yb3V0ZUAyIG1haW5fbG9nX3VpbnQ2NF9yb3V0ZUAzIG1haW5fbG9nX3VpbnQ1MTJfcm91dGVANCBtYWluX2xvZ19zdHJpbmdfcm91dGVANSBtYWluX2xvZ19ib29sX3JvdXRlQDYgbWFpbl9sb2dfYnl0ZXNfcm91dGVANyBtYWluX2xvZ19hc3NldF9hY2NvdW50X2FwcF9yb3V0ZUA4IG1haW5fcmV0dXJuX2FyZ3NfYWZ0ZXJfMTR0aF9yb3V0ZUA5CiAgICBlcnIgLy8gcmVqZWN0IHRyYW5zYWN0aW9uCgptYWluX2VjaG9fcm91dGVAMjoKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo3CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo2CiAgICAvLyBjbGFzcyBMb2dnZXIoQVJDNENvbnRyYWN0KToKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo3CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgZWNobwogICAgYnl0ZSAweDE1MWY3Yzc1CiAgICBzd2FwCiAgICBjb25jYXQKICAgIGxvZwogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9sb2dfdWludDY0X3JvdXRlQDM6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MTEKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjYKICAgIC8vIGNsYXNzIExvZ2dlcihBUkM0Q29udHJhY3QpOgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjExCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgbG9nX3VpbnQ2NAogICAgaW50IDEKICAgIHJldHVybgoKbWFpbl9sb2dfdWludDUxMl9yb3V0ZUA0OgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjE1CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo2CiAgICAvLyBjbGFzcyBMb2dnZXIoQVJDNENvbnRyYWN0KToKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToxNQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICBjYWxsc3ViIGxvZ191aW50NTEyCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX2xvZ19zdHJpbmdfcm91dGVANToKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToxOQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6NgogICAgLy8gY2xhc3MgTG9nZ2VyKEFSQzRDb250cmFjdCk6CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MTkKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgY2FsbHN1YiBsb2dfc3RyaW5nCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX2xvZ19ib29sX3JvdXRlQDY6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MjMKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjYKICAgIC8vIGNsYXNzIExvZ2dlcihBUkM0Q29udHJhY3QpOgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjIzCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgbG9nX2Jvb2wKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fbG9nX2J5dGVzX3JvdXRlQDc6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MjcKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjYKICAgIC8vIGNsYXNzIExvZ2dlcihBUkM0Q29udHJhY3QpOgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjI3CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgbG9nX2J5dGVzCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX2xvZ19hc3NldF9hY2NvdW50X2FwcF9yb3V0ZUA4OgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjMxCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo2CiAgICAvLyBjbGFzcyBMb2dnZXIoQVJDNENvbnRyYWN0KToKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIGJ0b2kKICAgIHR4bmFzIEFzc2V0cwogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMgogICAgYnRvaQogICAgdHhuYXMgQWNjb3VudHMKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDMKICAgIGJ0b2kKICAgIHR4bmFzIEFwcGxpY2F0aW9ucwogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjMxCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgbG9nX2Fzc2V0X2FjY291bnRfYXBwCiAgICBpbnQgMQogICAgcmV0dXJuCgptYWluX3JldHVybl9hcmdzX2FmdGVyXzE0dGhfcm91dGVAOToKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTozNQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICB0eG4gT25Db21wbGV0aW9uCiAgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6NgogICAgLy8gY2xhc3MgTG9nZ2VyKEFSQzRDb250cmFjdCk6CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAyCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAzCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA0CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA1CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA2CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA3CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA4CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA5CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxMAogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMTEKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEyCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxMwogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMTQKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDE1CiAgICBleHRyYWN0IDAgMQogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMTUKICAgIGV4dHJhY3QgMSAxCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxNQogICAgZXh0cmFjdCAyIDEKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDE1CiAgICBleHRyYWN0IDMgMQogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMTUKICAgIGV4dHJhY3QgNCA0CiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxNQogICAgZXh0cmFjdCA4IDEKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTozNQogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICBjYWxsc3ViIHJldHVybl9hcmdzX2FmdGVyXzE0dGgKICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgc3dhcAogICAgY29uY2F0CiAgICBsb2cKICAgIGludCAxCiAgICByZXR1cm4KCm1haW5fYmFyZV9yb3V0aW5nQDEyOgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjYKICAgIC8vIGNsYXNzIExvZ2dlcihBUkM0Q29udHJhY3QpOgogICAgdHhuIE9uQ29tcGxldGlvbgogICAgIQogICAgYXNzZXJ0IC8vIHJlamVjdCB0cmFuc2FjdGlvbgogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICEKICAgIGFzc2VydCAvLyBpcyBjcmVhdGluZwogICAgaW50IDEKICAgIHJldHVybgoKCi8vIHRlc3RfY2FzZXMudHlwZWRfYWJpX2NhbGwubG9nZ2VyLkxvZ2dlci5lY2hvKHZhbHVlOiBieXRlcykgLT4gYnl0ZXM6CmVjaG86CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6Ny04CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBlY2hvKHNlbGYsIHZhbHVlOiBhcmM0LlN0cmluZykgLT4gYXJjNC5TdHJpbmc6CiAgICBwcm90byAxIDEKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo5CiAgICAvLyByZXR1cm4gImVjaG86ICIgKyB2YWx1ZQogICAgZnJhbWVfZGlnIC0xCiAgICBleHRyYWN0IDIgMAogICAgYnl0ZSAiZWNobzogIgogICAgc3dhcAogICAgY29uY2F0CiAgICBkdXAKICAgIGxlbgogICAgaXRvYgogICAgZXh0cmFjdCA2IDAKICAgIHN3YXAKICAgIGNvbmNhdAogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50eXBlZF9hYmlfY2FsbC5sb2dnZXIuTG9nZ2VyLmxvZ191aW50NjQodmFsdWU6IGJ5dGVzKSAtPiB2b2lkOgpsb2dfdWludDY0OgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjExLTEyCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBsb2dfdWludDY0KHNlbGYsIHZhbHVlOiBhcmM0LlVJbnQ2NCkgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjEzCiAgICAvLyBsb2codmFsdWUpCiAgICBmcmFtZV9kaWcgLTEKICAgIGxvZwogICAgcmV0c3ViCgoKLy8gdGVzdF9jYXNlcy50eXBlZF9hYmlfY2FsbC5sb2dnZXIuTG9nZ2VyLmxvZ191aW50NTEyKHZhbHVlOiBieXRlcykgLT4gdm9pZDoKbG9nX3VpbnQ1MTI6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MTUtMTYKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIGxvZ191aW50NTEyKHNlbGYsIHZhbHVlOiBhcmM0LlVJbnQ1MTIpIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToxNwogICAgLy8gbG9nKHZhbHVlKQogICAgZnJhbWVfZGlnIC0xCiAgICBsb2cKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHlwZWRfYWJpX2NhbGwubG9nZ2VyLkxvZ2dlci5sb2dfc3RyaW5nKHZhbHVlOiBieXRlcykgLT4gdm9pZDoKbG9nX3N0cmluZzoKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToxOS0yMAogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgbG9nX3N0cmluZyhzZWxmLCB2YWx1ZTogYXJjNC5TdHJpbmcpIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToyMQogICAgLy8gbG9nKHZhbHVlLmRlY29kZSgpKSAgIyBkZWNvZGUgdG8gcmVtb3ZlIGhlYWRlcgogICAgZnJhbWVfZGlnIC0xCiAgICBleHRyYWN0IDIgMAogICAgbG9nCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLmxvZ2dlci5Mb2dnZXIubG9nX2Jvb2wodmFsdWU6IGJ5dGVzKSAtPiB2b2lkOgpsb2dfYm9vbDoKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToyMy0yNAogICAgLy8gQGFyYzQuYWJpbWV0aG9kCiAgICAvLyBkZWYgbG9nX2Jvb2woc2VsZiwgdmFsdWU6IGFyYzQuQm9vbCkgLT4gTm9uZToKICAgIHByb3RvIDEgMAogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjI1CiAgICAvLyBsb2coQnl0ZXMoYiJUcnVlIikgaWYgdmFsdWUuZGVjb2RlKCkgZWxzZSBCeXRlcyhiIkZhbHNlIikpCiAgICBmcmFtZV9kaWcgLTEKICAgIGludCAwCiAgICBnZXRiaXQKICAgIGJ6IGxvZ19ib29sX3Rlcm5hcnlfZmFsc2VAMgogICAgYnl0ZSAiVHJ1ZSIKICAgIGIgbG9nX2Jvb2xfdGVybmFyeV9tZXJnZUAzCgpsb2dfYm9vbF90ZXJuYXJ5X2ZhbHNlQDI6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MjUKICAgIC8vIGxvZyhCeXRlcyhiIlRydWUiKSBpZiB2YWx1ZS5kZWNvZGUoKSBlbHNlIEJ5dGVzKGIiRmFsc2UiKSkKICAgIGJ5dGUgIkZhbHNlIgoKbG9nX2Jvb2xfdGVybmFyeV9tZXJnZUAzOgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjI1CiAgICAvLyBsb2coQnl0ZXMoYiJUcnVlIikgaWYgdmFsdWUuZGVjb2RlKCkgZWxzZSBCeXRlcyhiIkZhbHNlIikpCiAgICBsb2cKICAgIHJldHN1YgoKCi8vIHRlc3RfY2FzZXMudHlwZWRfYWJpX2NhbGwubG9nZ2VyLkxvZ2dlci5sb2dfYnl0ZXModmFsdWU6IGJ5dGVzKSAtPiB2b2lkOgpsb2dfYnl0ZXM6CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MjctMjgKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIGxvZ19ieXRlcyhzZWxmLCB2YWx1ZTogYXJjNC5EeW5hbWljQnl0ZXMpIC0+IE5vbmU6CiAgICBwcm90byAxIDAKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weToyOQogICAgLy8gbG9nKHZhbHVlLmJ5dGVzWzI6XSkgICMgZGVjb2RlIHRvIHJlbW92ZSBoZWFkZXIKICAgIGZyYW1lX2RpZyAtMQogICAgbGVuCiAgICBpbnQgMgogICAgZGlnIDEKICAgIDwKICAgIHN3YXAKICAgIGR1cAogICAgaW50IDIKICAgIHVuY292ZXIgMwogICAgc2VsZWN0CiAgICBmcmFtZV9kaWcgLTEKICAgIHN3YXAKICAgIHVuY292ZXIgMgogICAgc3Vic3RyaW5nMwogICAgbG9nCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLmxvZ2dlci5Mb2dnZXIubG9nX2Fzc2V0X2FjY291bnRfYXBwKGFzc2V0OiB1aW50NjQsIGFjY291bnQ6IGJ5dGVzLCBhcHA6IHVpbnQ2NCkgLT4gdm9pZDoKbG9nX2Fzc2V0X2FjY291bnRfYXBwOgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjMxLTMyCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiBsb2dfYXNzZXRfYWNjb3VudF9hcHAoc2VsZiwgYXNzZXQ6IEFzc2V0LCBhY2NvdW50OiBBY2NvdW50LCBhcHA6IEFwcGxpY2F0aW9uKSAtPiBOb25lOgogICAgcHJvdG8gMyAwCiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6MzMKICAgIC8vIGxvZyhhc3NldC5uYW1lLCBhY2NvdW50LmJ5dGVzLCBhcHAuYWRkcmVzcykKICAgIGZyYW1lX2RpZyAtMwogICAgYXNzZXRfcGFyYW1zX2dldCBBc3NldE5hbWUKICAgIGFzc2VydCAvLyBhc3NldCBleGlzdHMKICAgIGZyYW1lX2RpZyAtMgogICAgY29uY2F0CiAgICBmcmFtZV9kaWcgLTEKICAgIGFwcF9wYXJhbXNfZ2V0IEFwcEFkZHJlc3MKICAgIGFzc2VydCAvLyBhcHBsaWNhdGlvbiBleGlzdHMKICAgIGNvbmNhdAogICAgbG9nCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLmxvZ2dlci5Mb2dnZXIucmV0dXJuX2FyZ3NfYWZ0ZXJfMTR0aChfYTE6IGJ5dGVzLCBfYTI6IGJ5dGVzLCBfYTM6IGJ5dGVzLCBfYTQ6IGJ5dGVzLCBfYTU6IGJ5dGVzLCBfYTY6IGJ5dGVzLCBfYTc6IGJ5dGVzLCBfYTg6IGJ5dGVzLCBfYTk6IGJ5dGVzLCBfYTEwOiBieXRlcywgX2ExMTogYnl0ZXMsIF9hMTI6IGJ5dGVzLCBfYTEzOiBieXRlcywgX2ExNDogYnl0ZXMsIGExNTogYnl0ZXMsIGExNjogYnl0ZXMsIGExNzogYnl0ZXMsIGExODogYnl0ZXMsIGExOTogYnl0ZXMsIGEyMDogYnl0ZXMpIC0+IGJ5dGVzOgpyZXR1cm5fYXJnc19hZnRlcl8xNHRoOgogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjM1LTU4CiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIC8vIGRlZiByZXR1cm5fYXJnc19hZnRlcl8xNHRoKAogICAgLy8gICAgIHNlbGYsCiAgICAvLyAgICAgX2ExOiBhcmM0LlVJbnQ2NCwKICAgIC8vICAgICBfYTI6IGFyYzQuVUludDY0LAogICAgLy8gICAgIF9hMzogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2E0OiBhcmM0LlVJbnQ2NCwKICAgIC8vICAgICBfYTU6IGFyYzQuVUludDY0LAogICAgLy8gICAgIF9hNjogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2E3OiBhcmM0LlVJbnQ2NCwKICAgIC8vICAgICBfYTg6IGFyYzQuVUludDY0LAogICAgLy8gICAgIF9hOTogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2ExMDogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2ExMTogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2ExMjogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2ExMzogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgX2ExNDogYXJjNC5VSW50NjQsCiAgICAvLyAgICAgYTE1OiBhcmM0LlVJbnQ4LAogICAgLy8gICAgIGExNjogYXJjNC5VSW50OCwKICAgIC8vICAgICBhMTc6IGFyYzQuVUludDgsCiAgICAvLyAgICAgYTE4OiBhcmM0LlVJbnQ4LAogICAgLy8gICAgIGExOTogYXJjNC5UdXBsZVthcmM0LlVJbnQ4LCBhcmM0LlVJbnQ4LCBhcmM0LlVJbnQ4LCBhcmM0LlVJbnQ4XSwKICAgIC8vICAgICBhMjA6IGFyYzQuVUludDgsCiAgICAvLyApIC0+IGFyYzQuRHluYW1pY0J5dGVzOgogICAgcHJvdG8gMjAgMQogICAgLy8gdHlwZWRfYWJpX2NhbGwvbG9nZ2VyLnB5OjU5CiAgICAvLyBsYXN0X2FyZyA9IGFyYzQuVHVwbGUoKGExNSwgYTE2LCBhMTcsIGExOCwgYTE5LCBhMjApKQogICAgZnJhbWVfZGlnIC02CiAgICBmcmFtZV9kaWcgLTUKICAgIGNvbmNhdAogICAgZnJhbWVfZGlnIC00CiAgICBjb25jYXQKICAgIGZyYW1lX2RpZyAtMwogICAgY29uY2F0CiAgICBmcmFtZV9kaWcgLTIKICAgIGNvbmNhdAogICAgZnJhbWVfZGlnIC0xCiAgICBjb25jYXQKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo2MAogICAgLy8gYXNzZXJ0IFR4bi5hcHBsaWNhdGlvbl9hcmdzKDE1KSA9PSBsYXN0X2FyZy5ieXRlcwogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMTUKICAgIGRpZyAxCiAgICA9PQogICAgYXNzZXJ0CiAgICAvLyB0eXBlZF9hYmlfY2FsbC9sb2dnZXIucHk6NjEKICAgIC8vIHJldHVybiBhcmM0LkR5bmFtaWNCeXRlcyhsYXN0X2FyZy5ieXRlcykKICAgIGR1cAogICAgbGVuCiAgICBpdG9iCiAgICBleHRyYWN0IDYgMgogICAgc3dhcAogICAgY29uY2F0CiAgICByZXRzdWIK", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0X2Nhc2VzLnR5cGVkX2FiaV9jYWxsLmxvZ2dlci5Mb2dnZXIuY2xlYXJfc3RhdGVfcHJvZ3JhbToKICAgIC8vIHR5cGVkX2FiaV9jYWxsL2xvZ2dlci5weTo2CiAgICAvLyBjbGFzcyBMb2dnZXIoQVJDNENvbnRyYWN0KToKICAgIGludCAxCiAgICByZXR1cm4K" + }, + "state": { + "global": { + "num_byte_slices": 0, + "num_uints": 0 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": {}, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "Logger", + "methods": [ + { + "name": "echo", + "args": [ + { + "type": "string", + "name": "value" + } + ], + "returns": { + "type": "string" + } + }, + { + "name": "log_uint64", + "args": [ + { + "type": "uint64", + "name": "value" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "log_uint512", + "args": [ + { + "type": "uint512", + "name": "value" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "log_string", + "args": [ + { + "type": "string", + "name": "value" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "log_bool", + "args": [ + { + "type": "bool", + "name": "value" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "log_bytes", + "args": [ + { + "type": "byte[]", + "name": "value" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "log_asset_account_app", + "args": [ + { + "type": "asset", + "name": "asset" + }, + { + "type": "account", + "name": "account" + }, + { + "type": "application", + "name": "app" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "return_args_after_14th", + "args": [ + { + "type": "uint64", + "name": "_a1" + }, + { + "type": "uint64", + "name": "_a2" + }, + { + "type": "uint64", + "name": "_a3" + }, + { + "type": "uint64", + "name": "_a4" + }, + { + "type": "uint64", + "name": "_a5" + }, + { + "type": "uint64", + "name": "_a6" + }, + { + "type": "uint64", + "name": "_a7" + }, + { + "type": "uint64", + "name": "_a8" + }, + { + "type": "uint64", + "name": "_a9" + }, + { + "type": "uint64", + "name": "_a10" + }, + { + "type": "uint64", + "name": "_a11" + }, + { + "type": "uint64", + "name": "_a12" + }, + { + "type": "uint64", + "name": "_a13" + }, + { + "type": "uint64", + "name": "_a14" + }, + { + "type": "uint8", + "name": "a15" + }, + { + "type": "uint8", + "name": "a16" + }, + { + "type": "uint8", + "name": "a17" + }, + { + "type": "uint8", + "name": "a18" + }, + { + "type": "(uint8,uint8,uint8,uint8)", + "name": "a19" + }, + { + "type": "uint8", + "name": "a20" + } + ], + "returns": { + "type": "byte[]" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Logger.clear.mir b/test_cases/typed_abi_call/out/Logger.clear.mir new file mode 100644 index 0000000000..25f29a2613 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.clear.mir @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 10 + +// test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class Logger(ARC4Contract): typed_abi_call/logger.py:6 + return // class Logger(ARC4Contract): typed_abi_call/logger.py:6 + diff --git a/test_cases/typed_abi_call/out/Logger.clear.teal b/test_cases/typed_abi_call/out/Logger.clear.teal new file mode 100644 index 0000000000..19dbdafee5 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 + +test_cases.typed_abi_call.logger.Logger.clear_state_program: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + int 1 + return diff --git a/test_cases/typed_abi_call/out/Logger.destructured.ir b/test_cases/typed_abi_call/out/Logger.destructured.ir new file mode 100644 index 0000000000..fa5e027622 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.destructured.ir @@ -0,0 +1,207 @@ +contract test_cases.typed_abi_call.logger.Logger: + program approval: + subroutine test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@12 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => fail // reject transaction} + block@2: // echo_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: bytes = test_cases.typed_abi_call.logger.Logger.echo(tmp%5#0) + let tmp%7#0: bytes = (concat 0x151f7c75 tmp%6#0) + (log tmp%7#0) + return 1u + block@3: // log_uint64_route_L11 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint64(tmp%11#0) + return 1u + block@4: // log_uint512_route_L15 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) // OnCompletion is NoOp + let tmp%14#0: uint64 = (txn ApplicationID) + (assert tmp%14#0) // is not creating + let tmp%15#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint512(tmp%15#0) + return 1u + block@5: // log_string_route_L19 + let tmp%16#0: uint64 = (txn OnCompletion) + let tmp%17#0: uint64 = (! tmp%16#0) + (assert tmp%17#0) // OnCompletion is NoOp + let tmp%18#0: uint64 = (txn ApplicationID) + (assert tmp%18#0) // is not creating + let tmp%19#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_string(tmp%19#0) + return 1u + block@6: // log_bool_route_L23 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bool(tmp%23#0) + return 1u + block@7: // log_bytes_route_L27 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (! tmp%24#0) + (assert tmp%25#0) // OnCompletion is NoOp + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + let tmp%27#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bytes(tmp%27#0) + return 1u + block@8: // log_asset_account_app_route_L31 + let tmp%28#0: uint64 = (txn OnCompletion) + let tmp%29#0: uint64 = (! tmp%28#0) + (assert tmp%29#0) // OnCompletion is NoOp + let tmp%30#0: uint64 = (txn ApplicationID) + (assert tmp%30#0) // is not creating + let tmp%31#0: bytes = (txna ApplicationArgs 1) + let tmp%32#0: uint64 = (btoi tmp%31#0) + let tmp%33#0: uint64 = ((txnas Assets) tmp%32#0) + let tmp%34#0: bytes = (txna ApplicationArgs 2) + let tmp%35#0: uint64 = (btoi tmp%34#0) + let tmp%36#0: bytes = ((txnas Accounts) tmp%35#0) + let tmp%37#0: bytes = (txna ApplicationArgs 3) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Applications) tmp%38#0) + test_cases.typed_abi_call.logger.Logger.log_asset_account_app(tmp%33#0, tmp%36#0, tmp%39#0) + return 1u + block@9: // return_args_after_14th_route_L35 + let tmp%40#0: uint64 = (txn OnCompletion) + let tmp%41#0: uint64 = (! tmp%40#0) + (assert tmp%41#0) // OnCompletion is NoOp + let tmp%42#0: uint64 = (txn ApplicationID) + (assert tmp%42#0) // is not creating + let tmp%43#0: bytes = (txna ApplicationArgs 1) + let tmp%44#0: bytes = (txna ApplicationArgs 2) + let tmp%45#0: bytes = (txna ApplicationArgs 3) + let tmp%46#0: bytes = (txna ApplicationArgs 4) + let tmp%47#0: bytes = (txna ApplicationArgs 5) + let tmp%48#0: bytes = (txna ApplicationArgs 6) + let tmp%49#0: bytes = (txna ApplicationArgs 7) + let tmp%50#0: bytes = (txna ApplicationArgs 8) + let tmp%51#0: bytes = (txna ApplicationArgs 9) + let tmp%52#0: bytes = (txna ApplicationArgs 10) + let tmp%53#0: bytes = (txna ApplicationArgs 11) + let tmp%54#0: bytes = (txna ApplicationArgs 12) + let tmp%55#0: bytes = (txna ApplicationArgs 13) + let tmp%56#0: bytes = (txna ApplicationArgs 14) + let tmp%57#0: bytes = (txna ApplicationArgs 15) + let tmp%58#0: bytes = ((extract 0 1) tmp%57#0) + let tmp%59#0: bytes = (txna ApplicationArgs 15) + let tmp%60#0: bytes = ((extract 1 1) tmp%59#0) + let tmp%61#0: bytes = (txna ApplicationArgs 15) + let tmp%62#0: bytes = ((extract 2 1) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 15) + let tmp%64#0: bytes = ((extract 3 1) tmp%63#0) + let tmp%65#0: bytes = (txna ApplicationArgs 15) + let tmp%66#0: bytes = ((extract 4 4) tmp%65#0) + let tmp%67#0: bytes = (txna ApplicationArgs 15) + let tmp%68#0: bytes = ((extract 8 1) tmp%67#0) + let tmp%69#0: bytes = test_cases.typed_abi_call.logger.Logger.return_args_after_14th(tmp%43#0, tmp%44#0, tmp%45#0, tmp%46#0, tmp%47#0, tmp%48#0, tmp%49#0, tmp%50#0, tmp%51#0, tmp%52#0, tmp%53#0, tmp%54#0, tmp%55#0, tmp%56#0, tmp%58#0, tmp%60#0, tmp%62#0, tmp%64#0, tmp%66#0, tmp%68#0) + let tmp%70#0: bytes = (concat 0x151f7c75 tmp%69#0) + (log tmp%70#0) + return 1u + block@12: // bare_routing_L6 + let tmp%71#0: uint64 = (txn OnCompletion) + let not%tmp%71#0: uint64 = (! tmp%71#0) + (assert not%tmp%71#0) // reject transaction + let tmp%72#0: uint64 = (txn ApplicationID) + let tmp%73#0: uint64 = (! tmp%72#0) + (assert tmp%73#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: + block@0: // L7 + let expr_value_trimmed%1#0: bytes = ((extract 2 0) value#0) + let concatenated%2#0: bytes = (concat "echo: " expr_value_trimmed%1#0) + let len_%3#0: uint64 = (len concatenated%2#0) + let len_bytes%4#0: bytes = (itob len_%3#0) + let len_16_bit%5#0: bytes = ((extract 6 0) len_bytes%4#0) + let concat_result%6#0: bytes = (concat len_16_bit%5#0 concatenated%2#0) + return concat_result%6#0 + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: + block@0: // L11 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: + block@0: // L15 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: + block@0: // L19 + let tmp%0#0: bytes = ((extract 2 0) value#0) + (log tmp%0#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: + block@0: // L23 + let tmp%0#0: uint64 = (getbit value#0 0u) + goto tmp%0#0 ? block@1 : block@2 + block@1: // ternary_true_L25 + let ternary_result%1#0: bytes = "True" + goto block@3 + block@2: // ternary_false_L25 + let ternary_result%1#0: bytes = "False" + goto block@3 + block@3: // ternary_merge_L25 + (log ternary_result%1#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: + block@0: // L27 + let tmp%1#0: uint64 = (len value#0) + let tmp%3#0: uint64 = (< 2u tmp%1#0) + let tmp%4#0: uint64 = (select tmp%1#0 2u tmp%3#0) + let tmp%6#0: bytes = (substring3 value#0 tmp%4#0 tmp%1#0) + (log tmp%6#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: + block@0: // L31 + let (value%0#0: bytes, check%1#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%1#0) // asset exists + let tmp%3#0: bytes = (concat value%0#0 account#0) + let (value%5#0: bytes, check%6#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%6#0) // application exists + let tmp%7#0: bytes = (concat tmp%3#0 value%5#0) + (log tmp%7#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: + block@0: // L35 + let encoded_tuple_buffer%1#2: bytes = (concat a15#0 a16#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#2 a17#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#2 a18#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#2 a19#0) + let last_arg#0: bytes = (concat encoded_tuple_buffer%1#2 a20#0) + let tmp%2#0: bytes = (txna ApplicationArgs 15) + let tmp%3#0: uint64 = (== tmp%2#0 last_arg#0) + (assert tmp%3#0) + let length%4#0: uint64 = (len last_arg#0) + let value_as_bytes%5#0: bytes = (itob length%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let tmp%7#0: bytes = (concat value_as_uint16%6#0 last_arg#0) + return tmp%7#0 + + program clear-state: + subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Logger.ssa.ir b/test_cases/typed_abi_call/out/Logger.ssa.ir new file mode 100644 index 0000000000..48a2a06b30 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.ssa.ir @@ -0,0 +1,226 @@ +contract test_cases.typed_abi_call.logger.Logger: + program approval: + subroutine test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@12 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@10} + block@2: // echo_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (== tmp%2#0 NoOp) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: bytes = test_cases.typed_abi_call.logger.Logger.echo(tmp%5#0) + let tmp%7#0: bytes = (concat 0x151f7c75 tmp%6#0) + (log tmp%7#0) + return 1u + block@3: // log_uint64_route_L11 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (== tmp%8#0 NoOp) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint64(tmp%11#0) + return 1u + block@4: // log_uint512_route_L15 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (== tmp%12#0 NoOp) + (assert tmp%13#0) // OnCompletion is NoOp + let tmp%14#0: uint64 = (txn ApplicationID) + (assert tmp%14#0) // is not creating + let tmp%15#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint512(tmp%15#0) + return 1u + block@5: // log_string_route_L19 + let tmp%16#0: uint64 = (txn OnCompletion) + let tmp%17#0: uint64 = (== tmp%16#0 NoOp) + (assert tmp%17#0) // OnCompletion is NoOp + let tmp%18#0: uint64 = (txn ApplicationID) + (assert tmp%18#0) // is not creating + let tmp%19#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_string(tmp%19#0) + return 1u + block@6: // log_bool_route_L23 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (== tmp%20#0 NoOp) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bool(tmp%23#0) + return 1u + block@7: // log_bytes_route_L27 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 NoOp) + (assert tmp%25#0) // OnCompletion is NoOp + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + let tmp%27#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bytes(tmp%27#0) + return 1u + block@8: // log_asset_account_app_route_L31 + let tmp%28#0: uint64 = (txn OnCompletion) + let tmp%29#0: uint64 = (== tmp%28#0 NoOp) + (assert tmp%29#0) // OnCompletion is NoOp + let tmp%30#0: uint64 = (txn ApplicationID) + (assert tmp%30#0) // is not creating + let tmp%31#0: bytes = (txna ApplicationArgs 1) + let tmp%32#0: uint64 = (btoi tmp%31#0) + let tmp%33#0: uint64 = ((txnas Assets) tmp%32#0) + let tmp%34#0: bytes = (txna ApplicationArgs 2) + let tmp%35#0: uint64 = (btoi tmp%34#0) + let tmp%36#0: bytes = ((txnas Accounts) tmp%35#0) + let tmp%37#0: bytes = (txna ApplicationArgs 3) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Applications) tmp%38#0) + test_cases.typed_abi_call.logger.Logger.log_asset_account_app(tmp%33#0, tmp%36#0, tmp%39#0) + return 1u + block@9: // return_args_after_14th_route_L35 + let tmp%40#0: uint64 = (txn OnCompletion) + let tmp%41#0: uint64 = (== tmp%40#0 NoOp) + (assert tmp%41#0) // OnCompletion is NoOp + let tmp%42#0: uint64 = (txn ApplicationID) + (assert tmp%42#0) // is not creating + let tmp%43#0: bytes = (txna ApplicationArgs 1) + let tmp%44#0: bytes = (txna ApplicationArgs 2) + let tmp%45#0: bytes = (txna ApplicationArgs 3) + let tmp%46#0: bytes = (txna ApplicationArgs 4) + let tmp%47#0: bytes = (txna ApplicationArgs 5) + let tmp%48#0: bytes = (txna ApplicationArgs 6) + let tmp%49#0: bytes = (txna ApplicationArgs 7) + let tmp%50#0: bytes = (txna ApplicationArgs 8) + let tmp%51#0: bytes = (txna ApplicationArgs 9) + let tmp%52#0: bytes = (txna ApplicationArgs 10) + let tmp%53#0: bytes = (txna ApplicationArgs 11) + let tmp%54#0: bytes = (txna ApplicationArgs 12) + let tmp%55#0: bytes = (txna ApplicationArgs 13) + let tmp%56#0: bytes = (txna ApplicationArgs 14) + let tmp%57#0: bytes = (txna ApplicationArgs 15) + let tmp%58#0: bytes = (extract3 tmp%57#0 0u 1u) + let tmp%59#0: bytes = (txna ApplicationArgs 15) + let tmp%60#0: bytes = (extract3 tmp%59#0 1u 1u) + let tmp%61#0: bytes = (txna ApplicationArgs 15) + let tmp%62#0: bytes = (extract3 tmp%61#0 2u 1u) + let tmp%63#0: bytes = (txna ApplicationArgs 15) + let tmp%64#0: bytes = (extract3 tmp%63#0 3u 1u) + let tmp%65#0: bytes = (txna ApplicationArgs 15) + let tmp%66#0: bytes = (extract3 tmp%65#0 4u 4u) + let tmp%67#0: bytes = (txna ApplicationArgs 15) + let tmp%68#0: bytes = (extract3 tmp%67#0 8u 1u) + let tmp%69#0: bytes = test_cases.typed_abi_call.logger.Logger.return_args_after_14th(tmp%43#0, tmp%44#0, tmp%45#0, tmp%46#0, tmp%47#0, tmp%48#0, tmp%49#0, tmp%50#0, tmp%51#0, tmp%52#0, tmp%53#0, tmp%54#0, tmp%55#0, tmp%56#0, tmp%58#0, tmp%60#0, tmp%62#0, tmp%64#0, tmp%66#0, tmp%68#0) + let tmp%70#0: bytes = (concat 0x151f7c75 tmp%69#0) + (log tmp%70#0) + return 1u + block@10: // switch_case_default_L6 + goto block@11 + block@11: // switch_case_next_L6 + goto block@15 + block@12: // bare_routing_L6 + let tmp%71#0: uint64 = (txn OnCompletion) + switch tmp%71#0 {0u => block@13, * => block@14} + block@13: // create_L6 + let tmp%72#0: uint64 = (txn ApplicationID) + let tmp%73#0: uint64 = (! tmp%72#0) + (assert tmp%73#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L6 + fail // reject transaction + block@15: // after_if_else_L6 + fail // reject transaction + + subroutine test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: + block@0: // L7 + let expr_value_trimmed%0#0: bytes = ((extract 2 0) "\x00\x06echo: ") + let expr_value_trimmed%1#0: bytes = ((extract 2 0) value#0) + let concatenated%2#0: bytes = (concat expr_value_trimmed%0#0 expr_value_trimmed%1#0) + let len_%3#0: uint64 = (len concatenated%2#0) + let len_bytes%4#0: bytes = (itob len_%3#0) + let len_16_bit%5#0: bytes = ((extract 6 0) len_bytes%4#0) + let concat_result%6#0: bytes = (concat len_16_bit%5#0 concatenated%2#0) + return concat_result%6#0 + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: + block@0: // L11 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: + block@0: // L15 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: + block@0: // L19 + let tmp%0#0: bytes = ((extract 2 0) value#0) + (log tmp%0#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: + block@0: // L23 + let tmp%0#0: uint64 = (getbit value#0 0u) + goto tmp%0#0 ? block@1 : block@2 + block@1: // ternary_true_L25 + let ternary_result%1#0: bytes = "True" + goto block@3 + block@2: // ternary_false_L25 + let ternary_result%1#1: bytes = "False" + goto block@3 + block@3: // ternary_merge_L25 + let ternary_result%1#2: bytes = φ(ternary_result%1#0 <- block@1, ternary_result%1#1 <- block@2) + (log ternary_result%1#2) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: + block@0: // L27 + let awst_tmp%0#0: bytes = value#0 + let tmp%1#0: uint64 = (len awst_tmp%0#0) + let tmp%2#0: uint64 = (len awst_tmp%0#0) + let tmp%3#0: uint64 = (< 2u tmp%2#0) + let tmp%4#0: uint64 = (select tmp%1#0 2u tmp%3#0) + let base_length%5#0: uint64 = (len awst_tmp%0#0) + let tmp%6#0: bytes = (substring3 awst_tmp%0#0 tmp%4#0 base_length%5#0) + (log tmp%6#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: + block@0: // L31 + let (value%0#0: bytes, check%1#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%1#0) // asset exists + let tmp%2#0: bytes = (concat value%0#0 "") + let tmp%3#0: bytes = (concat tmp%2#0 account#0) + let tmp%4#0: bytes = (concat tmp%3#0 "") + let (value%5#0: bytes, check%6#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%6#0) // application exists + let tmp%7#0: bytes = (concat tmp%4#0 value%5#0) + (log tmp%7#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: + block@0: // L35 + let current_tail_offset%0#0: uint64 = 9u + let encoded_tuple_buffer%1#0: bytes = 0x + let encoded_tuple_buffer%1#1: bytes = (concat encoded_tuple_buffer%1#0 a15#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#1 a16#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#2 a17#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 a18#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 a19#0) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 a20#0) + let last_arg#0: bytes = encoded_tuple_buffer%1#6 + let tmp%2#0: bytes = (txna ApplicationArgs 15) + let tmp%3#0: uint64 = (== tmp%2#0 last_arg#0) + (assert tmp%3#0) + let length%4#0: uint64 = (len last_arg#0) + let value_as_bytes%5#0: bytes = (itob length%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let tmp%7#0: bytes = (concat value_as_uint16%6#0 last_arg#0) + return tmp%7#0 + + program clear-state: + subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Logger.ssa.opt_pass_1.ir b/test_cases/typed_abi_call/out/Logger.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..53ba9ef371 --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.ssa.opt_pass_1.ir @@ -0,0 +1,212 @@ +contract test_cases.typed_abi_call.logger.Logger: + program approval: + subroutine test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@12 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => fail // reject transaction} + block@2: // echo_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: bytes = test_cases.typed_abi_call.logger.Logger.echo(tmp%5#0) + let tmp%7#0: bytes = (concat 0x151f7c75 tmp%6#0) + (log tmp%7#0) + return 1u + block@3: // log_uint64_route_L11 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint64(tmp%11#0) + return 1u + block@4: // log_uint512_route_L15 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) // OnCompletion is NoOp + let tmp%14#0: uint64 = (txn ApplicationID) + (assert tmp%14#0) // is not creating + let tmp%15#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint512(tmp%15#0) + return 1u + block@5: // log_string_route_L19 + let tmp%16#0: uint64 = (txn OnCompletion) + let tmp%17#0: uint64 = (! tmp%16#0) + (assert tmp%17#0) // OnCompletion is NoOp + let tmp%18#0: uint64 = (txn ApplicationID) + (assert tmp%18#0) // is not creating + let tmp%19#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_string(tmp%19#0) + return 1u + block@6: // log_bool_route_L23 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bool(tmp%23#0) + return 1u + block@7: // log_bytes_route_L27 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (! tmp%24#0) + (assert tmp%25#0) // OnCompletion is NoOp + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + let tmp%27#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bytes(tmp%27#0) + return 1u + block@8: // log_asset_account_app_route_L31 + let tmp%28#0: uint64 = (txn OnCompletion) + let tmp%29#0: uint64 = (! tmp%28#0) + (assert tmp%29#0) // OnCompletion is NoOp + let tmp%30#0: uint64 = (txn ApplicationID) + (assert tmp%30#0) // is not creating + let tmp%31#0: bytes = (txna ApplicationArgs 1) + let tmp%32#0: uint64 = (btoi tmp%31#0) + let tmp%33#0: uint64 = ((txnas Assets) tmp%32#0) + let tmp%34#0: bytes = (txna ApplicationArgs 2) + let tmp%35#0: uint64 = (btoi tmp%34#0) + let tmp%36#0: bytes = ((txnas Accounts) tmp%35#0) + let tmp%37#0: bytes = (txna ApplicationArgs 3) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Applications) tmp%38#0) + test_cases.typed_abi_call.logger.Logger.log_asset_account_app(tmp%33#0, tmp%36#0, tmp%39#0) + return 1u + block@9: // return_args_after_14th_route_L35 + let tmp%40#0: uint64 = (txn OnCompletion) + let tmp%41#0: uint64 = (! tmp%40#0) + (assert tmp%41#0) // OnCompletion is NoOp + let tmp%42#0: uint64 = (txn ApplicationID) + (assert tmp%42#0) // is not creating + let tmp%43#0: bytes = (txna ApplicationArgs 1) + let tmp%44#0: bytes = (txna ApplicationArgs 2) + let tmp%45#0: bytes = (txna ApplicationArgs 3) + let tmp%46#0: bytes = (txna ApplicationArgs 4) + let tmp%47#0: bytes = (txna ApplicationArgs 5) + let tmp%48#0: bytes = (txna ApplicationArgs 6) + let tmp%49#0: bytes = (txna ApplicationArgs 7) + let tmp%50#0: bytes = (txna ApplicationArgs 8) + let tmp%51#0: bytes = (txna ApplicationArgs 9) + let tmp%52#0: bytes = (txna ApplicationArgs 10) + let tmp%53#0: bytes = (txna ApplicationArgs 11) + let tmp%54#0: bytes = (txna ApplicationArgs 12) + let tmp%55#0: bytes = (txna ApplicationArgs 13) + let tmp%56#0: bytes = (txna ApplicationArgs 14) + let tmp%57#0: bytes = (txna ApplicationArgs 15) + let tmp%58#0: bytes = ((extract 0 1) tmp%57#0) + let tmp%59#0: bytes = (txna ApplicationArgs 15) + let tmp%60#0: bytes = ((extract 1 1) tmp%59#0) + let tmp%61#0: bytes = (txna ApplicationArgs 15) + let tmp%62#0: bytes = ((extract 2 1) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 15) + let tmp%64#0: bytes = ((extract 3 1) tmp%63#0) + let tmp%65#0: bytes = (txna ApplicationArgs 15) + let tmp%66#0: bytes = ((extract 4 4) tmp%65#0) + let tmp%67#0: bytes = (txna ApplicationArgs 15) + let tmp%68#0: bytes = ((extract 8 1) tmp%67#0) + let tmp%69#0: bytes = test_cases.typed_abi_call.logger.Logger.return_args_after_14th(tmp%43#0, tmp%44#0, tmp%45#0, tmp%46#0, tmp%47#0, tmp%48#0, tmp%49#0, tmp%50#0, tmp%51#0, tmp%52#0, tmp%53#0, tmp%54#0, tmp%55#0, tmp%56#0, tmp%58#0, tmp%60#0, tmp%62#0, tmp%64#0, tmp%66#0, tmp%68#0) + let tmp%70#0: bytes = (concat 0x151f7c75 tmp%69#0) + (log tmp%70#0) + return 1u + block@12: // bare_routing_L6 + let tmp%71#0: uint64 = (txn OnCompletion) + let not%tmp%71#0: uint64 = (! tmp%71#0) + (assert not%tmp%71#0) // reject transaction + let tmp%72#0: uint64 = (txn ApplicationID) + let tmp%73#0: uint64 = (! tmp%72#0) + (assert tmp%73#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: + block@0: // L7 + let expr_value_trimmed%0#0: bytes = "echo: " + let expr_value_trimmed%1#0: bytes = ((extract 2 0) value#0) + let concatenated%2#0: bytes = (concat expr_value_trimmed%0#0 expr_value_trimmed%1#0) + let len_%3#0: uint64 = (len concatenated%2#0) + let len_bytes%4#0: bytes = (itob len_%3#0) + let len_16_bit%5#0: bytes = ((extract 6 0) len_bytes%4#0) + let concat_result%6#0: bytes = (concat len_16_bit%5#0 concatenated%2#0) + return concat_result%6#0 + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: + block@0: // L11 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: + block@0: // L15 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: + block@0: // L19 + let tmp%0#0: bytes = ((extract 2 0) value#0) + (log tmp%0#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: + block@0: // L23 + let tmp%0#0: uint64 = (getbit value#0 0u) + goto tmp%0#0 ? block@1 : block@2 + block@1: // ternary_true_L25 + let ternary_result%1#0: bytes = "True" + goto block@3 + block@2: // ternary_false_L25 + let ternary_result%1#1: bytes = "False" + goto block@3 + block@3: // ternary_merge_L25 + let ternary_result%1#2: bytes = φ(ternary_result%1#0 <- block@1, ternary_result%1#1 <- block@2) + (log ternary_result%1#2) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: + block@0: // L27 + let tmp%1#0: uint64 = (len value#0) + let tmp%3#0: uint64 = (< 2u tmp%1#0) + let tmp%4#0: uint64 = (select tmp%1#0 2u tmp%3#0) + let tmp%6#0: bytes = (substring3 value#0 tmp%4#0 tmp%1#0) + (log tmp%6#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: + block@0: // L31 + let (value%0#0: bytes, check%1#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%1#0) // asset exists + let tmp%2#0: bytes = value%0#0 + let tmp%3#0: bytes = (concat tmp%2#0 account#0) + let tmp%4#0: bytes = tmp%3#0 + let (value%5#0: bytes, check%6#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%6#0) // application exists + let tmp%7#0: bytes = (concat tmp%4#0 value%5#0) + (log tmp%7#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: + block@0: // L35 + let encoded_tuple_buffer%1#1: bytes = a15#0 + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#1 a16#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#2 a17#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 a18#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 a19#0) + let last_arg#0: bytes = (concat encoded_tuple_buffer%1#5 a20#0) + let tmp%2#0: bytes = (txna ApplicationArgs 15) + let tmp%3#0: uint64 = (== tmp%2#0 last_arg#0) + (assert tmp%3#0) + let length%4#0: uint64 = (len last_arg#0) + let value_as_bytes%5#0: bytes = (itob length%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let tmp%7#0: bytes = (concat value_as_uint16%6#0 last_arg#0) + return tmp%7#0 + + program clear-state: + subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/Logger.ssa.opt_pass_2.ir b/test_cases/typed_abi_call/out/Logger.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..3e01f0280c --- /dev/null +++ b/test_cases/typed_abi_call/out/Logger.ssa.opt_pass_2.ir @@ -0,0 +1,208 @@ +contract test_cases.typed_abi_call.logger.Logger: + program approval: + subroutine test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@12 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => fail // reject transaction} + block@2: // echo_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: bytes = test_cases.typed_abi_call.logger.Logger.echo(tmp%5#0) + let tmp%7#0: bytes = (concat 0x151f7c75 tmp%6#0) + (log tmp%7#0) + return 1u + block@3: // log_uint64_route_L11 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint64(tmp%11#0) + return 1u + block@4: // log_uint512_route_L15 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) // OnCompletion is NoOp + let tmp%14#0: uint64 = (txn ApplicationID) + (assert tmp%14#0) // is not creating + let tmp%15#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint512(tmp%15#0) + return 1u + block@5: // log_string_route_L19 + let tmp%16#0: uint64 = (txn OnCompletion) + let tmp%17#0: uint64 = (! tmp%16#0) + (assert tmp%17#0) // OnCompletion is NoOp + let tmp%18#0: uint64 = (txn ApplicationID) + (assert tmp%18#0) // is not creating + let tmp%19#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_string(tmp%19#0) + return 1u + block@6: // log_bool_route_L23 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bool(tmp%23#0) + return 1u + block@7: // log_bytes_route_L27 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (! tmp%24#0) + (assert tmp%25#0) // OnCompletion is NoOp + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + let tmp%27#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bytes(tmp%27#0) + return 1u + block@8: // log_asset_account_app_route_L31 + let tmp%28#0: uint64 = (txn OnCompletion) + let tmp%29#0: uint64 = (! tmp%28#0) + (assert tmp%29#0) // OnCompletion is NoOp + let tmp%30#0: uint64 = (txn ApplicationID) + (assert tmp%30#0) // is not creating + let tmp%31#0: bytes = (txna ApplicationArgs 1) + let tmp%32#0: uint64 = (btoi tmp%31#0) + let tmp%33#0: uint64 = ((txnas Assets) tmp%32#0) + let tmp%34#0: bytes = (txna ApplicationArgs 2) + let tmp%35#0: uint64 = (btoi tmp%34#0) + let tmp%36#0: bytes = ((txnas Accounts) tmp%35#0) + let tmp%37#0: bytes = (txna ApplicationArgs 3) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Applications) tmp%38#0) + test_cases.typed_abi_call.logger.Logger.log_asset_account_app(tmp%33#0, tmp%36#0, tmp%39#0) + return 1u + block@9: // return_args_after_14th_route_L35 + let tmp%40#0: uint64 = (txn OnCompletion) + let tmp%41#0: uint64 = (! tmp%40#0) + (assert tmp%41#0) // OnCompletion is NoOp + let tmp%42#0: uint64 = (txn ApplicationID) + (assert tmp%42#0) // is not creating + let tmp%43#0: bytes = (txna ApplicationArgs 1) + let tmp%44#0: bytes = (txna ApplicationArgs 2) + let tmp%45#0: bytes = (txna ApplicationArgs 3) + let tmp%46#0: bytes = (txna ApplicationArgs 4) + let tmp%47#0: bytes = (txna ApplicationArgs 5) + let tmp%48#0: bytes = (txna ApplicationArgs 6) + let tmp%49#0: bytes = (txna ApplicationArgs 7) + let tmp%50#0: bytes = (txna ApplicationArgs 8) + let tmp%51#0: bytes = (txna ApplicationArgs 9) + let tmp%52#0: bytes = (txna ApplicationArgs 10) + let tmp%53#0: bytes = (txna ApplicationArgs 11) + let tmp%54#0: bytes = (txna ApplicationArgs 12) + let tmp%55#0: bytes = (txna ApplicationArgs 13) + let tmp%56#0: bytes = (txna ApplicationArgs 14) + let tmp%57#0: bytes = (txna ApplicationArgs 15) + let tmp%58#0: bytes = ((extract 0 1) tmp%57#0) + let tmp%59#0: bytes = (txna ApplicationArgs 15) + let tmp%60#0: bytes = ((extract 1 1) tmp%59#0) + let tmp%61#0: bytes = (txna ApplicationArgs 15) + let tmp%62#0: bytes = ((extract 2 1) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 15) + let tmp%64#0: bytes = ((extract 3 1) tmp%63#0) + let tmp%65#0: bytes = (txna ApplicationArgs 15) + let tmp%66#0: bytes = ((extract 4 4) tmp%65#0) + let tmp%67#0: bytes = (txna ApplicationArgs 15) + let tmp%68#0: bytes = ((extract 8 1) tmp%67#0) + let tmp%69#0: bytes = test_cases.typed_abi_call.logger.Logger.return_args_after_14th(tmp%43#0, tmp%44#0, tmp%45#0, tmp%46#0, tmp%47#0, tmp%48#0, tmp%49#0, tmp%50#0, tmp%51#0, tmp%52#0, tmp%53#0, tmp%54#0, tmp%55#0, tmp%56#0, tmp%58#0, tmp%60#0, tmp%62#0, tmp%64#0, tmp%66#0, tmp%68#0) + let tmp%70#0: bytes = (concat 0x151f7c75 tmp%69#0) + (log tmp%70#0) + return 1u + block@12: // bare_routing_L6 + let tmp%71#0: uint64 = (txn OnCompletion) + let not%tmp%71#0: uint64 = (! tmp%71#0) + (assert not%tmp%71#0) // reject transaction + let tmp%72#0: uint64 = (txn ApplicationID) + let tmp%73#0: uint64 = (! tmp%72#0) + (assert tmp%73#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: + block@0: // L7 + let expr_value_trimmed%1#0: bytes = ((extract 2 0) value#0) + let concatenated%2#0: bytes = (concat "echo: " expr_value_trimmed%1#0) + let len_%3#0: uint64 = (len concatenated%2#0) + let len_bytes%4#0: bytes = (itob len_%3#0) + let len_16_bit%5#0: bytes = ((extract 6 0) len_bytes%4#0) + let concat_result%6#0: bytes = (concat len_16_bit%5#0 concatenated%2#0) + return concat_result%6#0 + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: + block@0: // L11 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: + block@0: // L15 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: + block@0: // L19 + let tmp%0#0: bytes = ((extract 2 0) value#0) + (log tmp%0#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: + block@0: // L23 + let tmp%0#0: uint64 = (getbit value#0 0u) + goto tmp%0#0 ? block@1 : block@2 + block@1: // ternary_true_L25 + let ternary_result%1#0: bytes = "True" + goto block@3 + block@2: // ternary_false_L25 + let ternary_result%1#1: bytes = "False" + goto block@3 + block@3: // ternary_merge_L25 + let ternary_result%1#2: bytes = φ(ternary_result%1#0 <- block@1, ternary_result%1#1 <- block@2) + (log ternary_result%1#2) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: + block@0: // L27 + let tmp%1#0: uint64 = (len value#0) + let tmp%3#0: uint64 = (< 2u tmp%1#0) + let tmp%4#0: uint64 = (select tmp%1#0 2u tmp%3#0) + let tmp%6#0: bytes = (substring3 value#0 tmp%4#0 tmp%1#0) + (log tmp%6#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: + block@0: // L31 + let (value%0#0: bytes, check%1#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%1#0) // asset exists + let tmp%3#0: bytes = (concat value%0#0 account#0) + let (value%5#0: bytes, check%6#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%6#0) // application exists + let tmp%7#0: bytes = (concat tmp%3#0 value%5#0) + (log tmp%7#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: + block@0: // L35 + let encoded_tuple_buffer%1#2: bytes = (concat a15#0 a16#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#2 a17#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 a18#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 a19#0) + let last_arg#0: bytes = (concat encoded_tuple_buffer%1#5 a20#0) + let tmp%2#0: bytes = (txna ApplicationArgs 15) + let tmp%3#0: uint64 = (== tmp%2#0 last_arg#0) + (assert tmp%3#0) + let length%4#0: uint64 = (len last_arg#0) + let value_as_bytes%5#0: bytes = (itob length%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let tmp%7#0: bytes = (concat value_as_uint16%6#0 last_arg#0) + return tmp%7#0 + + program clear-state: + subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/client_Greeter.py b/test_cases/typed_abi_call/out/client_Greeter.py new file mode 100644 index 0000000000..5c0de94d3e --- /dev/null +++ b/test_cases/typed_abi_call/out/client_Greeter.py @@ -0,0 +1,39 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Greeter(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def test_method_selector_kinds( + self, + app: puyapy.Application, + ) -> None: ... + + @puyapy.arc4.abimethod + def test_arg_conversion( + self, + app: puyapy.Application, + ) -> None: ... + + @puyapy.arc4.abimethod + def test_15plus_args( + self, + app: puyapy.Application, + ) -> None: ... + + @puyapy.arc4.abimethod + def test_void( + self, + app: puyapy.Application, + ) -> None: ... + + @puyapy.arc4.abimethod + def test_ref_types( + self, + app: puyapy.Application, + asset: puyapy.Asset, + ) -> None: ... diff --git a/test_cases/typed_abi_call/out/client_Logger.py b/test_cases/typed_abi_call/out/client_Logger.py new file mode 100644 index 0000000000..04f5817c9e --- /dev/null +++ b/test_cases/typed_abi_call/out/client_Logger.py @@ -0,0 +1,77 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import puyapy + + +class Logger(puyapy.arc4.ARC4Client, typing.Protocol): + @puyapy.arc4.abimethod + def echo( + self, + value: puyapy.arc4.String, + ) -> puyapy.arc4.String: ... + + @puyapy.arc4.abimethod + def log_uint64( + self, + value: puyapy.arc4.UInt64, + ) -> None: ... + + @puyapy.arc4.abimethod + def log_uint512( + self, + value: puyapy.arc4.UInt512, + ) -> None: ... + + @puyapy.arc4.abimethod + def log_string( + self, + value: puyapy.arc4.String, + ) -> None: ... + + @puyapy.arc4.abimethod + def log_bool( + self, + value: puyapy.arc4.Bool, + ) -> None: ... + + @puyapy.arc4.abimethod + def log_bytes( + self, + value: puyapy.arc4.DynamicBytes, + ) -> None: ... + + @puyapy.arc4.abimethod + def log_asset_account_app( + self, + asset: puyapy.Asset, + account: puyapy.Account, + app: puyapy.Application, + ) -> None: ... + + @puyapy.arc4.abimethod + def return_args_after_14th( + self, + _a1: puyapy.arc4.UInt64, + _a2: puyapy.arc4.UInt64, + _a3: puyapy.arc4.UInt64, + _a4: puyapy.arc4.UInt64, + _a5: puyapy.arc4.UInt64, + _a6: puyapy.arc4.UInt64, + _a7: puyapy.arc4.UInt64, + _a8: puyapy.arc4.UInt64, + _a9: puyapy.arc4.UInt64, + _a10: puyapy.arc4.UInt64, + _a11: puyapy.arc4.UInt64, + _a12: puyapy.arc4.UInt64, + _a13: puyapy.arc4.UInt64, + _a14: puyapy.arc4.UInt64, + a15: puyapy.arc4.UInt8, + a16: puyapy.arc4.UInt8, + a17: puyapy.arc4.UInt8, + a18: puyapy.arc4.UInt8, + a19: puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], + a20: puyapy.arc4.UInt8, + ) -> puyapy.arc4.DynamicBytes: ... diff --git a/test_cases/typed_abi_call/out/logger.awst b/test_cases/typed_abi_call/out/logger.awst new file mode 100644 index 0000000000..8b43c1d38d --- /dev/null +++ b/test_cases/typed_abi_call/out/logger.awst @@ -0,0 +1,44 @@ +contract Logger +{ + abimethod echo(value: puyapy.arc4.String): puyapy.arc4.String + { + return arc4_encode('echo: ', puyapy.arc4.String) + value + } + + abimethod log_uint64(value: puyapy.arc4.UInt64): None + { + log(value) + } + + abimethod log_uint512(value: puyapy.arc4.UInt512): None + { + log(value) + } + + abimethod log_string(value: puyapy.arc4.String): None + { + log(arc4_decode(value, puyapy.Bytes)) + } + + abimethod log_bool(value: puyapy.arc4.Bool): None + { + log((arc4_decode(value, bool)) ? ('True') : ('False')) + } + + abimethod log_bytes(value: puyapy.arc4.DynamicBytes): None + { + log(SINGLE_EVAL(id=0, source=reinterpret_cast(value))[select(len(SINGLE_EVAL(id=0, source=reinterpret_cast(value))), 2u, 2u < len(SINGLE_EVAL(id=0, source=reinterpret_cast(value)))):]) + } + + abimethod log_asset_account_app(asset: puyapy.Asset, account: puyapy.Account, app: puyapy.Application): None + { + log(concat(concat(concat(concat(checked_maybe(asset_params_get(asset)), ''), reinterpret_cast(account)), ''), checked_maybe(app_params_get(app)))) + } + + abimethod return_args_after_14th(_a1: puyapy.arc4.UInt64, _a2: puyapy.arc4.UInt64, _a3: puyapy.arc4.UInt64, _a4: puyapy.arc4.UInt64, _a5: puyapy.arc4.UInt64, _a6: puyapy.arc4.UInt64, _a7: puyapy.arc4.UInt64, _a8: puyapy.arc4.UInt64, _a9: puyapy.arc4.UInt64, _a10: puyapy.arc4.UInt64, _a11: puyapy.arc4.UInt64, _a12: puyapy.arc4.UInt64, _a13: puyapy.arc4.UInt64, _a14: puyapy.arc4.UInt64, a15: puyapy.arc4.UInt8, a16: puyapy.arc4.UInt8, a17: puyapy.arc4.UInt8, a18: puyapy.arc4.UInt8, a19: puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], a20: puyapy.arc4.UInt8): puyapy.arc4.DynamicBytes + { + last_arg: puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], puyapy.arc4.UInt8] = arc4_encode((a15, a16, a17, a18, a19, a20), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], puyapy.arc4.UInt8]) + assert(txna() == reinterpret_cast(last_arg)) + return arc4_encode(reinterpret_cast(last_arg), puyapy.arc4.DynamicBytes) + } +} \ No newline at end of file diff --git a/test_cases/typed_abi_call/out/typed_c2c.awst b/test_cases/typed_abi_call/out/typed_c2c.awst new file mode 100644 index 0000000000..fd231a580f --- /dev/null +++ b/test_cases/typed_abi_call/out/typed_c2c.awst @@ -0,0 +1,54 @@ +contract Greeter +{ + abimethod test_method_selector_kinds(app: puyapy.Application): None + { + (result, _txn): tuple[puyapy.arc4.String, puyapy.itxn.ApplicationCallInnerTransaction] = (reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=0, source=SINGLE_EVAL(id=1, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test1', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)), extract<0, 4>(SINGLE_EVAL(id=0, source=SINGLE_EVAL(id=1, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test1', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)) == hex<"151F7C75">))), SINGLE_EVAL(id=1, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test1', puyapy.arc4.String)), ApplicationID=app, Fee=0u)))) + assert(reinterpret_cast(result) == reinterpret_cast(arc4_encode('echo: test1', puyapy.arc4.String))) + (result, _txn): tuple[puyapy.arc4.String, puyapy.itxn.ApplicationCallInnerTransaction] = (reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=2, source=SINGLE_EVAL(id=3, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test2', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)), extract<0, 4>(SINGLE_EVAL(id=2, source=SINGLE_EVAL(id=3, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test2', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)) == hex<"151F7C75">))), SINGLE_EVAL(id=3, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test2', puyapy.arc4.String)), ApplicationID=app, Fee=0u)))) + assert(reinterpret_cast(result) == reinterpret_cast(arc4_encode('echo: test2', puyapy.arc4.String))) + (result, _txn): tuple[puyapy.arc4.String, puyapy.itxn.ApplicationCallInnerTransaction] = (reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=4, source=SINGLE_EVAL(id=5, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test3', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)), extract<0, 4>(SINGLE_EVAL(id=4, source=SINGLE_EVAL(id=5, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test3', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)) == hex<"151F7C75">))), SINGLE_EVAL(id=5, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test3', puyapy.arc4.String)), ApplicationID=app, Fee=0u)))) + assert(reinterpret_cast(result) == reinterpret_cast(arc4_encode('echo: test3', puyapy.arc4.String))) + (result, _txn): tuple[puyapy.arc4.String, puyapy.itxn.ApplicationCallInnerTransaction] = (reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=6, source=SINGLE_EVAL(id=7, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test4', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)), extract<0, 4>(SINGLE_EVAL(id=6, source=SINGLE_EVAL(id=7, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test4', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)) == hex<"151F7C75">))), SINGLE_EVAL(id=7, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test4', puyapy.arc4.String)), ApplicationID=app, Fee=0u)))) + assert(reinterpret_cast(result) == reinterpret_cast(arc4_encode('echo: test4', puyapy.arc4.String))) + (result, _txn): tuple[puyapy.arc4.String, puyapy.itxn.ApplicationCallInnerTransaction] = (reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=8, source=SINGLE_EVAL(id=9, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test5', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)), extract<0, 4>(SINGLE_EVAL(id=8, source=SINGLE_EVAL(id=9, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test5', puyapy.arc4.String)), ApplicationID=app, Fee=0u))).LastLog)) == hex<"151F7C75">))), SINGLE_EVAL(id=9, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("echo(string)string"), arc4_encode('test5', puyapy.arc4.String)), ApplicationID=app, Fee=0u)))) + assert(reinterpret_cast(result) == reinterpret_cast(arc4_encode('echo: test5', puyapy.arc4.String))) + } + + abimethod test_arg_conversion(app: puyapy.Application): None + { + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_string(string)void"), arc4_encode('converted1', puyapy.arc4.String)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == 'converted1') + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_uint64(uint64)void"), 2arc4u64), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == itob(2u)) + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_uint512(uint512)void"), 3arc4n512), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == bzero(56u) + itob(3u)) + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_bytes(byte[])void"), arc4_encode(hex<"34">, puyapy.arc4.DynamicBytes)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == '4') + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_bool(bool)void"), arc4_encode(true, puyapy.arc4.Bool)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == 'True') + } + + abimethod test_15plus_args(app: puyapy.Application): None + { + (result, txn): tuple[puyapy.arc4.DynamicBytes, puyapy.itxn.ApplicationCallInnerTransaction] = (reinterpret_cast(checked_maybe((extract<4, 0>(SINGLE_EVAL(id=10, source=SINGLE_EVAL(id=11, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]"), 1arc4u64, 2arc4u64, 3arc4u64, 4arc4u64, 5arc4u64, 6arc4u64, 7arc4u64, 8arc4u64, 9arc4u64, 10arc4u64, 11arc4u64, 12arc4u64, 13arc4u64, 14arc4u64, arc4_encode((15arc4u8, 16arc4u8, 17arc4u8, 18arc4u8, arc4_encode((222arc4u8, 173arc4u8, 190arc4u8, 239arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8]), 20arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], puyapy.arc4.UInt8])), ApplicationID=app, Fee=0u))).LastLog)), extract<0, 4>(SINGLE_EVAL(id=10, source=SINGLE_EVAL(id=11, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]"), 1arc4u64, 2arc4u64, 3arc4u64, 4arc4u64, 5arc4u64, 6arc4u64, 7arc4u64, 8arc4u64, 9arc4u64, 10arc4u64, 11arc4u64, 12arc4u64, 13arc4u64, 14arc4u64, arc4_encode((15arc4u8, 16arc4u8, 17arc4u8, 18arc4u8, arc4_encode((222arc4u8, 173arc4u8, 190arc4u8, 239arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8]), 20arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], puyapy.arc4.UInt8])), ApplicationID=app, Fee=0u))).LastLog)) == hex<"151F7C75">))), SINGLE_EVAL(id=11, source=submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]"), 1arc4u64, 2arc4u64, 3arc4u64, 4arc4u64, 5arc4u64, 6arc4u64, 7arc4u64, 8arc4u64, 9arc4u64, 10arc4u64, 11arc4u64, 12arc4u64, 13arc4u64, 14arc4u64, arc4_encode((15arc4u8, 16arc4u8, 17arc4u8, 18arc4u8, arc4_encode((222arc4u8, 173arc4u8, 190arc4u8, 239arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8]), 20arc4u8), puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.Tuple[puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8, puyapy.arc4.UInt8], puyapy.arc4.UInt8])), ApplicationID=app, Fee=0u)))) + assert(arc4_decode(result, puyapy.Bytes) == hex<"0F101112DEADBEEF14">) + } + + abimethod test_void(app: puyapy.Application): None + { + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_string(string)void"), arc4_encode('World1', puyapy.arc4.String)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == 'World1') + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_string(string)void"), arc4_encode('World2', puyapy.arc4.String)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == 'World2') + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_string(string)void"), arc4_encode('World3', puyapy.arc4.String)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == 'World3') + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_string(string)void"), arc4_encode('World4', puyapy.arc4.String)), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == 'World4') + } + + abimethod test_ref_types(app: puyapy.Application, asset: puyapy.Asset): None + { + txn: puyapy.itxn.ApplicationCallInnerTransaction = submit_txn(create_inner_transaction(TypeEnum=appl, ApplicationArgs=(Method("log_asset_account_app(asset,account,application)void"), hex<"00">, hex<"01">, hex<"01">), Accounts=(global()), Applications=(app), Assets=(asset), ApplicationID=app, Fee=0u)) + assert(txn.LastLog == checked_maybe(asset_params_get(asset)) + reinterpret_cast(global()) + reinterpret_cast(checked_maybe(app_params_get(app)))) + } +} \ No newline at end of file diff --git a/test_cases/typed_abi_call/out_O2/Greeter.approval.teal b/test_cases/typed_abi_call/out_O2/Greeter.approval.teal new file mode 100644 index 0000000000..1255df3be9 --- /dev/null +++ b/test_cases/typed_abi_call/out_O2/Greeter.approval.teal @@ -0,0 +1,467 @@ +#pragma version 10 + +test_cases.typed_abi_call.typed_c2c.Greeter.approval_program: + txn NumAppArgs + bz main_bare_routing@9 + method "test_method_selector_kinds(application)void" + method "test_arg_conversion(application)void" + method "test_15plus_args(application)void" + method "test_void(application)void" + method "test_ref_types(application,asset)void" + txna ApplicationArgs 0 + match main_test_method_selector_kinds_route@2 main_test_arg_conversion_route@3 main_test_15plus_args_route@4 main_test_void_route@5 main_test_ref_types_route@6 + err // reject transaction + +main_test_method_selector_kinds_route@2: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Applications + callsub test_method_selector_kinds + int 1 + return + +main_test_arg_conversion_route@3: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Applications + callsub test_arg_conversion + int 1 + return + +main_test_15plus_args_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Applications + callsub test_15plus_args + int 1 + return + +main_test_void_route@5: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Applications + callsub test_void + int 1 + return + +main_test_ref_types_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Applications + txna ApplicationArgs 2 + btoi + txnas Assets + callsub test_ref_types + int 1 + return + +main_bare_routing@9: + txn OnCompletion + ! + assert // reject transaction + txn ApplicationID + ! + assert // is creating + int 1 + return + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: +test_method_selector_kinds: + proto 1 0 + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test1" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + byte "\x00\x0becho: test1" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test2" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + byte "\x00\x0becho: test2" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test3" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + byte "\x00\x0becho: test3" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test4" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + byte "\x00\x0becho: test4" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "echo(string)string" + itxn_field ApplicationArgs + byte "\x00\x05test5" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + byte "\x00\x0becho: test5" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: +test_arg_conversion: + proto 1 0 + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\nconverted1" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "converted1" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_uint64(uint64)void" + itxn_field ApplicationArgs + byte 0x0000000000000002 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + int 2 + itob + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_uint512(uint512)void" + itxn_field ApplicationArgs + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_bytes(byte[])void" + itxn_field ApplicationArgs + byte 0x000134 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "4" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_bool(bool)void" + itxn_field ApplicationArgs + byte 0x80 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "True" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: +test_15plus_args: + proto 1 0 + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + itxn_field ApplicationArgs + byte 0x0000000000000001 + itxn_field ApplicationArgs + byte 0x0000000000000002 + itxn_field ApplicationArgs + byte 0x0000000000000003 + itxn_field ApplicationArgs + byte 0x0000000000000004 + itxn_field ApplicationArgs + byte 0x0000000000000005 + itxn_field ApplicationArgs + byte 0x0000000000000006 + itxn_field ApplicationArgs + byte 0x0000000000000007 + itxn_field ApplicationArgs + byte 0x0000000000000008 + itxn_field ApplicationArgs + byte 0x0000000000000009 + itxn_field ApplicationArgs + byte 0x000000000000000a + itxn_field ApplicationArgs + byte 0x000000000000000b + itxn_field ApplicationArgs + byte 0x000000000000000c + itxn_field ApplicationArgs + byte 0x000000000000000d + itxn_field ApplicationArgs + byte 0x000000000000000e + itxn_field ApplicationArgs + byte 0x0f101112deadbeef14 + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + extract 2 0 + byte 0x0f101112deadbeef14 + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: +test_void: + proto 1 0 + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World1" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "World1" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World2" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "World2" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World3" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "World3" + == + assert + itxn_begin + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field ApplicationID + method "log_string(string)void" + itxn_field ApplicationArgs + byte "\x00\x06World4" + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + byte "World4" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: +test_ref_types: + proto 2 0 + itxn_begin + global CurrentApplicationAddress + int appl + itxn_field TypeEnum + int 0 + itxn_field Fee + frame_dig -1 + itxn_field Assets + frame_dig -2 + itxn_field Applications + frame_dig -2 + itxn_field ApplicationID + method "log_asset_account_app(asset,account,application)void" + itxn_field ApplicationArgs + byte 0x00 + itxn_field ApplicationArgs + byte 0x01 + itxn_field ApplicationArgs + byte 0x01 + itxn_field ApplicationArgs + itxn_field Accounts + itxn_submit + itxn LastLog + frame_dig -1 + asset_params_get AssetName + assert // asset exists + global CurrentApplicationAddress + concat + frame_dig -2 + app_params_get AppAddress + assert // application exists + concat + == + assert + retsub diff --git a/test_cases/typed_abi_call/out_O2/Greeter.clear.teal b/test_cases/typed_abi_call/out_O2/Greeter.clear.teal new file mode 100644 index 0000000000..bbc515d343 --- /dev/null +++ b/test_cases/typed_abi_call/out_O2/Greeter.clear.teal @@ -0,0 +1,5 @@ +#pragma version 10 + +test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program: + int 1 + return diff --git a/test_cases/typed_abi_call/out_O2/Greeter.destructured.ir b/test_cases/typed_abi_call/out_O2/Greeter.destructured.ir new file mode 100644 index 0000000000..ff0dce0af3 --- /dev/null +++ b/test_cases/typed_abi_call/out_O2/Greeter.destructured.ir @@ -0,0 +1,313 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (! tmp%14#0) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (! tmp%26#0) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + let not%tmp%35#0: uint64 = (! tmp%35#0) + (assert not%tmp%35#0) // reject transaction + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test1") + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%3#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + (assert tmp%4#0) // ARC4 prefix is valid + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test2") + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_1%%LastLog#0) + let tmp%11#0: bytes = ((extract 0 4) tmp_itxn_1%%LastLog#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + (assert tmp%12#0) // ARC4 prefix is valid + let tmp%15#0: uint64 = (== result#0 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test3") + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_2%%LastLog#0) + let tmp%19#0: bytes = ((extract 0 4) tmp_itxn_2%%LastLog#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + (assert tmp%20#0) // ARC4 prefix is valid + let tmp%23#0: uint64 = (== result#0 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test4") + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_3%%LastLog#0) + let tmp%27#0: bytes = ((extract 0 4) tmp_itxn_3%%LastLog#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + (assert tmp%28#0) // ARC4 prefix is valid + let tmp%31#0: uint64 = (== result#0 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "echo(string)string") + ((itxn_field ApplicationArgs) "\x00\x05test5") + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_4%%LastLog#0) + let tmp%35#0: bytes = ((extract 0 4) tmp_itxn_4%%LastLog#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + (assert tmp%36#0) // ARC4 prefix is valid + let tmp%39#0: uint64 = (== result#0 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\nconverted1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint64(uint64)void") + ((itxn_field ApplicationArgs) 0x0000000000000002) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#0 tmp%3#0) + (assert tmp%4#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_uint512(uint512)void") + ((itxn_field ApplicationArgs) 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%9#0: uint64 = (== txn%%LastLog#0 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003) + (assert tmp%9#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bytes(byte[])void") + ((itxn_field ApplicationArgs) 0x000134) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#0 "4") + (assert tmp%11#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_bool(bool)void") + ((itxn_field ApplicationArgs) 0x80) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#0 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]") + ((itxn_field ApplicationArgs) 0x0000000000000001) + ((itxn_field ApplicationArgs) 0x0000000000000002) + ((itxn_field ApplicationArgs) 0x0000000000000003) + ((itxn_field ApplicationArgs) 0x0000000000000004) + ((itxn_field ApplicationArgs) 0x0000000000000005) + ((itxn_field ApplicationArgs) 0x0000000000000006) + ((itxn_field ApplicationArgs) 0x0000000000000007) + ((itxn_field ApplicationArgs) 0x0000000000000008) + ((itxn_field ApplicationArgs) 0x0000000000000009) + ((itxn_field ApplicationArgs) 0x000000000000000a) + ((itxn_field ApplicationArgs) 0x000000000000000b) + ((itxn_field ApplicationArgs) 0x000000000000000c) + ((itxn_field ApplicationArgs) 0x000000000000000d) + ((itxn_field ApplicationArgs) 0x000000000000000e) + ((itxn_field ApplicationArgs) 0x0f101112deadbeef14) + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let result#0: bytes = ((extract 4 0) tmp_itxn_0%%LastLog#0) + let tmp%7#0: bytes = ((extract 0 4) tmp_itxn_0%%LastLog#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + (assert tmp%8#0) // ARC4 prefix is valid + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World1") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World2") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#0 "World2") + (assert tmp%3#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World3") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#0 "World3") + (assert tmp%5#0) + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_string(string)void") + ((itxn_field ApplicationArgs) "\x00\x06World4") + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#0 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + ((itxn_field TypeEnum) appl) + ((itxn_field Fee) 0u) + ((itxn_field Assets) asset#0) + ((itxn_field Applications) app#0) + ((itxn_field ApplicationID) app#0) + ((itxn_field ApplicationArgs) method "log_asset_account_app(asset,account,application)void") + ((itxn_field ApplicationArgs) 0x00) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field ApplicationArgs) 0x01) + ((itxn_field Accounts) tmp%1#0) + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out_O2/Logger.approval.teal b/test_cases/typed_abi_call/out_O2/Logger.approval.teal new file mode 100644 index 0000000000..dcc677d7b0 --- /dev/null +++ b/test_cases/typed_abi_call/out_O2/Logger.approval.teal @@ -0,0 +1,279 @@ +#pragma version 10 + +test_cases.typed_abi_call.logger.Logger.approval_program: + txn NumAppArgs + bz main_bare_routing@12 + method "echo(string)string" + method "log_uint64(uint64)void" + method "log_uint512(uint512)void" + method "log_string(string)void" + method "log_bool(bool)void" + method "log_bytes(byte[])void" + method "log_asset_account_app(asset,account,application)void" + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + txna ApplicationArgs 0 + match main_echo_route@2 main_log_uint64_route@3 main_log_uint512_route@4 main_log_string_route@5 main_log_bool_route@6 main_log_bytes_route@7 main_log_asset_account_app_route@8 main_return_args_after_14th_route@9 + err // reject transaction + +main_echo_route@2: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub echo + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_log_uint64_route@3: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub log_uint64 + int 1 + return + +main_log_uint512_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub log_uint512 + int 1 + return + +main_log_string_route@5: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub log_string + int 1 + return + +main_log_bool_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub log_bool + int 1 + return + +main_log_bytes_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub log_bytes + int 1 + return + +main_log_asset_account_app_route@8: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Accounts + txna ApplicationArgs 3 + btoi + txnas Applications + callsub log_asset_account_app + int 1 + return + +main_return_args_after_14th_route@9: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + txna ApplicationArgs 2 + txna ApplicationArgs 3 + txna ApplicationArgs 4 + txna ApplicationArgs 5 + txna ApplicationArgs 6 + txna ApplicationArgs 7 + txna ApplicationArgs 8 + txna ApplicationArgs 9 + txna ApplicationArgs 10 + txna ApplicationArgs 11 + txna ApplicationArgs 12 + txna ApplicationArgs 13 + txna ApplicationArgs 14 + txna ApplicationArgs 15 + extract 0 1 + txna ApplicationArgs 15 + extract 1 1 + txna ApplicationArgs 15 + extract 2 1 + txna ApplicationArgs 15 + extract 3 1 + txna ApplicationArgs 15 + extract 4 4 + txna ApplicationArgs 15 + extract 8 1 + callsub return_args_after_14th + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_bare_routing@12: + txn OnCompletion + ! + assert // reject transaction + txn ApplicationID + ! + assert // is creating + int 1 + return + + +// test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: +echo: + proto 1 1 + frame_dig -1 + extract 2 0 + byte "echo: " + swap + concat + dup + len + itob + extract 6 0 + swap + concat + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: +log_uint64: + proto 1 0 + frame_dig -1 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: +log_uint512: + proto 1 0 + frame_dig -1 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: +log_string: + proto 1 0 + frame_dig -1 + extract 2 0 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: +log_bool: + proto 1 0 + frame_dig -1 + int 0 + getbit + bz log_bool_ternary_false@2 + byte "True" + b log_bool_ternary_merge@3 + +log_bool_ternary_false@2: + byte "False" + +log_bool_ternary_merge@3: + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: +log_bytes: + proto 1 0 + frame_dig -1 + len + int 2 + dig 1 + < + swap + dup + int 2 + uncover 3 + select + frame_dig -1 + swap + uncover 2 + substring3 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: +log_asset_account_app: + proto 3 0 + frame_dig -3 + asset_params_get AssetName + assert // asset exists + frame_dig -2 + concat + frame_dig -1 + app_params_get AppAddress + assert // application exists + concat + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: +return_args_after_14th: + proto 20 1 + frame_dig -6 + frame_dig -5 + concat + frame_dig -4 + concat + frame_dig -3 + concat + frame_dig -2 + concat + frame_dig -1 + concat + txna ApplicationArgs 15 + dig 1 + == + assert + dup + len + itob + extract 6 2 + swap + concat + retsub diff --git a/test_cases/typed_abi_call/out_O2/Logger.clear.teal b/test_cases/typed_abi_call/out_O2/Logger.clear.teal new file mode 100644 index 0000000000..c31bbae010 --- /dev/null +++ b/test_cases/typed_abi_call/out_O2/Logger.clear.teal @@ -0,0 +1,5 @@ +#pragma version 10 + +test_cases.typed_abi_call.logger.Logger.clear_state_program: + int 1 + return diff --git a/test_cases/typed_abi_call/out_O2/Logger.destructured.ir b/test_cases/typed_abi_call/out_O2/Logger.destructured.ir new file mode 100644 index 0000000000..fa5e027622 --- /dev/null +++ b/test_cases/typed_abi_call/out_O2/Logger.destructured.ir @@ -0,0 +1,207 @@ +contract test_cases.typed_abi_call.logger.Logger: + program approval: + subroutine test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@12 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => fail // reject transaction} + block@2: // echo_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (! tmp%2#0) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: bytes = test_cases.typed_abi_call.logger.Logger.echo(tmp%5#0) + let tmp%7#0: bytes = (concat 0x151f7c75 tmp%6#0) + (log tmp%7#0) + return 1u + block@3: // log_uint64_route_L11 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (! tmp%8#0) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint64(tmp%11#0) + return 1u + block@4: // log_uint512_route_L15 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) // OnCompletion is NoOp + let tmp%14#0: uint64 = (txn ApplicationID) + (assert tmp%14#0) // is not creating + let tmp%15#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint512(tmp%15#0) + return 1u + block@5: // log_string_route_L19 + let tmp%16#0: uint64 = (txn OnCompletion) + let tmp%17#0: uint64 = (! tmp%16#0) + (assert tmp%17#0) // OnCompletion is NoOp + let tmp%18#0: uint64 = (txn ApplicationID) + (assert tmp%18#0) // is not creating + let tmp%19#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_string(tmp%19#0) + return 1u + block@6: // log_bool_route_L23 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (! tmp%20#0) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bool(tmp%23#0) + return 1u + block@7: // log_bytes_route_L27 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (! tmp%24#0) + (assert tmp%25#0) // OnCompletion is NoOp + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + let tmp%27#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bytes(tmp%27#0) + return 1u + block@8: // log_asset_account_app_route_L31 + let tmp%28#0: uint64 = (txn OnCompletion) + let tmp%29#0: uint64 = (! tmp%28#0) + (assert tmp%29#0) // OnCompletion is NoOp + let tmp%30#0: uint64 = (txn ApplicationID) + (assert tmp%30#0) // is not creating + let tmp%31#0: bytes = (txna ApplicationArgs 1) + let tmp%32#0: uint64 = (btoi tmp%31#0) + let tmp%33#0: uint64 = ((txnas Assets) tmp%32#0) + let tmp%34#0: bytes = (txna ApplicationArgs 2) + let tmp%35#0: uint64 = (btoi tmp%34#0) + let tmp%36#0: bytes = ((txnas Accounts) tmp%35#0) + let tmp%37#0: bytes = (txna ApplicationArgs 3) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Applications) tmp%38#0) + test_cases.typed_abi_call.logger.Logger.log_asset_account_app(tmp%33#0, tmp%36#0, tmp%39#0) + return 1u + block@9: // return_args_after_14th_route_L35 + let tmp%40#0: uint64 = (txn OnCompletion) + let tmp%41#0: uint64 = (! tmp%40#0) + (assert tmp%41#0) // OnCompletion is NoOp + let tmp%42#0: uint64 = (txn ApplicationID) + (assert tmp%42#0) // is not creating + let tmp%43#0: bytes = (txna ApplicationArgs 1) + let tmp%44#0: bytes = (txna ApplicationArgs 2) + let tmp%45#0: bytes = (txna ApplicationArgs 3) + let tmp%46#0: bytes = (txna ApplicationArgs 4) + let tmp%47#0: bytes = (txna ApplicationArgs 5) + let tmp%48#0: bytes = (txna ApplicationArgs 6) + let tmp%49#0: bytes = (txna ApplicationArgs 7) + let tmp%50#0: bytes = (txna ApplicationArgs 8) + let tmp%51#0: bytes = (txna ApplicationArgs 9) + let tmp%52#0: bytes = (txna ApplicationArgs 10) + let tmp%53#0: bytes = (txna ApplicationArgs 11) + let tmp%54#0: bytes = (txna ApplicationArgs 12) + let tmp%55#0: bytes = (txna ApplicationArgs 13) + let tmp%56#0: bytes = (txna ApplicationArgs 14) + let tmp%57#0: bytes = (txna ApplicationArgs 15) + let tmp%58#0: bytes = ((extract 0 1) tmp%57#0) + let tmp%59#0: bytes = (txna ApplicationArgs 15) + let tmp%60#0: bytes = ((extract 1 1) tmp%59#0) + let tmp%61#0: bytes = (txna ApplicationArgs 15) + let tmp%62#0: bytes = ((extract 2 1) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 15) + let tmp%64#0: bytes = ((extract 3 1) tmp%63#0) + let tmp%65#0: bytes = (txna ApplicationArgs 15) + let tmp%66#0: bytes = ((extract 4 4) tmp%65#0) + let tmp%67#0: bytes = (txna ApplicationArgs 15) + let tmp%68#0: bytes = ((extract 8 1) tmp%67#0) + let tmp%69#0: bytes = test_cases.typed_abi_call.logger.Logger.return_args_after_14th(tmp%43#0, tmp%44#0, tmp%45#0, tmp%46#0, tmp%47#0, tmp%48#0, tmp%49#0, tmp%50#0, tmp%51#0, tmp%52#0, tmp%53#0, tmp%54#0, tmp%55#0, tmp%56#0, tmp%58#0, tmp%60#0, tmp%62#0, tmp%64#0, tmp%66#0, tmp%68#0) + let tmp%70#0: bytes = (concat 0x151f7c75 tmp%69#0) + (log tmp%70#0) + return 1u + block@12: // bare_routing_L6 + let tmp%71#0: uint64 = (txn OnCompletion) + let not%tmp%71#0: uint64 = (! tmp%71#0) + (assert not%tmp%71#0) // reject transaction + let tmp%72#0: uint64 = (txn ApplicationID) + let tmp%73#0: uint64 = (! tmp%72#0) + (assert tmp%73#0) // is creating + return 1u + + subroutine test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: + block@0: // L7 + let expr_value_trimmed%1#0: bytes = ((extract 2 0) value#0) + let concatenated%2#0: bytes = (concat "echo: " expr_value_trimmed%1#0) + let len_%3#0: uint64 = (len concatenated%2#0) + let len_bytes%4#0: bytes = (itob len_%3#0) + let len_16_bit%5#0: bytes = ((extract 6 0) len_bytes%4#0) + let concat_result%6#0: bytes = (concat len_16_bit%5#0 concatenated%2#0) + return concat_result%6#0 + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: + block@0: // L11 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: + block@0: // L15 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: + block@0: // L19 + let tmp%0#0: bytes = ((extract 2 0) value#0) + (log tmp%0#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: + block@0: // L23 + let tmp%0#0: uint64 = (getbit value#0 0u) + goto tmp%0#0 ? block@1 : block@2 + block@1: // ternary_true_L25 + let ternary_result%1#0: bytes = "True" + goto block@3 + block@2: // ternary_false_L25 + let ternary_result%1#0: bytes = "False" + goto block@3 + block@3: // ternary_merge_L25 + (log ternary_result%1#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: + block@0: // L27 + let tmp%1#0: uint64 = (len value#0) + let tmp%3#0: uint64 = (< 2u tmp%1#0) + let tmp%4#0: uint64 = (select tmp%1#0 2u tmp%3#0) + let tmp%6#0: bytes = (substring3 value#0 tmp%4#0 tmp%1#0) + (log tmp%6#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: + block@0: // L31 + let (value%0#0: bytes, check%1#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%1#0) // asset exists + let tmp%3#0: bytes = (concat value%0#0 account#0) + let (value%5#0: bytes, check%6#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%6#0) // application exists + let tmp%7#0: bytes = (concat tmp%3#0 value%5#0) + (log tmp%7#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: + block@0: // L35 + let encoded_tuple_buffer%1#2: bytes = (concat a15#0 a16#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#2 a17#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#2 a18#0) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#2 a19#0) + let last_arg#0: bytes = (concat encoded_tuple_buffer%1#2 a20#0) + let tmp%2#0: bytes = (txna ApplicationArgs 15) + let tmp%3#0: uint64 = (== tmp%2#0 last_arg#0) + (assert tmp%3#0) + let length%4#0: uint64 = (len last_arg#0) + let value_as_bytes%5#0: bytes = (itob length%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let tmp%7#0: bytes = (concat value_as_uint16%6#0 last_arg#0) + return tmp%7#0 + + program clear-state: + subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out_unoptimized/Greeter.approval.teal b/test_cases/typed_abi_call/out_unoptimized/Greeter.approval.teal new file mode 100644 index 0000000000..2ae6257447 --- /dev/null +++ b/test_cases/typed_abi_call/out_unoptimized/Greeter.approval.teal @@ -0,0 +1,935 @@ +#pragma version 10 + +test_cases.typed_abi_call.typed_c2c.Greeter.approval_program: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txn NumAppArgs + bz main_bare_routing@9 + txna ApplicationArgs 0 + method "test_method_selector_kinds(application)void" + method "test_arg_conversion(application)void" + method "test_15plus_args(application)void" + method "test_void(application)void" + method "test_ref_types(application,asset)void" + uncover 5 + match main_test_method_selector_kinds_route@2 main_test_arg_conversion_route@3 main_test_15plus_args_route@4 main_test_void_route@5 main_test_ref_types_route@6 + b main_switch_case_default@7 + +main_test_method_selector_kinds_route@2: + // typed_abi_call/typed_c2c.py:7 + // @arc4.abimethod() + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:7 + // @arc4.abimethod() + callsub test_method_selector_kinds + int 1 + return + +main_test_arg_conversion_route@3: + // typed_abi_call/typed_c2c.py:20 + // @arc4.abimethod() + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:20 + // @arc4.abimethod() + callsub test_arg_conversion + int 1 + return + +main_test_15plus_args_route@4: + // typed_abi_call/typed_c2c.py:37 + // @arc4.abimethod() + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:37 + // @arc4.abimethod() + callsub test_15plus_args + int 1 + return + +main_test_void_route@5: + // typed_abi_call/typed_c2c.py:66 + // @arc4.abimethod() + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + // typed_abi_call/typed_c2c.py:66 + // @arc4.abimethod() + callsub test_void + int 1 + return + +main_test_ref_types_route@6: + // typed_abi_call/typed_c2c.py:80 + // @arc4.abimethod() + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Applications + txna ApplicationArgs 2 + btoi + txnas Assets + // typed_abi_call/typed_c2c.py:80 + // @arc4.abimethod() + callsub test_ref_types + int 1 + return + +main_switch_case_default@7: + b main_after_if_else@12 + +main_bare_routing@9: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txn OnCompletion + int 0 + swap + match main_create@10 + b main_reject_bare_on_completion@11 + +main_create@10: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + txn ApplicationID + ! + assert // is creating + int 1 + return + +main_reject_bare_on_completion@11: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + err // reject transaction + +main_after_if_else@12: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + err // reject transaction + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: +test_method_selector_kinds: + // typed_abi_call/typed_c2c.py:7-8 + // @arc4.abimethod() + // def test_method_selector_kinds(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:9 + // result, _txn = arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) + itxn_begin + method "echo(string)string" + byte "\x00\x05test1" + swap + // typed_abi_call/typed_c2c.py:8 + // def test_method_selector_kinds(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:9 + // result, _txn = arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:10 + // assert result == "echo: test1" + byte "\x00\x0becho: test1" + == + assert + // typed_abi_call/typed_c2c.py:11 + // result, _txn = arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) + itxn_begin + method "echo(string)string" + byte "\x00\x05test2" + swap + // typed_abi_call/typed_c2c.py:8 + // def test_method_selector_kinds(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:11 + // result, _txn = arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:12 + // assert result == "echo: test2" + byte "\x00\x0becho: test2" + == + assert + // typed_abi_call/typed_c2c.py:13 + // result, _txn = arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) + itxn_begin + method "echo(string)string" + byte "\x00\x05test3" + swap + // typed_abi_call/typed_c2c.py:8 + // def test_method_selector_kinds(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:13 + // result, _txn = arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:14 + // assert result == "echo: test3" + byte "\x00\x0becho: test3" + == + assert + // typed_abi_call/typed_c2c.py:15 + // result, _txn = arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) + itxn_begin + method "echo(string)string" + byte "\x00\x05test4" + swap + // typed_abi_call/typed_c2c.py:8 + // def test_method_selector_kinds(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:15 + // result, _txn = arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:16 + // assert result == "echo: test4" + byte "\x00\x0becho: test4" + == + assert + // typed_abi_call/typed_c2c.py:17 + // result, _txn = arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) + itxn_begin + method "echo(string)string" + byte "\x00\x05test5" + swap + // typed_abi_call/typed_c2c.py:8 + // def test_method_selector_kinds(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:17 + // result, _txn = arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:18 + // assert result == "echo: test5" + byte "\x00\x0becho: test5" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: +test_arg_conversion: + // typed_abi_call/typed_c2c.py:20-21 + // @arc4.abimethod() + // def test_arg_conversion(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:22 + // txn = arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) + itxn_begin + method "log_string(string)void" + byte "\x00\nconverted1" + swap + // typed_abi_call/typed_c2c.py:21 + // def test_arg_conversion(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:22 + // txn = arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:23 + // assert txn.last_log == b"converted1" + byte "converted1" + == + assert + // typed_abi_call/typed_c2c.py:25 + // txn = arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) + itxn_begin + method "log_uint64(uint64)void" + byte 0x0000000000000002 + swap + // typed_abi_call/typed_c2c.py:21 + // def test_arg_conversion(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:25 + // txn = arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:26 + // assert txn.last_log == op.itob(2) + int 2 + itob + == + assert + // typed_abi_call/typed_c2c.py:28 + // txn = arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) + itxn_begin + method "log_uint512(uint512)void" + byte 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + swap + // typed_abi_call/typed_c2c.py:21 + // def test_arg_conversion(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:28 + // txn = arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:29 + // assert txn.last_log == (op.bzero(56) + op.itob(3)) + int 56 + bzero + int 3 + itob + concat + == + assert + // typed_abi_call/typed_c2c.py:31 + // txn = arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) + itxn_begin + method "log_bytes(byte[])void" + byte 0x000134 + swap + // typed_abi_call/typed_c2c.py:21 + // def test_arg_conversion(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:31 + // txn = arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:32 + // assert txn.last_log == b"4" + byte "4" + == + assert + // typed_abi_call/typed_c2c.py:34 + // txn = arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) + itxn_begin + byte 0x00 + int 0 + int 1 + setbit + method "log_bool(bool)void" + // typed_abi_call/typed_c2c.py:21 + // def test_arg_conversion(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:34 + // txn = arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:35 + // assert txn.last_log == b"True" + byte "True" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: +test_15plus_args: + // typed_abi_call/typed_c2c.py:37-38 + // @arc4.abimethod() + // def test_15plus_args(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:39-63 + // result, txn = arc4.abi_call( + // Logger.return_args_after_14th, + // 1, + // 2, + // 3, + // 4, + // 5, + // 6, + // 7, + // 8, + // 9, + // 10, + // 11, + // 12, + // 13, + // 14, + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + // app_id=app, + // fee=0, + // ) + itxn_begin + // typed_abi_call/typed_c2c.py:59 + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + byte 0x + byte 0xde + concat + byte 0xad + concat + byte 0xbe + concat + byte 0xef + concat + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + byte 0x + // typed_abi_call/typed_c2c.py:55 + // 15, + byte 0x0f + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + concat + // typed_abi_call/typed_c2c.py:56 + // 16, + byte 0x10 + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + concat + // typed_abi_call/typed_c2c.py:57 + // 17, + byte 0x11 + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + concat + // typed_abi_call/typed_c2c.py:58 + // 18, + byte 0x12 + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + concat + swap + concat + // typed_abi_call/typed_c2c.py:60 + // 20, + byte 0x14 + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + concat + // typed_abi_call/typed_c2c.py:39-63 + // result, txn = arc4.abi_call( + // Logger.return_args_after_14th, + // 1, + // 2, + // 3, + // 4, + // 5, + // 6, + // 7, + // 8, + // 9, + // 10, + // 11, + // 12, + // 13, + // 14, + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + // app_id=app, + // fee=0, + // ) + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + swap + // typed_abi_call/typed_c2c.py:41 + // 1, + byte 0x0000000000000001 + cover 2 + // typed_abi_call/typed_c2c.py:42 + // 2, + byte 0x0000000000000002 + cover 3 + // typed_abi_call/typed_c2c.py:43 + // 3, + byte 0x0000000000000003 + cover 4 + // typed_abi_call/typed_c2c.py:44 + // 4, + byte 0x0000000000000004 + cover 5 + // typed_abi_call/typed_c2c.py:45 + // 5, + byte 0x0000000000000005 + cover 6 + // typed_abi_call/typed_c2c.py:46 + // 6, + byte 0x0000000000000006 + cover 7 + // typed_abi_call/typed_c2c.py:47 + // 7, + byte 0x0000000000000007 + cover 8 + // typed_abi_call/typed_c2c.py:48 + // 8, + byte 0x0000000000000008 + cover 9 + // typed_abi_call/typed_c2c.py:49 + // 9, + byte 0x0000000000000009 + cover 10 + // typed_abi_call/typed_c2c.py:50 + // 10, + byte 0x000000000000000a + cover 11 + // typed_abi_call/typed_c2c.py:51 + // 11, + byte 0x000000000000000b + cover 12 + // typed_abi_call/typed_c2c.py:52 + // 12, + byte 0x000000000000000c + cover 13 + // typed_abi_call/typed_c2c.py:53 + // 13, + byte 0x000000000000000d + cover 14 + // typed_abi_call/typed_c2c.py:54 + // 14, + byte 0x000000000000000e + cover 15 + // typed_abi_call/typed_c2c.py:55-60 + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + cover 15 + // typed_abi_call/typed_c2c.py:38 + // def test_15plus_args(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:62 + // fee=0, + int 0 + // typed_abi_call/typed_c2c.py:39-63 + // result, txn = arc4.abi_call( + // Logger.return_args_after_14th, + // 1, + // 2, + // 3, + // 4, + // 5, + // 6, + // 7, + // 8, + // 9, + // 10, + // 11, + // 12, + // 13, + // 14, + // 15, + // 16, + // 17, + // 18, + // arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + // 20, + // app_id=app, + // fee=0, + // ) + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + dup + extract 4 0 + swap + extract 0 4 + byte 0x151f7c75 + == + assert // ARC4 prefix is valid + // typed_abi_call/typed_c2c.py:64 + // assert result.decode() == Bytes.from_hex("0F101112DEADBEEF14") + extract 2 0 + byte 0x0f101112deadbeef14 + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: +test_void: + // typed_abi_call/typed_c2c.py:66-67 + // @arc4.abimethod() + // def test_void(self, app: Application) -> None: + proto 1 0 + // typed_abi_call/typed_c2c.py:68 + // txn = arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) + itxn_begin + method "log_string(string)void" + byte "\x00\x06World1" + swap + // typed_abi_call/typed_c2c.py:67 + // def test_void(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:68 + // txn = arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:69 + // assert txn.last_log == b"World1" + byte "World1" + == + assert + // typed_abi_call/typed_c2c.py:71 + // txn = arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) + itxn_begin + method "log_string(string)void" + byte "\x00\x06World2" + swap + // typed_abi_call/typed_c2c.py:67 + // def test_void(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:71 + // txn = arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:72 + // assert txn.last_log == b"World2" + byte "World2" + == + assert + // typed_abi_call/typed_c2c.py:74 + // txn = arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) + itxn_begin + method "log_string(string)void" + byte "\x00\x06World3" + swap + // typed_abi_call/typed_c2c.py:67 + // def test_void(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:74 + // txn = arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:75 + // assert txn.last_log == b"World3" + byte "World3" + == + assert + // typed_abi_call/typed_c2c.py:77 + // txn = arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) + itxn_begin + method "log_string(string)void" + byte "\x00\x06World4" + swap + // typed_abi_call/typed_c2c.py:67 + // def test_void(self, app: Application) -> None: + frame_dig -1 + // typed_abi_call/typed_c2c.py:77 + // txn = arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) + int 0 + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:78 + // assert txn.last_log == b"World4" + byte "World4" + == + assert + retsub + + +// test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: +test_ref_types: + // typed_abi_call/typed_c2c.py:80-81 + // @arc4.abimethod() + // def test_ref_types(self, app: Application, asset: Asset) -> None: + proto 2 0 + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + itxn_begin + // typed_abi_call/typed_c2c.py:85 + // Global.current_application_address, + global CurrentApplicationAddress + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + method "log_asset_account_app(asset,account,application)void" + // typed_abi_call/typed_c2c.py:84 + // asset, + byte 0x00 + swap + // typed_abi_call/typed_c2c.py:85 + // Global.current_application_address, + byte 0x01 + cover 2 + // typed_abi_call/typed_c2c.py:86 + // app, + byte 0x01 + cover 3 + // typed_abi_call/typed_c2c.py:81 + // def test_ref_types(self, app: Application, asset: Asset) -> None: + frame_dig -2 + frame_dig -2 + frame_dig -1 + // typed_abi_call/typed_c2c.py:88 + // fee=0, + int 0 + // typed_abi_call/typed_c2c.py:82-89 + // txn = arc4.abi_call( + // Logger.log_asset_account_app, + // asset, + // Global.current_application_address, + // app, + // app_id=app, + // fee=0, + // ) + int appl + itxn_field TypeEnum + itxn_field Fee + itxn_field Assets + itxn_field Applications + itxn_field ApplicationID + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field ApplicationArgs + itxn_field Accounts + itxn_submit + itxn LastLog + // typed_abi_call/typed_c2c.py:92 + // == asset.name + Global.current_application_address.bytes + app.address.bytes + frame_dig -1 + asset_params_get AssetName + assert // asset exists + global CurrentApplicationAddress + concat + frame_dig -2 + app_params_get AppAddress + assert // application exists + concat + // typed_abi_call/typed_c2c.py:91-92 + // txn.last_log + // == asset.name + Global.current_application_address.bytes + app.address.bytes + == + // typed_abi_call/typed_c2c.py:90-93 + // assert ( + // txn.last_log + // == asset.name + Global.current_application_address.bytes + app.address.bytes + // ) + assert + retsub diff --git a/test_cases/typed_abi_call/out_unoptimized/Greeter.clear.teal b/test_cases/typed_abi_call/out_unoptimized/Greeter.clear.teal new file mode 100644 index 0000000000..1abfdf3763 --- /dev/null +++ b/test_cases/typed_abi_call/out_unoptimized/Greeter.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 + +test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program: + // typed_abi_call/typed_c2c.py:6 + // class Greeter(ARC4Contract): + int 1 + return diff --git a/test_cases/typed_abi_call/out_unoptimized/Greeter.destructured.ir b/test_cases/typed_abi_call/out_unoptimized/Greeter.destructured.ir new file mode 100644 index 0000000000..b436abb55b --- /dev/null +++ b/test_cases/typed_abi_call/out_unoptimized/Greeter.destructured.ir @@ -0,0 +1,492 @@ +contract test_cases.typed_abi_call.typed_c2c.Greeter: + program approval: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@9 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@7} + block@2: // test_method_selector_kinds_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (== tmp%2#0 NoOp) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = ((txnas Applications) tmp%6#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(tmp%7#0) + return 1u + block@3: // test_arg_conversion_route_L20 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (== tmp%8#0 NoOp) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = ((txnas Applications) tmp%12#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(tmp%13#0) + return 1u + block@4: // test_15plus_args_route_L37 + let tmp%14#0: uint64 = (txn OnCompletion) + let tmp%15#0: uint64 = (== tmp%14#0 NoOp) + (assert tmp%15#0) // OnCompletion is NoOp + let tmp%16#0: uint64 = (txn ApplicationID) + (assert tmp%16#0) // is not creating + let tmp%17#0: bytes = (txna ApplicationArgs 1) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = ((txnas Applications) tmp%18#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(tmp%19#0) + return 1u + block@5: // test_void_route_L66 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (== tmp%20#0 NoOp) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = ((txnas Applications) tmp%24#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_void(tmp%25#0) + return 1u + block@6: // test_ref_types_route_L80 + let tmp%26#0: uint64 = (txn OnCompletion) + let tmp%27#0: uint64 = (== tmp%26#0 NoOp) + (assert tmp%27#0) // OnCompletion is NoOp + let tmp%28#0: uint64 = (txn ApplicationID) + (assert tmp%28#0) // is not creating + let tmp%29#0: bytes = (txna ApplicationArgs 1) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = ((txnas Applications) tmp%30#0) + let tmp%32#0: bytes = (txna ApplicationArgs 2) + let tmp%33#0: uint64 = (btoi tmp%32#0) + let tmp%34#0: uint64 = ((txnas Assets) tmp%33#0) + test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(tmp%31#0, tmp%34#0) + return 1u + block@7: // switch_case_default_L6 + goto block@8 + block@8: // switch_case_next_L6 + goto block@12 + block@9: // bare_routing_L6 + let tmp%35#0: uint64 = (txn OnCompletion) + switch tmp%35#0 {0u => block@10, * => block@11} + block@10: // create_L6 + let tmp%36#0: uint64 = (txn ApplicationID) + let tmp%37#0: uint64 = (! tmp%36#0) + (assert tmp%37#0) // is creating + return 1u + block@11: // reject_bare_on_completion_L6 + fail // reject transaction + block@12: // after_if_else_L6 + fail // reject transaction + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds(app: uint64) -> void: + block@0: // L7 + itxn_begin + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test1" + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + goto block@1 + block@1: // next_txn_L9 + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let awst_tmp%1#0: bytes = tmp_itxn_0%%LastLog#0 + let tmp%2#0: bytes = ((extract 4 0) awst_tmp%1#0) + let tmp%3#0: bytes = ((extract 0 4) awst_tmp%1#0) + let tmp%4#0: uint64 = (== tmp%3#0 0x151f7c75) + let value%5#0: bytes = tmp%2#0 + let check%6#0: uint64 = tmp%4#0 + (assert check%6#0) // ARC4 prefix is valid + let result#0: bytes = value%5#0 + let tmp%7#0: uint64 = (== result#0 "\x00\x0becho: test1") + (assert tmp%7#0) + itxn_begin + let inner_txn_params%8%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%8%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test2" + let inner_txn_params%8%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%8%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%8%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%8%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%8%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%8%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%8%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%8%%param_ApplicationArgs_idx_1#0) + goto block@2 + block@2: // next_txn_L11 + itxn_submit + let tmp_itxn_1%%LastLog#0: bytes = (itxn LastLog) + let awst_tmp%9#0: bytes = tmp_itxn_1%%LastLog#0 + let tmp%10#0: bytes = ((extract 4 0) awst_tmp%9#0) + let tmp%11#0: bytes = ((extract 0 4) awst_tmp%9#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x151f7c75) + let value%13#0: bytes = tmp%10#0 + let check%14#0: uint64 = tmp%12#0 + (assert check%14#0) // ARC4 prefix is valid + let result#0: bytes = value%13#0 + let tmp%15#0: uint64 = (== result#0 "\x00\x0becho: test2") + (assert tmp%15#0) + itxn_begin + let inner_txn_params%16%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%16%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test3" + let inner_txn_params%16%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%16%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%16%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%16%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%16%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%16%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%16%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%16%%param_ApplicationArgs_idx_1#0) + goto block@3 + block@3: // next_txn_L13 + itxn_submit + let tmp_itxn_2%%LastLog#0: bytes = (itxn LastLog) + let awst_tmp%17#0: bytes = tmp_itxn_2%%LastLog#0 + let tmp%18#0: bytes = ((extract 4 0) awst_tmp%17#0) + let tmp%19#0: bytes = ((extract 0 4) awst_tmp%17#0) + let tmp%20#0: uint64 = (== tmp%19#0 0x151f7c75) + let value%21#0: bytes = tmp%18#0 + let check%22#0: uint64 = tmp%20#0 + (assert check%22#0) // ARC4 prefix is valid + let result#0: bytes = value%21#0 + let tmp%23#0: uint64 = (== result#0 "\x00\x0becho: test3") + (assert tmp%23#0) + itxn_begin + let inner_txn_params%24%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%24%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test4" + let inner_txn_params%24%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%24%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%24%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%24%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%24%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%24%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%24%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%24%%param_ApplicationArgs_idx_1#0) + goto block@4 + block@4: // next_txn_L15 + itxn_submit + let tmp_itxn_3%%LastLog#0: bytes = (itxn LastLog) + let awst_tmp%25#0: bytes = tmp_itxn_3%%LastLog#0 + let tmp%26#0: bytes = ((extract 4 0) awst_tmp%25#0) + let tmp%27#0: bytes = ((extract 0 4) awst_tmp%25#0) + let tmp%28#0: uint64 = (== tmp%27#0 0x151f7c75) + let value%29#0: bytes = tmp%26#0 + let check%30#0: uint64 = tmp%28#0 + (assert check%30#0) // ARC4 prefix is valid + let result#0: bytes = value%29#0 + let tmp%31#0: uint64 = (== result#0 "\x00\x0becho: test4") + (assert tmp%31#0) + itxn_begin + let inner_txn_params%32%%param_ApplicationArgs_idx_0#0: bytes = method "echo(string)string" + let inner_txn_params%32%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x05test5" + let inner_txn_params%32%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%32%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%32%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%32%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%32%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%32%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%32%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%32%%param_ApplicationArgs_idx_1#0) + goto block@5 + block@5: // next_txn_L17 + itxn_submit + let tmp_itxn_4%%LastLog#0: bytes = (itxn LastLog) + let awst_tmp%33#0: bytes = tmp_itxn_4%%LastLog#0 + let tmp%34#0: bytes = ((extract 4 0) awst_tmp%33#0) + let tmp%35#0: bytes = ((extract 0 4) awst_tmp%33#0) + let tmp%36#0: uint64 = (== tmp%35#0 0x151f7c75) + let value%37#0: bytes = tmp%34#0 + let check%38#0: uint64 = tmp%36#0 + (assert check%38#0) // ARC4 prefix is valid + let result#0: bytes = value%37#0 + let tmp%39#0: uint64 = (== result#0 "\x00\x0becho: test5") + (assert tmp%39#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion(app: uint64) -> void: + block@0: // L20 + itxn_begin + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = "\x00\nconverted1" + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + goto block@1 + block@1: // next_txn_L22 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "converted1") + (assert tmp%1#0) + itxn_begin + let inner_txn_params%2%%param_ApplicationArgs_idx_0#0: bytes = method "log_uint64(uint64)void" + let inner_txn_params%2%%param_ApplicationArgs_idx_1#0: bytes = 0x0000000000000002 + let inner_txn_params%2%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%2%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%2%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%2%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%2%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%2%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_1#0) + goto block@2 + block@2: // next_txn_L25 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%3#0: bytes = (itob 2u) + let tmp%4#0: uint64 = (== txn%%LastLog#0 tmp%3#0) + (assert tmp%4#0) + itxn_begin + let inner_txn_params%5%%param_ApplicationArgs_idx_0#0: bytes = method "log_uint512(uint512)void" + let inner_txn_params%5%%param_ApplicationArgs_idx_1#0: bytes = 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 + let inner_txn_params%5%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%5%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%5%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%5%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%5%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%5%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%5%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%5%%param_ApplicationArgs_idx_1#0) + goto block@3 + block@3: // next_txn_L28 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%6#0: bytes = (bzero 56u) + let tmp%7#0: bytes = (itob 3u) + let tmp%8#0: bytes = (concat tmp%6#0 tmp%7#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + itxn_begin + let inner_txn_params%10%%param_ApplicationArgs_idx_0#0: bytes = method "log_bytes(byte[])void" + let inner_txn_params%10%%param_ApplicationArgs_idx_1#0: bytes = 0x000134 + let inner_txn_params%10%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%10%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%10%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%10%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%10%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%10%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%10%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%10%%param_ApplicationArgs_idx_1#0) + goto block@4 + block@4: // next_txn_L31 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%11#0: uint64 = (== txn%%LastLog#0 "4") + (assert tmp%11#0) + itxn_begin + let tmp%13#0: any = (setbit 0x00 0u 1u) + let inner_txn_params%12%%param_ApplicationArgs_idx_0#0: bytes = method "log_bool(bool)void" + let inner_txn_params%12%%param_ApplicationArgs_idx_1#0: any = tmp%13#0 + let inner_txn_params%12%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%12%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%12%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%12%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%12%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%12%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%12%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%12%%param_ApplicationArgs_idx_1#0) + goto block@5 + block@5: // next_txn_L34 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%14#0: uint64 = (== txn%%LastLog#0 "True") + (assert tmp%14#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args(app: uint64) -> void: + block@0: // L37 + itxn_begin + let encoded_tuple_buffer%2#0: bytes = 0x + let encoded_tuple_buffer%2#0: bytes = (concat encoded_tuple_buffer%2#0 0xde) + let encoded_tuple_buffer%2#0: bytes = (concat encoded_tuple_buffer%2#0 0xad) + let encoded_tuple_buffer%2#0: bytes = (concat encoded_tuple_buffer%2#0 0xbe) + let encoded_tuple_buffer%2#0: bytes = (concat encoded_tuple_buffer%2#0 0xef) + let encoded_tuple_buffer%4#0: bytes = 0x + let encoded_tuple_buffer%4#0: bytes = (concat encoded_tuple_buffer%4#0 0x0f) + let encoded_tuple_buffer%4#0: bytes = (concat encoded_tuple_buffer%4#0 0x10) + let encoded_tuple_buffer%4#0: bytes = (concat encoded_tuple_buffer%4#0 0x11) + let encoded_tuple_buffer%4#0: bytes = (concat encoded_tuple_buffer%4#0 0x12) + let encoded_tuple_buffer%4#0: bytes = (concat encoded_tuple_buffer%4#0 encoded_tuple_buffer%2#0) + let encoded_tuple_buffer%4#0: bytes = (concat encoded_tuple_buffer%4#0 0x14) + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = 0x0000000000000001 + let inner_txn_params%0%%param_ApplicationArgs_idx_2#0: bytes = 0x0000000000000002 + let inner_txn_params%0%%param_ApplicationArgs_idx_3#0: bytes = 0x0000000000000003 + let inner_txn_params%0%%param_ApplicationArgs_idx_4#0: bytes = 0x0000000000000004 + let inner_txn_params%0%%param_ApplicationArgs_idx_5#0: bytes = 0x0000000000000005 + let inner_txn_params%0%%param_ApplicationArgs_idx_6#0: bytes = 0x0000000000000006 + let inner_txn_params%0%%param_ApplicationArgs_idx_7#0: bytes = 0x0000000000000007 + let inner_txn_params%0%%param_ApplicationArgs_idx_8#0: bytes = 0x0000000000000008 + let inner_txn_params%0%%param_ApplicationArgs_idx_9#0: bytes = 0x0000000000000009 + let inner_txn_params%0%%param_ApplicationArgs_idx_10#0: bytes = 0x000000000000000a + let inner_txn_params%0%%param_ApplicationArgs_idx_11#0: bytes = 0x000000000000000b + let inner_txn_params%0%%param_ApplicationArgs_idx_12#0: bytes = 0x000000000000000c + let inner_txn_params%0%%param_ApplicationArgs_idx_13#0: bytes = 0x000000000000000d + let inner_txn_params%0%%param_ApplicationArgs_idx_14#0: bytes = 0x000000000000000e + let inner_txn_params%0%%param_ApplicationArgs_idx_15#0: bytes = encoded_tuple_buffer%4#0 + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_2#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_3#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_4#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_5#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_6#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_7#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_8#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_9#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_10#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_11#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_12#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_13#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_14#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_15#0) + goto block@1 + block@1: // next_txn_L39 + itxn_submit + let tmp_itxn_0%%LastLog#0: bytes = (itxn LastLog) + let awst_tmp%5#0: bytes = tmp_itxn_0%%LastLog#0 + let tmp%6#0: bytes = ((extract 4 0) awst_tmp%5#0) + let tmp%7#0: bytes = ((extract 0 4) awst_tmp%5#0) + let tmp%8#0: uint64 = (== tmp%7#0 0x151f7c75) + let value%9#0: bytes = tmp%6#0 + let check%10#0: uint64 = tmp%8#0 + (assert check%10#0) // ARC4 prefix is valid + let result#0: bytes = value%9#0 + let tmp%11#0: bytes = ((extract 2 0) result#0) + let tmp%12#0: uint64 = (== tmp%11#0 0x0f101112deadbeef14) + (assert tmp%12#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void(app: uint64) -> void: + block@0: // L66 + itxn_begin + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World1" + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + goto block@1 + block@1: // next_txn_L68 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%1#0: uint64 = (== txn%%LastLog#0 "World1") + (assert tmp%1#0) + itxn_begin + let inner_txn_params%2%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%2%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World2" + let inner_txn_params%2%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%2%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%2%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%2%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%2%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%2%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%2%%param_ApplicationArgs_idx_1#0) + goto block@2 + block@2: // next_txn_L71 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%3#0: uint64 = (== txn%%LastLog#0 "World2") + (assert tmp%3#0) + itxn_begin + let inner_txn_params%4%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%4%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World3" + let inner_txn_params%4%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%4%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%4%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%4%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%4%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%4%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%4%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%4%%param_ApplicationArgs_idx_1#0) + goto block@3 + block@3: // next_txn_L74 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%5#0: uint64 = (== txn%%LastLog#0 "World3") + (assert tmp%5#0) + itxn_begin + let inner_txn_params%6%%param_ApplicationArgs_idx_0#0: bytes = method "log_string(string)void" + let inner_txn_params%6%%param_ApplicationArgs_idx_1#0: bytes = "\x00\x06World4" + let inner_txn_params%6%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%6%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%6%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%6%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%6%%param_Fee_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%6%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%6%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%6%%param_ApplicationArgs_idx_1#0) + goto block@4 + block@4: // next_txn_L77 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let tmp%7#0: uint64 = (== txn%%LastLog#0 "World4") + (assert tmp%7#0) + return + + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types(app: uint64, asset: uint64) -> void: + block@0: // L80 + itxn_begin + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let inner_txn_params%0%%param_Accounts_idx_0#0: bytes = tmp%1#0 + let inner_txn_params%0%%param_ApplicationArgs_idx_0#0: bytes = method "log_asset_account_app(asset,account,application)void" + let inner_txn_params%0%%param_ApplicationArgs_idx_1#0: bytes = 0x00 + let inner_txn_params%0%%param_ApplicationArgs_idx_2#0: bytes = 0x01 + let inner_txn_params%0%%param_ApplicationArgs_idx_3#0: bytes = 0x01 + let inner_txn_params%0%%param_ApplicationID_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%param_Applications_idx_0#0: uint64 = app#0 + let inner_txn_params%0%%param_Assets_idx_0#0: uint64 = asset#0 + let inner_txn_params%0%%param_Fee_idx_0#0: uint64 = 0u + let inner_txn_params%0%%param_TypeEnum_idx_0#0: uint64 = appl + ((itxn_field TypeEnum) inner_txn_params%0%%param_TypeEnum_idx_0#0) + ((itxn_field Fee) inner_txn_params%0%%param_Fee_idx_0#0) + ((itxn_field Assets) inner_txn_params%0%%param_Assets_idx_0#0) + ((itxn_field Applications) inner_txn_params%0%%param_Applications_idx_0#0) + ((itxn_field ApplicationID) inner_txn_params%0%%param_ApplicationID_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_0#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_1#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_2#0) + ((itxn_field ApplicationArgs) inner_txn_params%0%%param_ApplicationArgs_idx_3#0) + ((itxn_field Accounts) inner_txn_params%0%%param_Accounts_idx_0#0) + goto block@1 + block@1: // next_txn_L82 + itxn_submit + let txn%%LastLog#0: bytes = (itxn LastLog) + let (value%2#0: bytes, check%3#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%3#0) // asset exists + let tmp%4#0: bytes = (global CurrentApplicationAddress) + let tmp%5#0: bytes = (concat value%2#0 tmp%4#0) + let (value%6#0: bytes, check%7#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%7#0) // application exists + let tmp%8#0: bytes = (concat tmp%5#0 value%6#0) + let tmp%9#0: uint64 = (== txn%%LastLog#0 tmp%8#0) + (assert tmp%9#0) + return + + program clear-state: + subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/out_unoptimized/Logger.approval.teal b/test_cases/typed_abi_call/out_unoptimized/Logger.approval.teal new file mode 100644 index 0000000000..2d4233f501 --- /dev/null +++ b/test_cases/typed_abi_call/out_unoptimized/Logger.approval.teal @@ -0,0 +1,476 @@ +#pragma version 10 + +test_cases.typed_abi_call.logger.Logger.approval_program: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txn NumAppArgs + bz main_bare_routing@12 + txna ApplicationArgs 0 + method "echo(string)string" + method "log_uint64(uint64)void" + method "log_uint512(uint512)void" + method "log_string(string)void" + method "log_bool(bool)void" + method "log_bytes(byte[])void" + method "log_asset_account_app(asset,account,application)void" + method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" + uncover 8 + match main_echo_route@2 main_log_uint64_route@3 main_log_uint512_route@4 main_log_string_route@5 main_log_bool_route@6 main_log_bytes_route@7 main_log_asset_account_app_route@8 main_return_args_after_14th_route@9 + b main_switch_case_default@10 + +main_echo_route@2: + // typed_abi_call/logger.py:7 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:7 + // @arc4.abimethod + callsub echo + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_log_uint64_route@3: + // typed_abi_call/logger.py:11 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:11 + // @arc4.abimethod + callsub log_uint64 + int 1 + return + +main_log_uint512_route@4: + // typed_abi_call/logger.py:15 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:15 + // @arc4.abimethod + callsub log_uint512 + int 1 + return + +main_log_string_route@5: + // typed_abi_call/logger.py:19 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:19 + // @arc4.abimethod + callsub log_string + int 1 + return + +main_log_bool_route@6: + // typed_abi_call/logger.py:23 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:23 + // @arc4.abimethod + callsub log_bool + int 1 + return + +main_log_bytes_route@7: + // typed_abi_call/logger.py:27 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + // typed_abi_call/logger.py:27 + // @arc4.abimethod + callsub log_bytes + int 1 + return + +main_log_asset_account_app_route@8: + // typed_abi_call/logger.py:31 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Accounts + txna ApplicationArgs 3 + btoi + txnas Applications + // typed_abi_call/logger.py:31 + // @arc4.abimethod + uncover 2 + uncover 2 + uncover 2 + callsub log_asset_account_app + int 1 + return + +main_return_args_after_14th_route@9: + // typed_abi_call/logger.py:35 + // @arc4.abimethod + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txna ApplicationArgs 1 + txna ApplicationArgs 2 + txna ApplicationArgs 3 + txna ApplicationArgs 4 + txna ApplicationArgs 5 + txna ApplicationArgs 6 + txna ApplicationArgs 7 + txna ApplicationArgs 8 + txna ApplicationArgs 9 + txna ApplicationArgs 10 + txna ApplicationArgs 11 + txna ApplicationArgs 12 + txna ApplicationArgs 13 + txna ApplicationArgs 14 + txna ApplicationArgs 15 + int 0 + int 1 + extract3 + txna ApplicationArgs 15 + int 1 + int 1 + extract3 + txna ApplicationArgs 15 + int 2 + int 1 + extract3 + txna ApplicationArgs 15 + int 3 + int 1 + extract3 + txna ApplicationArgs 15 + int 4 + int 4 + extract3 + txna ApplicationArgs 15 + int 8 + int 1 + extract3 + // typed_abi_call/logger.py:35 + // @arc4.abimethod + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + uncover 19 + callsub return_args_after_14th + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_switch_case_default@10: + b main_after_if_else@15 + +main_bare_routing@12: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txn OnCompletion + int 0 + swap + match main_create@13 + b main_reject_bare_on_completion@14 + +main_create@13: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + txn ApplicationID + ! + assert // is creating + int 1 + return + +main_reject_bare_on_completion@14: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + err // reject transaction + +main_after_if_else@15: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + err // reject transaction + + +// test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: +echo: + // typed_abi_call/logger.py:7-8 + // @arc4.abimethod + // def echo(self, value: arc4.String) -> arc4.String: + proto 1 1 + // typed_abi_call/logger.py:9 + // return "echo: " + value + byte "\x00\x06echo: " + extract 2 0 + frame_dig -1 + extract 2 0 + concat + dup + len + itob + extract 6 0 + swap + concat + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: +log_uint64: + // typed_abi_call/logger.py:11-12 + // @arc4.abimethod + // def log_uint64(self, value: arc4.UInt64) -> None: + proto 1 0 + // typed_abi_call/logger.py:13 + // log(value) + frame_dig -1 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: +log_uint512: + // typed_abi_call/logger.py:15-16 + // @arc4.abimethod + // def log_uint512(self, value: arc4.UInt512) -> None: + proto 1 0 + // typed_abi_call/logger.py:17 + // log(value) + frame_dig -1 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: +log_string: + // typed_abi_call/logger.py:19-20 + // @arc4.abimethod + // def log_string(self, value: arc4.String) -> None: + proto 1 0 + // typed_abi_call/logger.py:21 + // log(value.decode()) # decode to remove header + frame_dig -1 + extract 2 0 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: +log_bool: + // typed_abi_call/logger.py:23-24 + // @arc4.abimethod + // def log_bool(self, value: arc4.Bool) -> None: + proto 1 0 + // typed_abi_call/logger.py:25 + // log(Bytes(b"True") if value.decode() else Bytes(b"False")) + frame_dig -1 + int 0 + getbit + bz log_bool_ternary_false@2 + byte "True" + b log_bool_ternary_merge@3 + +log_bool_ternary_false@2: + // typed_abi_call/logger.py:25 + // log(Bytes(b"True") if value.decode() else Bytes(b"False")) + byte "False" + +log_bool_ternary_merge@3: + // typed_abi_call/logger.py:25 + // log(Bytes(b"True") if value.decode() else Bytes(b"False")) + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: +log_bytes: + // typed_abi_call/logger.py:27-28 + // @arc4.abimethod + // def log_bytes(self, value: arc4.DynamicBytes) -> None: + proto 1 0 + // typed_abi_call/logger.py:29 + // log(value.bytes[2:]) # decode to remove header + frame_dig -1 + dup + len + swap + dup + len + int 2 + swap + < + uncover 2 + int 2 + uncover 2 + select + dig 1 + len + swap + uncover 2 + swap + uncover 2 + substring3 + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: +log_asset_account_app: + // typed_abi_call/logger.py:31-32 + // @arc4.abimethod + // def log_asset_account_app(self, asset: Asset, account: Account, app: Application) -> None: + proto 3 0 + // typed_abi_call/logger.py:33 + // log(asset.name, account.bytes, app.address) + frame_dig -3 + asset_params_get AssetName + assert // asset exists + byte "" + concat + frame_dig -2 + concat + byte "" + concat + frame_dig -1 + app_params_get AppAddress + assert // application exists + concat + log + retsub + + +// test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: +return_args_after_14th: + // typed_abi_call/logger.py:35-58 + // @arc4.abimethod + // def return_args_after_14th( + // self, + // _a1: arc4.UInt64, + // _a2: arc4.UInt64, + // _a3: arc4.UInt64, + // _a4: arc4.UInt64, + // _a5: arc4.UInt64, + // _a6: arc4.UInt64, + // _a7: arc4.UInt64, + // _a8: arc4.UInt64, + // _a9: arc4.UInt64, + // _a10: arc4.UInt64, + // _a11: arc4.UInt64, + // _a12: arc4.UInt64, + // _a13: arc4.UInt64, + // _a14: arc4.UInt64, + // a15: arc4.UInt8, + // a16: arc4.UInt8, + // a17: arc4.UInt8, + // a18: arc4.UInt8, + // a19: arc4.Tuple[arc4.UInt8, arc4.UInt8, arc4.UInt8, arc4.UInt8], + // a20: arc4.UInt8, + // ) -> arc4.DynamicBytes: + proto 20 1 + // typed_abi_call/logger.py:59 + // last_arg = arc4.Tuple((a15, a16, a17, a18, a19, a20)) + byte 0x + frame_dig -6 + concat + frame_dig -5 + concat + frame_dig -4 + concat + frame_dig -3 + concat + frame_dig -2 + concat + frame_dig -1 + concat + // typed_abi_call/logger.py:60 + // assert Txn.application_args(15) == last_arg.bytes + txna ApplicationArgs 15 + dig 1 + == + assert + // typed_abi_call/logger.py:61 + // return arc4.DynamicBytes(last_arg.bytes) + dup + len + itob + extract 6 2 + swap + concat + retsub diff --git a/test_cases/typed_abi_call/out_unoptimized/Logger.clear.teal b/test_cases/typed_abi_call/out_unoptimized/Logger.clear.teal new file mode 100644 index 0000000000..19dbdafee5 --- /dev/null +++ b/test_cases/typed_abi_call/out_unoptimized/Logger.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 + +test_cases.typed_abi_call.logger.Logger.clear_state_program: + // typed_abi_call/logger.py:6 + // class Logger(ARC4Contract): + int 1 + return diff --git a/test_cases/typed_abi_call/out_unoptimized/Logger.destructured.ir b/test_cases/typed_abi_call/out_unoptimized/Logger.destructured.ir new file mode 100644 index 0000000000..0cf9504f8f --- /dev/null +++ b/test_cases/typed_abi_call/out_unoptimized/Logger.destructured.ir @@ -0,0 +1,224 @@ +contract test_cases.typed_abi_call.logger.Logger: + program approval: + subroutine test_cases.typed_abi_call.logger.Logger.approval_program() -> uint64: + block@0: // L6 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@12 + block@1: // abi_routing_L6 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@10} + block@2: // echo_route_L7 + let tmp%2#0: uint64 = (txn OnCompletion) + let tmp%3#0: uint64 = (== tmp%2#0 NoOp) + (assert tmp%3#0) // OnCompletion is NoOp + let tmp%4#0: uint64 = (txn ApplicationID) + (assert tmp%4#0) // is not creating + let tmp%5#0: bytes = (txna ApplicationArgs 1) + let tmp%6#0: bytes = test_cases.typed_abi_call.logger.Logger.echo(tmp%5#0) + let tmp%7#0: bytes = (concat 0x151f7c75 tmp%6#0) + (log tmp%7#0) + return 1u + block@3: // log_uint64_route_L11 + let tmp%8#0: uint64 = (txn OnCompletion) + let tmp%9#0: uint64 = (== tmp%8#0 NoOp) + (assert tmp%9#0) // OnCompletion is NoOp + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint64(tmp%11#0) + return 1u + block@4: // log_uint512_route_L15 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (== tmp%12#0 NoOp) + (assert tmp%13#0) // OnCompletion is NoOp + let tmp%14#0: uint64 = (txn ApplicationID) + (assert tmp%14#0) // is not creating + let tmp%15#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_uint512(tmp%15#0) + return 1u + block@5: // log_string_route_L19 + let tmp%16#0: uint64 = (txn OnCompletion) + let tmp%17#0: uint64 = (== tmp%16#0 NoOp) + (assert tmp%17#0) // OnCompletion is NoOp + let tmp%18#0: uint64 = (txn ApplicationID) + (assert tmp%18#0) // is not creating + let tmp%19#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_string(tmp%19#0) + return 1u + block@6: // log_bool_route_L23 + let tmp%20#0: uint64 = (txn OnCompletion) + let tmp%21#0: uint64 = (== tmp%20#0 NoOp) + (assert tmp%21#0) // OnCompletion is NoOp + let tmp%22#0: uint64 = (txn ApplicationID) + (assert tmp%22#0) // is not creating + let tmp%23#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bool(tmp%23#0) + return 1u + block@7: // log_bytes_route_L27 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 NoOp) + (assert tmp%25#0) // OnCompletion is NoOp + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + let tmp%27#0: bytes = (txna ApplicationArgs 1) + test_cases.typed_abi_call.logger.Logger.log_bytes(tmp%27#0) + return 1u + block@8: // log_asset_account_app_route_L31 + let tmp%28#0: uint64 = (txn OnCompletion) + let tmp%29#0: uint64 = (== tmp%28#0 NoOp) + (assert tmp%29#0) // OnCompletion is NoOp + let tmp%30#0: uint64 = (txn ApplicationID) + (assert tmp%30#0) // is not creating + let tmp%31#0: bytes = (txna ApplicationArgs 1) + let tmp%32#0: uint64 = (btoi tmp%31#0) + let tmp%33#0: uint64 = ((txnas Assets) tmp%32#0) + let tmp%34#0: bytes = (txna ApplicationArgs 2) + let tmp%35#0: uint64 = (btoi tmp%34#0) + let tmp%36#0: bytes = ((txnas Accounts) tmp%35#0) + let tmp%37#0: bytes = (txna ApplicationArgs 3) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Applications) tmp%38#0) + test_cases.typed_abi_call.logger.Logger.log_asset_account_app(tmp%33#0, tmp%36#0, tmp%39#0) + return 1u + block@9: // return_args_after_14th_route_L35 + let tmp%40#0: uint64 = (txn OnCompletion) + let tmp%41#0: uint64 = (== tmp%40#0 NoOp) + (assert tmp%41#0) // OnCompletion is NoOp + let tmp%42#0: uint64 = (txn ApplicationID) + (assert tmp%42#0) // is not creating + let tmp%43#0: bytes = (txna ApplicationArgs 1) + let tmp%44#0: bytes = (txna ApplicationArgs 2) + let tmp%45#0: bytes = (txna ApplicationArgs 3) + let tmp%46#0: bytes = (txna ApplicationArgs 4) + let tmp%47#0: bytes = (txna ApplicationArgs 5) + let tmp%48#0: bytes = (txna ApplicationArgs 6) + let tmp%49#0: bytes = (txna ApplicationArgs 7) + let tmp%50#0: bytes = (txna ApplicationArgs 8) + let tmp%51#0: bytes = (txna ApplicationArgs 9) + let tmp%52#0: bytes = (txna ApplicationArgs 10) + let tmp%53#0: bytes = (txna ApplicationArgs 11) + let tmp%54#0: bytes = (txna ApplicationArgs 12) + let tmp%55#0: bytes = (txna ApplicationArgs 13) + let tmp%56#0: bytes = (txna ApplicationArgs 14) + let tmp%57#0: bytes = (txna ApplicationArgs 15) + let tmp%58#0: bytes = (extract3 tmp%57#0 0u 1u) + let tmp%59#0: bytes = (txna ApplicationArgs 15) + let tmp%60#0: bytes = (extract3 tmp%59#0 1u 1u) + let tmp%61#0: bytes = (txna ApplicationArgs 15) + let tmp%62#0: bytes = (extract3 tmp%61#0 2u 1u) + let tmp%63#0: bytes = (txna ApplicationArgs 15) + let tmp%64#0: bytes = (extract3 tmp%63#0 3u 1u) + let tmp%65#0: bytes = (txna ApplicationArgs 15) + let tmp%66#0: bytes = (extract3 tmp%65#0 4u 4u) + let tmp%67#0: bytes = (txna ApplicationArgs 15) + let tmp%68#0: bytes = (extract3 tmp%67#0 8u 1u) + let tmp%69#0: bytes = test_cases.typed_abi_call.logger.Logger.return_args_after_14th(tmp%43#0, tmp%44#0, tmp%45#0, tmp%46#0, tmp%47#0, tmp%48#0, tmp%49#0, tmp%50#0, tmp%51#0, tmp%52#0, tmp%53#0, tmp%54#0, tmp%55#0, tmp%56#0, tmp%58#0, tmp%60#0, tmp%62#0, tmp%64#0, tmp%66#0, tmp%68#0) + let tmp%70#0: bytes = (concat 0x151f7c75 tmp%69#0) + (log tmp%70#0) + return 1u + block@10: // switch_case_default_L6 + goto block@11 + block@11: // switch_case_next_L6 + goto block@15 + block@12: // bare_routing_L6 + let tmp%71#0: uint64 = (txn OnCompletion) + switch tmp%71#0 {0u => block@13, * => block@14} + block@13: // create_L6 + let tmp%72#0: uint64 = (txn ApplicationID) + let tmp%73#0: uint64 = (! tmp%72#0) + (assert tmp%73#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L6 + fail // reject transaction + block@15: // after_if_else_L6 + fail // reject transaction + + subroutine test_cases.typed_abi_call.logger.Logger.echo(value: bytes) -> bytes: + block@0: // L7 + let expr_value_trimmed%0#0: bytes = ((extract 2 0) "\x00\x06echo: ") + let expr_value_trimmed%1#0: bytes = ((extract 2 0) value#0) + let concatenated%2#0: bytes = (concat expr_value_trimmed%0#0 expr_value_trimmed%1#0) + let len_%3#0: uint64 = (len concatenated%2#0) + let len_bytes%4#0: bytes = (itob len_%3#0) + let len_16_bit%5#0: bytes = ((extract 6 0) len_bytes%4#0) + let concat_result%6#0: bytes = (concat len_16_bit%5#0 concatenated%2#0) + return concat_result%6#0 + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint64(value: bytes) -> void: + block@0: // L11 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_uint512(value: bytes) -> void: + block@0: // L15 + (log value#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_string(value: bytes) -> void: + block@0: // L19 + let tmp%0#0: bytes = ((extract 2 0) value#0) + (log tmp%0#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bool(value: bytes) -> void: + block@0: // L23 + let tmp%0#0: uint64 = (getbit value#0 0u) + goto tmp%0#0 ? block@1 : block@2 + block@1: // ternary_true_L25 + let ternary_result%1#0: bytes = "True" + goto block@3 + block@2: // ternary_false_L25 + let ternary_result%1#0: bytes = "False" + goto block@3 + block@3: // ternary_merge_L25 + (log ternary_result%1#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_bytes(value: bytes) -> void: + block@0: // L27 + let awst_tmp%0#0: bytes = value#0 + let tmp%1#0: uint64 = (len awst_tmp%0#0) + let tmp%2#0: uint64 = (len awst_tmp%0#0) + let tmp%3#0: uint64 = (< 2u tmp%2#0) + let tmp%4#0: uint64 = (select tmp%1#0 2u tmp%3#0) + let base_length%5#0: uint64 = (len awst_tmp%0#0) + let tmp%6#0: bytes = (substring3 awst_tmp%0#0 tmp%4#0 base_length%5#0) + (log tmp%6#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app(asset: uint64, account: bytes, app: uint64) -> void: + block@0: // L31 + let (value%0#0: bytes, check%1#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert check%1#0) // asset exists + let tmp%2#0: bytes = (concat value%0#0 "") + let tmp%3#0: bytes = (concat tmp%2#0 account#0) + let tmp%4#0: bytes = (concat tmp%3#0 "") + let (value%5#0: bytes, check%6#0: uint64) = ((app_params_get AppAddress) app#0) + (assert check%6#0) // application exists + let tmp%7#0: bytes = (concat tmp%4#0 value%5#0) + (log tmp%7#0) + return + + subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th(_a1: bytes, _a2: bytes, _a3: bytes, _a4: bytes, _a5: bytes, _a6: bytes, _a7: bytes, _a8: bytes, _a9: bytes, _a10: bytes, _a11: bytes, _a12: bytes, _a13: bytes, _a14: bytes, a15: bytes, a16: bytes, a17: bytes, a18: bytes, a19: bytes, a20: bytes) -> bytes: + block@0: // L35 + let encoded_tuple_buffer%1#0: bytes = 0x + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 a15#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 a16#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 a17#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 a18#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 a19#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 a20#0) + let last_arg#0: bytes = encoded_tuple_buffer%1#0 + let tmp%2#0: bytes = (txna ApplicationArgs 15) + let tmp%3#0: uint64 = (== tmp%2#0 last_arg#0) + (assert tmp%3#0) + let length%4#0: uint64 = (len last_arg#0) + let value_as_bytes%5#0: bytes = (itob length%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let tmp%7#0: bytes = (concat value_as_uint16%6#0 last_arg#0) + return tmp%7#0 + + program clear-state: + subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program() -> uint64: + block@0: // L6 + return 1u \ No newline at end of file diff --git a/test_cases/typed_abi_call/puya.log b/test_cases/typed_abi_call/puya.log new file mode 100644 index 0000000000..f4a685d701 --- /dev/null +++ b/test_cases/typed_abi_call/puya.log @@ -0,0 +1,3889 @@ +debug: PuyaOptions(paths=['typed_abi_call'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: Sealing block@0: // L11 +debug: Terminated block@0: // L11 +debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 +debug: Created Phi assignment: let required_budget_with_buffer#1: uint64 = undefined while trying to resolve 'required_budget_with_buffer' in block@1: // while_top_L19 +debug: Terminated block@1: // while_top_L19 +debug: Sealing block@None: // while_body_L19 +debug: Looking for 'fee_source' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 +debug: Created Phi assignment: let fee_source#1: uint64 = undefined while trying to resolve 'fee_source' in block@1: // while_top_L19 +debug: Terminated block@2: // while_body_L19 +debug: Sealing block@None: // switch_case_default_L25 +debug: Sealing block@None: // switch_case_0_L27 +debug: Sealing block@None: // switch_case_1_L29 +debug: Terminated block@3: // switch_case_0_L27 +debug: Terminated block@4: // switch_case_1_L29 +debug: Terminated block@5: // switch_case_default_L25 +debug: Sealing block@6: // switch_case_next_L25 +debug: Terminated block@6: // switch_case_next_L25 +debug: Sealing block@1: // while_top_L19 +debug: Added required_budget_with_buffer#0 to Phi node: let required_budget_with_buffer#1: uint64 = φ(required_budget_with_buffer#0 <- block@0) in block@0: // L11 +debug: Created Phi assignment: let required_budget_with_buffer#2: uint64 = undefined while trying to resolve 'required_budget_with_buffer' in block@6: // switch_case_next_L25 +debug: Added required_budget_with_buffer#1 to Phi node: let required_budget_with_buffer#2: uint64 = φ(required_budget_with_buffer#1 <- block@3) in block@3: // switch_case_0_L27 +debug: Added required_budget_with_buffer#1 to Phi node: let required_budget_with_buffer#2: uint64 = φ(required_budget_with_buffer#1 <- block@3, required_budget_with_buffer#1 <- block@4) in block@4: // switch_case_1_L29 +debug: Added required_budget_with_buffer#1 to Phi node: let required_budget_with_buffer#2: uint64 = φ(required_budget_with_buffer#1 <- block@3, required_budget_with_buffer#1 <- block@4, required_budget_with_buffer#1 <- block@5) in block@5: // switch_case_default_L25 +debug: Replacing trivial Phi node: let required_budget_with_buffer#2: uint64 = φ(required_budget_with_buffer#1 <- block@3, required_budget_with_buffer#1 <- block@4, required_budget_with_buffer#1 <- block@5) (required_budget_with_buffer#2) with required_budget_with_buffer#1 +debug: Deleting Phi assignment: let required_budget_with_buffer#2: uint64 = φ(required_budget_with_buffer#1 <- block@3, required_budget_with_buffer#1 <- block@4, required_budget_with_buffer#1 <- block@5) +debug: Replaced trivial Phi node: let required_budget_with_buffer#2: uint64 = φ(required_budget_with_buffer#1 <- block@3, required_budget_with_buffer#1 <- block@4, required_budget_with_buffer#1 <- block@5) (required_budget_with_buffer#2) with required_budget_with_buffer#1 in current definition for 1 blocks +debug: Added required_budget_with_buffer#1 to Phi node: let required_budget_with_buffer#1: uint64 = φ(required_budget_with_buffer#0 <- block@0, required_budget_with_buffer#1 <- block@6) in block@6: // switch_case_next_L25 +debug: Replacing trivial Phi node: let required_budget_with_buffer#1: uint64 = φ(required_budget_with_buffer#0 <- block@0, required_budget_with_buffer#1 <- block@6) (required_budget_with_buffer#1) with required_budget_with_buffer#0 +debug: Deleting Phi assignment: let required_budget_with_buffer#1: uint64 = φ(required_budget_with_buffer#0 <- block@0, required_budget_with_buffer#1 <- block@6) +debug: Replaced trivial Phi node: let required_budget_with_buffer#1: uint64 = φ(required_budget_with_buffer#0 <- block@0, required_budget_with_buffer#1 <- block@6) (required_budget_with_buffer#1) with required_budget_with_buffer#0 in current definition for 6 blocks +debug: Added fee_source#0 to Phi node: let fee_source#1: uint64 = φ(fee_source#0 <- block@0) in block@0: // L11 +debug: Created Phi assignment: let fee_source#2: uint64 = undefined while trying to resolve 'fee_source' in block@6: // switch_case_next_L25 +debug: Added fee_source#1 to Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3) in block@3: // switch_case_0_L27 +debug: Added fee_source#1 to Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3, fee_source#1 <- block@4) in block@4: // switch_case_1_L29 +debug: Added fee_source#1 to Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3, fee_source#1 <- block@4, fee_source#1 <- block@5) in block@5: // switch_case_default_L25 +debug: Replacing trivial Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3, fee_source#1 <- block@4, fee_source#1 <- block@5) (fee_source#2) with fee_source#1 +debug: Deleting Phi assignment: let fee_source#2: uint64 = φ(fee_source#1 <- block@3, fee_source#1 <- block@4, fee_source#1 <- block@5) +debug: Replaced trivial Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3, fee_source#1 <- block@4, fee_source#1 <- block@5) (fee_source#2) with fee_source#1 in current definition for 1 blocks +debug: Added fee_source#1 to Phi node: let fee_source#1: uint64 = φ(fee_source#0 <- block@0, fee_source#1 <- block@6) in block@6: // switch_case_next_L25 +debug: Replacing trivial Phi node: let fee_source#1: uint64 = φ(fee_source#0 <- block@0, fee_source#1 <- block@6) (fee_source#1) with fee_source#0 +debug: Deleting Phi assignment: let fee_source#1: uint64 = φ(fee_source#0 <- block@0, fee_source#1 <- block@6) +debug: Replaced trivial Phi node: let fee_source#1: uint64 = φ(fee_source#0 <- block@0, fee_source#1 <- block@6) (fee_source#1) with fee_source#0 in current definition for 6 blocks +debug: Sealing block@None: // after_while_L19 +debug: Terminated block@7: // after_while_L19 +debug: Sealing block@0: // L20 +debug: Terminated block@0: // L20 +debug: Sealing block@0: // L39 +debug: Terminated block@0: // L39 +debug: Sealing block@0: // L57 +debug: Terminated block@0: // L57 +debug: Sealing block@0: // L84 +debug: Terminated block@0: // L84 +debug: Sealing block@None: // if_body_L106 +debug: Sealing block@None: // else_body_L106 +debug: Terminated block@1: // if_body_L106 +debug: Sealing block@2: // after_if_else_L106 +debug: Created Phi assignment: let array_length#1: uint64 = undefined while trying to resolve 'array_length' in block@2: // after_if_else_L106 +debug: Added array_length#0 to Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0) in block@0: // L84 +debug: Added array_length#0 to Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) in block@1: // if_body_L106 +debug: Replacing trivial Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) (array_length#1) with array_length#0 +debug: Deleting Phi assignment: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) +debug: Replaced trivial Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) (array_length#1) with array_length#0 in current definition for 1 blocks +debug: Created Phi assignment: let is_packed#1: uint64 = undefined while trying to resolve 'is_packed' in block@2: // after_if_else_L106 +debug: Added is_packed#0 to Phi node: let is_packed#1: uint64 = φ(is_packed#0 <- block@0) in block@0: // L84 +debug: Added is_packed#0 to Phi node: let is_packed#1: uint64 = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) in block@1: // if_body_L106 +debug: Replacing trivial Phi node: let is_packed#1: uint64 = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) (is_packed#1) with is_packed#0 +debug: Deleting Phi assignment: let is_packed#1: uint64 = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) +debug: Replaced trivial Phi node: let is_packed#1: uint64 = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) (is_packed#1) with is_packed#0 in current definition for 1 blocks +debug: Terminated block@2: // after_if_else_L106 +debug: Sealing block@None: // ternary_true_L110 +debug: Sealing block@None: // ternary_false_L110 +debug: Terminated block@3: // ternary_true_L110 +debug: Terminated block@4: // ternary_false_L110 +debug: Sealing block@5: // ternary_merge_L110 +debug: Created Phi assignment: let ternary_result%6#2: uint64 = undefined while trying to resolve 'ternary_result%6' in block@5: // ternary_merge_L110 +debug: Added ternary_result%6#0 to Phi node: let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@3) in block@3: // ternary_true_L110 +debug: Added ternary_result%6#1 to Phi node: let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@3, ternary_result%6#1 <- block@4) in block@4: // ternary_false_L110 +debug: Created Phi assignment: let new_items_count#1: uint64 = undefined while trying to resolve 'new_items_count' in block@5: // ternary_merge_L110 +debug: Created Phi assignment: let new_items_count#2: uint64 = undefined while trying to resolve 'new_items_count' in block@2: // after_if_else_L106 +debug: Added new_items_count#0 to Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@0) in block@0: // L84 +debug: Added new_items_count#0 to Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) in block@1: // if_body_L106 +debug: Replacing trivial Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) (new_items_count#2) with new_items_count#0 +debug: Deleting Phi assignment: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) +debug: Replaced trivial Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) (new_items_count#2) with new_items_count#0 in current definition for 1 blocks +debug: Added new_items_count#0 to Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@3) in block@3: // ternary_true_L110 +debug: Added new_items_count#0 to Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@3, new_items_count#0 <- block@4) in block@4: // ternary_false_L110 +debug: Replacing trivial Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@3, new_items_count#0 <- block@4) (new_items_count#1) with new_items_count#0 +debug: Deleting Phi assignment: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@3, new_items_count#0 <- block@4) +debug: Replaced trivial Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@3, new_items_count#0 <- block@4) (new_items_count#1) with new_items_count#0 in current definition for 1 blocks +debug: Terminated block@5: // ternary_merge_L110 +debug: Looking for 'range_item%7' in an unsealed block creating an incomplete Phi: block@6: // for_header_L110 +debug: Created Phi assignment: let range_item%7#1: uint64 = undefined while trying to resolve 'range_item%7' in block@6: // for_header_L110 +debug: Terminated block@6: // for_header_L110 +debug: Looking for 'range_item%7' in an unsealed block creating an incomplete Phi: block@7: // for_body_L110 +debug: Created Phi assignment: let range_item%7#2: uint64 = undefined while trying to resolve 'range_item%7' in block@7: // for_body_L110 +debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@7: // for_body_L110 +debug: Created Phi assignment: let result#2: bytes = undefined while trying to resolve 'result' in block@7: // for_body_L110 +debug: Looking for 'write_offset' in an unsealed block creating an incomplete Phi: block@7: // for_body_L110 +debug: Created Phi assignment: let write_offset#1: uint64 = undefined while trying to resolve 'write_offset' in block@7: // for_body_L110 +debug: Looking for 'new_items_bytes' in an unsealed block creating an incomplete Phi: block@7: // for_body_L110 +debug: Created Phi assignment: let new_items_bytes#1: bytes = undefined while trying to resolve 'new_items_bytes' in block@7: // for_body_L110 +debug: Terminated block@7: // for_body_L110 +debug: Sealing block@8: // for_footer_L110 +debug: Terminated block@8: // for_footer_L110 +debug: Sealing block@9: // for_increment_L110 +debug: Terminated block@9: // for_increment_L110 +debug: Sealing block@6: // for_header_L110 +debug: Added range_item%7#0 to Phi node: let range_item%7#1: uint64 = φ(range_item%7#0 <- block@5) in block@5: // ternary_merge_L110 +debug: Added range_item%7#3 to Phi node: let range_item%7#1: uint64 = φ(range_item%7#0 <- block@5, range_item%7#3 <- block@9) in block@9: // for_increment_L110 +debug: Sealing block@7: // for_body_L110 +debug: Added range_item%7#1 to Phi node: let range_item%7#2: uint64 = φ(range_item%7#1 <- block@6) in block@6: // for_header_L110 +debug: Replacing trivial Phi node: let range_item%7#2: uint64 = φ(range_item%7#1 <- block@6) (range_item%7#2) with range_item%7#1 +debug: Deleting Phi assignment: let range_item%7#2: uint64 = φ(range_item%7#1 <- block@6) +debug: Replaced trivial Phi node: let range_item%7#2: uint64 = φ(range_item%7#1 <- block@6) (range_item%7#2) with range_item%7#1 in current definition for 2 blocks +debug: Created Phi assignment: let result#4: bytes = undefined while trying to resolve 'result' in block@6: // for_header_L110 +debug: Created Phi assignment: let result#5: bytes = undefined while trying to resolve 'result' in block@5: // ternary_merge_L110 +debug: Created Phi assignment: let result#6: bytes = undefined while trying to resolve 'result' in block@2: // after_if_else_L106 +debug: Added result#0 to Phi node: let result#6: bytes = φ(result#0 <- block@0) in block@0: // L84 +debug: Added result#1 to Phi node: let result#6: bytes = φ(result#0 <- block@0, result#1 <- block@1) in block@1: // if_body_L106 +debug: Added result#6 to Phi node: let result#5: bytes = φ(result#6 <- block@3) in block@3: // ternary_true_L110 +debug: Added result#6 to Phi node: let result#5: bytes = φ(result#6 <- block@3, result#6 <- block@4) in block@4: // ternary_false_L110 +debug: Replacing trivial Phi node: let result#5: bytes = φ(result#6 <- block@3, result#6 <- block@4) (result#5) with result#6 +debug: Deleting Phi assignment: let result#5: bytes = φ(result#6 <- block@3, result#6 <- block@4) +debug: Replaced trivial Phi node: let result#5: bytes = φ(result#6 <- block@3, result#6 <- block@4) (result#5) with result#6 in current definition for 1 blocks +debug: Added result#6 to Phi node: let result#4: bytes = φ(result#6 <- block@5) in block@5: // ternary_merge_L110 +debug: Added result#3 to Phi node: let result#4: bytes = φ(result#6 <- block@5, result#3 <- block@9) in block@9: // for_increment_L110 +debug: Added result#4 to Phi node: let result#2: bytes = φ(result#4 <- block@6) in block@6: // for_header_L110 +debug: Replacing trivial Phi node: let result#2: bytes = φ(result#4 <- block@6) (result#2) with result#4 +debug: Deleting Phi assignment: let result#2: bytes = φ(result#4 <- block@6) +debug: Replaced trivial Phi node: let result#2: bytes = φ(result#4 <- block@6) (result#2) with result#4 in current definition for 0 blocks +debug: Created Phi assignment: let write_offset#3: uint64 = undefined while trying to resolve 'write_offset' in block@6: // for_header_L110 +debug: Created Phi assignment: let write_offset#4: uint64 = undefined while trying to resolve 'write_offset' in block@5: // ternary_merge_L110 +debug: Added write_offset#0 to Phi node: let write_offset#4: uint64 = φ(write_offset#0 <- block@3) in block@3: // ternary_true_L110 +debug: Added write_offset#0 to Phi node: let write_offset#4: uint64 = φ(write_offset#0 <- block@3, write_offset#0 <- block@4) in block@4: // ternary_false_L110 +debug: Replacing trivial Phi node: let write_offset#4: uint64 = φ(write_offset#0 <- block@3, write_offset#0 <- block@4) (write_offset#4) with write_offset#0 +debug: Deleting Phi assignment: let write_offset#4: uint64 = φ(write_offset#0 <- block@3, write_offset#0 <- block@4) +debug: Replaced trivial Phi node: let write_offset#4: uint64 = φ(write_offset#0 <- block@3, write_offset#0 <- block@4) (write_offset#4) with write_offset#0 in current definition for 1 blocks +debug: Added write_offset#0 to Phi node: let write_offset#3: uint64 = φ(write_offset#0 <- block@5) in block@5: // ternary_merge_L110 +debug: Added write_offset#2 to Phi node: let write_offset#3: uint64 = φ(write_offset#0 <- block@5, write_offset#2 <- block@9) in block@9: // for_increment_L110 +debug: Added write_offset#3 to Phi node: let write_offset#1: uint64 = φ(write_offset#3 <- block@6) in block@6: // for_header_L110 +debug: Replacing trivial Phi node: let write_offset#1: uint64 = φ(write_offset#3 <- block@6) (write_offset#1) with write_offset#3 +debug: Deleting Phi assignment: let write_offset#1: uint64 = φ(write_offset#3 <- block@6) +debug: Replaced trivial Phi node: let write_offset#1: uint64 = φ(write_offset#3 <- block@6) (write_offset#1) with write_offset#3 in current definition for 0 blocks +debug: Created Phi assignment: let new_items_bytes#2: bytes = undefined while trying to resolve 'new_items_bytes' in block@6: // for_header_L110 +debug: Created Phi assignment: let new_items_bytes#3: bytes = undefined while trying to resolve 'new_items_bytes' in block@5: // ternary_merge_L110 +debug: Created Phi assignment: let new_items_bytes#4: bytes = undefined while trying to resolve 'new_items_bytes' in block@2: // after_if_else_L106 +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#4: bytes = φ(new_items_bytes#0 <- block@0) in block@0: // L84 +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#4: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) in block@1: // if_body_L106 +debug: Replacing trivial Phi node: let new_items_bytes#4: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) (new_items_bytes#4) with new_items_bytes#0 +debug: Deleting Phi assignment: let new_items_bytes#4: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) +debug: Replaced trivial Phi node: let new_items_bytes#4: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) (new_items_bytes#4) with new_items_bytes#0 in current definition for 1 blocks +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#3: bytes = φ(new_items_bytes#0 <- block@3) in block@3: // ternary_true_L110 +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#3: bytes = φ(new_items_bytes#0 <- block@3, new_items_bytes#0 <- block@4) in block@4: // ternary_false_L110 +debug: Replacing trivial Phi node: let new_items_bytes#3: bytes = φ(new_items_bytes#0 <- block@3, new_items_bytes#0 <- block@4) (new_items_bytes#3) with new_items_bytes#0 +debug: Deleting Phi assignment: let new_items_bytes#3: bytes = φ(new_items_bytes#0 <- block@3, new_items_bytes#0 <- block@4) +debug: Replaced trivial Phi node: let new_items_bytes#3: bytes = φ(new_items_bytes#0 <- block@3, new_items_bytes#0 <- block@4) (new_items_bytes#3) with new_items_bytes#0 in current definition for 1 blocks +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@5) in block@5: // ternary_merge_L110 +debug: Added new_items_bytes#1 to Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@5, new_items_bytes#1 <- block@9) in block@9: // for_increment_L110 +debug: Added new_items_bytes#2 to Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#2 <- block@6) in block@6: // for_header_L110 +debug: Replacing trivial Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#2 <- block@6) (new_items_bytes#1) with new_items_bytes#2 +debug: Deleting Phi assignment: let new_items_bytes#1: bytes = φ(new_items_bytes#2 <- block@6) +debug: Replacing trivial Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@5, new_items_bytes#2 <- block@9) (new_items_bytes#2) with new_items_bytes#0 +debug: Deleting Phi assignment: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@5, new_items_bytes#2 <- block@9) +debug: Replaced trivial Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#2 <- block@6) (new_items_bytes#1) with new_items_bytes#2 in current definition for 3 blocks +debug: Replaced trivial Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@5, new_items_bytes#2 <- block@9) (new_items_bytes#2) with new_items_bytes#0 in current definition for 4 blocks +debug: Sealing block@None: // after_for_L110 +debug: Terminated block@10: // after_for_L110 +debug: Sealing block@0: // L117 +debug: Terminated block@0: // L117 +debug: Sealing block@0: // L139 +debug: Terminated block@0: // L139 +debug: Sealing block@0: // L166 +debug: Terminated block@0: // L166 +debug: Sealing block@0: // L195 +debug: Terminated block@0: // L195 +debug: Sealing block@None: // if_body_L210 +debug: Sealing block@None: // else_body_L210 +debug: Terminated block@1: // if_body_L210 +debug: Terminated block@2: // else_body_L210 +debug: Sealing block@3: // after_if_else_L210 +debug: Created Phi assignment: let length#1: uint64 = undefined while trying to resolve 'length' in block@3: // after_if_else_L210 +debug: Added length#0 to Phi node: let length#1: uint64 = φ(length#0 <- block@1) in block@1: // if_body_L210 +debug: Added length#0 to Phi node: let length#1: uint64 = φ(length#0 <- block@1, length#0 <- block@2) in block@2: // else_body_L210 +debug: Replacing trivial Phi node: let length#1: uint64 = φ(length#0 <- block@1, length#0 <- block@2) (length#1) with length#0 +debug: Deleting Phi assignment: let length#1: uint64 = φ(length#0 <- block@1, length#0 <- block@2) +debug: Replaced trivial Phi node: let length#1: uint64 = φ(length#0 <- block@1, length#0 <- block@2) (length#1) with length#0 in current definition for 1 blocks +debug: Created Phi assignment: let start_at_index#1: uint64 = undefined while trying to resolve 'start_at_index' in block@3: // after_if_else_L210 +debug: Added start_at_index#0 to Phi node: let start_at_index#1: uint64 = φ(start_at_index#0 <- block@1) in block@1: // if_body_L210 +debug: Added start_at_index#0 to Phi node: let start_at_index#1: uint64 = φ(start_at_index#0 <- block@1, start_at_index#0 <- block@2) in block@2: // else_body_L210 +debug: Replacing trivial Phi node: let start_at_index#1: uint64 = φ(start_at_index#0 <- block@1, start_at_index#0 <- block@2) (start_at_index#1) with start_at_index#0 +debug: Deleting Phi assignment: let start_at_index#1: uint64 = φ(start_at_index#0 <- block@1, start_at_index#0 <- block@2) +debug: Replaced trivial Phi node: let start_at_index#1: uint64 = φ(start_at_index#0 <- block@1, start_at_index#0 <- block@2) (start_at_index#1) with start_at_index#0 in current definition for 1 blocks +debug: Terminated block@3: // after_if_else_L210 +debug: Looking for 'range_item%1' in an unsealed block creating an incomplete Phi: block@4: // for_header_L215 +debug: Created Phi assignment: let range_item%1#1: uint64 = undefined while trying to resolve 'range_item%1' in block@4: // for_header_L215 +debug: Terminated block@4: // for_header_L215 +debug: Looking for 'range_item%1' in an unsealed block creating an incomplete Phi: block@5: // for_body_L215 +debug: Created Phi assignment: let range_item%1#2: uint64 = undefined while trying to resolve 'range_item%1' in block@5: // for_body_L215 +debug: Looking for 'tail_cursor' in an unsealed block creating an incomplete Phi: block@5: // for_body_L215 +debug: Created Phi assignment: let tail_cursor#2: uint64 = undefined while trying to resolve 'tail_cursor' in block@5: // for_body_L215 +debug: Looking for 'array_data' in an unsealed block creating an incomplete Phi: block@5: // for_body_L215 +debug: Created Phi assignment: let array_data#1: bytes = undefined while trying to resolve 'array_data' in block@5: // for_body_L215 +debug: Looking for 'header_cursor' in an unsealed block creating an incomplete Phi: block@5: // for_body_L215 +debug: Created Phi assignment: let header_cursor#1: uint64 = undefined while trying to resolve 'header_cursor' in block@5: // for_body_L215 +debug: Terminated block@5: // for_body_L215 +debug: Sealing block@6: // for_footer_L215 +debug: Terminated block@6: // for_footer_L215 +debug: Sealing block@7: // for_increment_L215 +debug: Terminated block@7: // for_increment_L215 +debug: Sealing block@4: // for_header_L215 +debug: Added range_item%1#0 to Phi node: let range_item%1#1: uint64 = φ(range_item%1#0 <- block@3) in block@3: // after_if_else_L210 +debug: Added range_item%1#3 to Phi node: let range_item%1#1: uint64 = φ(range_item%1#0 <- block@3, range_item%1#3 <- block@7) in block@7: // for_increment_L215 +debug: Sealing block@5: // for_body_L215 +debug: Added range_item%1#1 to Phi node: let range_item%1#2: uint64 = φ(range_item%1#1 <- block@4) in block@4: // for_header_L215 +debug: Replacing trivial Phi node: let range_item%1#2: uint64 = φ(range_item%1#1 <- block@4) (range_item%1#2) with range_item%1#1 +debug: Deleting Phi assignment: let range_item%1#2: uint64 = φ(range_item%1#1 <- block@4) +debug: Replaced trivial Phi node: let range_item%1#2: uint64 = φ(range_item%1#1 <- block@4) (range_item%1#2) with range_item%1#1 in current definition for 2 blocks +debug: Created Phi assignment: let tail_cursor#4: uint64 = undefined while trying to resolve 'tail_cursor' in block@4: // for_header_L215 +debug: Created Phi assignment: let tail_cursor#5: uint64 = undefined while trying to resolve 'tail_cursor' in block@3: // after_if_else_L210 +debug: Added tail_cursor#0 to Phi node: let tail_cursor#5: uint64 = φ(tail_cursor#0 <- block@1) in block@1: // if_body_L210 +debug: Added tail_cursor#1 to Phi node: let tail_cursor#5: uint64 = φ(tail_cursor#0 <- block@1, tail_cursor#1 <- block@2) in block@2: // else_body_L210 +debug: Added tail_cursor#5 to Phi node: let tail_cursor#4: uint64 = φ(tail_cursor#5 <- block@3) in block@3: // after_if_else_L210 +debug: Added tail_cursor#3 to Phi node: let tail_cursor#4: uint64 = φ(tail_cursor#5 <- block@3, tail_cursor#3 <- block@7) in block@7: // for_increment_L215 +debug: Added tail_cursor#4 to Phi node: let tail_cursor#2: uint64 = φ(tail_cursor#4 <- block@4) in block@4: // for_header_L215 +debug: Replacing trivial Phi node: let tail_cursor#2: uint64 = φ(tail_cursor#4 <- block@4) (tail_cursor#2) with tail_cursor#4 +debug: Deleting Phi assignment: let tail_cursor#2: uint64 = φ(tail_cursor#4 <- block@4) +debug: Replaced trivial Phi node: let tail_cursor#2: uint64 = φ(tail_cursor#4 <- block@4) (tail_cursor#2) with tail_cursor#4 in current definition for 0 blocks +debug: Created Phi assignment: let array_data#3: bytes = undefined while trying to resolve 'array_data' in block@4: // for_header_L215 +debug: Created Phi assignment: let array_data#4: bytes = undefined while trying to resolve 'array_data' in block@3: // after_if_else_L210 +debug: Added array_data#0 to Phi node: let array_data#4: bytes = φ(array_data#0 <- block@1) in block@1: // if_body_L210 +debug: Added array_data#0 to Phi node: let array_data#4: bytes = φ(array_data#0 <- block@1, array_data#0 <- block@2) in block@2: // else_body_L210 +debug: Replacing trivial Phi node: let array_data#4: bytes = φ(array_data#0 <- block@1, array_data#0 <- block@2) (array_data#4) with array_data#0 +debug: Deleting Phi assignment: let array_data#4: bytes = φ(array_data#0 <- block@1, array_data#0 <- block@2) +debug: Replaced trivial Phi node: let array_data#4: bytes = φ(array_data#0 <- block@1, array_data#0 <- block@2) (array_data#4) with array_data#0 in current definition for 1 blocks +debug: Added array_data#0 to Phi node: let array_data#3: bytes = φ(array_data#0 <- block@3) in block@3: // after_if_else_L210 +debug: Added array_data#2 to Phi node: let array_data#3: bytes = φ(array_data#0 <- block@3, array_data#2 <- block@7) in block@7: // for_increment_L215 +debug: Added array_data#3 to Phi node: let array_data#1: bytes = φ(array_data#3 <- block@4) in block@4: // for_header_L215 +debug: Replacing trivial Phi node: let array_data#1: bytes = φ(array_data#3 <- block@4) (array_data#1) with array_data#3 +debug: Deleting Phi assignment: let array_data#1: bytes = φ(array_data#3 <- block@4) +debug: Replaced trivial Phi node: let array_data#1: bytes = φ(array_data#3 <- block@4) (array_data#1) with array_data#3 in current definition for 0 blocks +debug: Created Phi assignment: let header_cursor#3: uint64 = undefined while trying to resolve 'header_cursor' in block@4: // for_header_L215 +debug: Created Phi assignment: let header_cursor#4: uint64 = undefined while trying to resolve 'header_cursor' in block@3: // after_if_else_L210 +debug: Added header_cursor#0 to Phi node: let header_cursor#4: uint64 = φ(header_cursor#0 <- block@1) in block@1: // if_body_L210 +debug: Added header_cursor#0 to Phi node: let header_cursor#4: uint64 = φ(header_cursor#0 <- block@1, header_cursor#0 <- block@2) in block@2: // else_body_L210 +debug: Replacing trivial Phi node: let header_cursor#4: uint64 = φ(header_cursor#0 <- block@1, header_cursor#0 <- block@2) (header_cursor#4) with header_cursor#0 +debug: Deleting Phi assignment: let header_cursor#4: uint64 = φ(header_cursor#0 <- block@1, header_cursor#0 <- block@2) +debug: Replaced trivial Phi node: let header_cursor#4: uint64 = φ(header_cursor#0 <- block@1, header_cursor#0 <- block@2) (header_cursor#4) with header_cursor#0 in current definition for 1 blocks +debug: Added header_cursor#0 to Phi node: let header_cursor#3: uint64 = φ(header_cursor#0 <- block@3) in block@3: // after_if_else_L210 +debug: Added header_cursor#2 to Phi node: let header_cursor#3: uint64 = φ(header_cursor#0 <- block@3, header_cursor#2 <- block@7) in block@7: // for_increment_L215 +debug: Added header_cursor#3 to Phi node: let header_cursor#1: uint64 = φ(header_cursor#3 <- block@4) in block@4: // for_header_L215 +debug: Replacing trivial Phi node: let header_cursor#1: uint64 = φ(header_cursor#3 <- block@4) (header_cursor#1) with header_cursor#3 +debug: Deleting Phi assignment: let header_cursor#1: uint64 = φ(header_cursor#3 <- block@4) +debug: Replaced trivial Phi node: let header_cursor#1: uint64 = φ(header_cursor#3 <- block@4) (header_cursor#1) with header_cursor#3 in current definition for 0 blocks +debug: Sealing block@None: // after_for_L215 +debug: Terminated block@8: // after_for_L215 +debug: Sealing block@0: // L4 +debug: Terminated block@0: // L4 +debug: Looking for 'start' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 +debug: Created Phi assignment: let start#1: uint64 = undefined while trying to resolve 'start' in block@1: // while_top_L11 +debug: Looking for 'item' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 +debug: Created Phi assignment: let item#1: bytes = undefined while trying to resolve 'item' in block@1: // while_top_L11 +debug: Looking for 'sequence' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 +debug: Created Phi assignment: let sequence#1: bytes = undefined while trying to resolve 'sequence' in block@1: // while_top_L11 +debug: Terminated block@1: // while_top_L11 +debug: Sealing block@None: // while_body_L11 +debug: Terminated block@2: // while_body_L11 +debug: Sealing block@None: // if_body_L12 +debug: Sealing block@None: // else_body_L12 +debug: Terminated block@3: // if_body_L12 +debug: Sealing block@4: // after_if_else_L12 +debug: Terminated block@4: // after_if_else_L12 +debug: Sealing block@1: // while_top_L11 +debug: Added start#0 to Phi node: let start#1: uint64 = φ(start#0 <- block@0) in block@0: // L4 +debug: Added start#2 to Phi node: let start#1: uint64 = φ(start#0 <- block@0, start#2 <- block@4) in block@4: // after_if_else_L12 +debug: Added item#0 to Phi node: let item#1: bytes = φ(item#0 <- block@0) in block@0: // L4 +debug: Added item#1 to Phi node: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) in block@4: // after_if_else_L12 +debug: Replacing trivial Phi node: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) (item#1) with item#0 +debug: Deleting Phi assignment: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) +debug: Replaced trivial Phi node: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) (item#1) with item#0 in current definition for 3 blocks +debug: Added sequence#0 to Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0) in block@0: // L4 +debug: Added sequence#1 to Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) in block@4: // after_if_else_L12 +debug: Replacing trivial Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) (sequence#1) with sequence#0 +debug: Deleting Phi assignment: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) +debug: Replaced trivial Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) (sequence#1) with sequence#0 in current definition for 3 blocks +debug: Sealing block@None: // after_while_L11 +debug: Terminated block@5: // after_while_L11 +debug: Sealing block@0: // L7 +debug: Terminated block@0: // L7 +debug: Sealing block@0: // L11 +debug: Terminated block@0: // L11 +debug: Sealing block@0: // L15 +debug: Terminated block@0: // L15 +debug: Sealing block@0: // L19 +debug: Terminated block@0: // L19 +debug: Sealing block@0: // L23 +debug: Terminated block@0: // L23 +debug: Sealing block@None: // ternary_true_L25 +debug: Sealing block@None: // ternary_false_L25 +debug: Terminated block@1: // ternary_true_L25 +debug: Terminated block@2: // ternary_false_L25 +debug: Sealing block@3: // ternary_merge_L25 +debug: Created Phi assignment: let ternary_result%1#2: bytes = undefined while trying to resolve 'ternary_result%1' in block@3: // ternary_merge_L25 +debug: Added ternary_result%1#0 to Phi node: let ternary_result%1#2: bytes = φ(ternary_result%1#0 <- block@1) in block@1: // ternary_true_L25 +debug: Added ternary_result%1#1 to Phi node: let ternary_result%1#2: bytes = φ(ternary_result%1#0 <- block@1, ternary_result%1#1 <- block@2) in block@2: // ternary_false_L25 +debug: Terminated block@3: // ternary_merge_L25 +debug: Sealing block@0: // L27 +debug: Terminated block@0: // L27 +debug: Sealing block@0: // L31 +debug: Terminated block@0: // L31 +debug: Sealing block@0: // L35 +debug: Terminated block@0: // L35 +debug: Sealing block@0: // L6 +debug: Terminated block@0: // L6 +debug: Sealing block@None: // abi_routing_L6 +debug: Sealing block@None: // bare_routing_L6 +debug: Terminated block@1: // abi_routing_L6 +debug: Sealing block@None: // switch_case_default_L6 +debug: Sealing block@None: // echo_route_L7 +debug: Sealing block@None: // log_uint64_route_L11 +debug: Sealing block@None: // log_uint512_route_L15 +debug: Sealing block@None: // log_string_route_L19 +debug: Sealing block@None: // log_bool_route_L23 +debug: Sealing block@None: // log_bytes_route_L27 +debug: Sealing block@None: // log_asset_account_app_route_L31 +debug: Sealing block@None: // return_args_after_14th_route_L35 +debug: Terminated block@2: // echo_route_L7 +debug: Terminated block@3: // log_uint64_route_L11 +debug: Terminated block@4: // log_uint512_route_L15 +debug: Terminated block@5: // log_string_route_L19 +debug: Terminated block@6: // log_bool_route_L23 +debug: Terminated block@7: // log_bytes_route_L27 +debug: Terminated block@8: // log_asset_account_app_route_L31 +debug: Terminated block@9: // return_args_after_14th_route_L35 +debug: Terminated block@10: // switch_case_default_L6 +debug: Sealing block@11: // switch_case_next_L6 +debug: Terminated block@11: // switch_case_next_L6 +debug: Terminated block@12: // bare_routing_L6 +debug: Sealing block@None: // reject_bare_on_completion_L6 +debug: Sealing block@None: // create_L6 +debug: Terminated block@13: // create_L6 +debug: Terminated block@14: // reject_bare_on_completion_L6 +debug: Sealing block@None: // switch_case_next_L6 +debug: Sealing block@15: // after_if_else_L6 +debug: Terminated block@15: // after_if_else_L6 +debug: Sealing block@0: // L6 +debug: Terminated block@0: // L6 +debug: Sealing block@0: // L7 +debug: Terminated block@0: // L7 +debug: Sealing block@1: // next_txn_L9 +debug: Terminated block@1: // next_txn_L9 +debug: Sealing block@2: // next_txn_L11 +debug: Terminated block@2: // next_txn_L11 +debug: Sealing block@3: // next_txn_L13 +debug: Terminated block@3: // next_txn_L13 +debug: Sealing block@4: // next_txn_L15 +debug: Terminated block@4: // next_txn_L15 +debug: Sealing block@5: // next_txn_L17 +debug: Terminated block@5: // next_txn_L17 +debug: Sealing block@0: // L20 +debug: Terminated block@0: // L20 +debug: Sealing block@1: // next_txn_L22 +debug: Terminated block@1: // next_txn_L22 +debug: Sealing block@2: // next_txn_L25 +debug: Terminated block@2: // next_txn_L25 +debug: Sealing block@3: // next_txn_L28 +debug: Terminated block@3: // next_txn_L28 +debug: Sealing block@4: // next_txn_L31 +debug: Terminated block@4: // next_txn_L31 +debug: Sealing block@5: // next_txn_L34 +debug: Terminated block@5: // next_txn_L34 +debug: Sealing block@0: // L37 +debug: Terminated block@0: // L37 +debug: Sealing block@1: // next_txn_L39 +debug: Terminated block@1: // next_txn_L39 +debug: Sealing block@0: // L66 +debug: Terminated block@0: // L66 +debug: Sealing block@1: // next_txn_L68 +debug: Terminated block@1: // next_txn_L68 +debug: Sealing block@2: // next_txn_L71 +debug: Terminated block@2: // next_txn_L71 +debug: Sealing block@3: // next_txn_L74 +debug: Terminated block@3: // next_txn_L74 +debug: Sealing block@4: // next_txn_L77 +debug: Terminated block@4: // next_txn_L77 +debug: Sealing block@0: // L80 +debug: Terminated block@0: // L80 +debug: Sealing block@1: // next_txn_L82 +debug: Terminated block@1: // next_txn_L82 +debug: Sealing block@0: // L6 +debug: Terminated block@0: // L6 +debug: Sealing block@None: // abi_routing_L6 +debug: Sealing block@None: // bare_routing_L6 +debug: Terminated block@1: // abi_routing_L6 +debug: Sealing block@None: // switch_case_default_L6 +debug: Sealing block@None: // test_method_selector_kinds_route_L7 +debug: Sealing block@None: // test_arg_conversion_route_L20 +debug: Sealing block@None: // test_15plus_args_route_L37 +debug: Sealing block@None: // test_void_route_L66 +debug: Sealing block@None: // test_ref_types_route_L80 +debug: Terminated block@2: // test_method_selector_kinds_route_L7 +debug: Terminated block@3: // test_arg_conversion_route_L20 +debug: Terminated block@4: // test_15plus_args_route_L37 +debug: Terminated block@5: // test_void_route_L66 +debug: Terminated block@6: // test_ref_types_route_L80 +debug: Terminated block@7: // switch_case_default_L6 +debug: Sealing block@8: // switch_case_next_L6 +debug: Terminated block@8: // switch_case_next_L6 +debug: Terminated block@9: // bare_routing_L6 +debug: Sealing block@None: // reject_bare_on_completion_L6 +debug: Sealing block@None: // create_L6 +debug: Terminated block@10: // create_L6 +debug: Terminated block@11: // reject_bare_on_completion_L6 +debug: Sealing block@None: // switch_case_next_L6 +debug: Sealing block@12: // after_if_else_L6 +debug: Terminated block@12: // after_if_else_L6 +debug: Sealing block@0: // L6 +debug: Terminated block@0: // L6 +debug: Output IR to typed_abi_call/out/Logger.ssa.ir +info: Optimizing test_cases.typed_abi_call.logger.Logger at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (== tmp%2#0 NoOp) to (! tmp%2#0) +debug: Simplified (== tmp%8#0 NoOp) to (! tmp%8#0) +debug: Simplified (== tmp%12#0 NoOp) to (! tmp%12#0) +debug: Simplified (== tmp%16#0 NoOp) to (! tmp%16#0) +debug: Simplified (== tmp%20#0 NoOp) to (! tmp%20#0) +debug: Simplified (== tmp%24#0 NoOp) to (! tmp%24#0) +debug: Simplified (== tmp%28#0 NoOp) to (! tmp%28#0) +debug: Simplified (== tmp%40#0 NoOp) to (! tmp%40#0) +debug: Simplified (extract3 tmp%57#0 0u 1u) to ((extract 0 1) tmp%57#0) +debug: Simplified (extract3 tmp%59#0 1u 1u) to ((extract 1 1) tmp%59#0) +debug: Simplified (extract3 tmp%61#0 2u 1u) to ((extract 2 1) tmp%61#0) +debug: Simplified (extract3 tmp%63#0 3u 1u) to ((extract 3 1) tmp%63#0) +debug: Simplified (extract3 tmp%65#0 4u 4u) to ((extract 4 4) tmp%65#0) +debug: Simplified (extract3 tmp%67#0 8u 1u) to ((extract 8 1) tmp%67#0) +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: adding block@1: // abi_routing_L6 as a predecessor of block@11: // switch_case_next_L6 due to inlining of block@10: // switch_case_default_L6 +debug: simplified terminator of block@1: // abi_routing_L6 from switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@10} to switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@11} +debug: simplified terminator of block@12: // bare_routing_L6 from switch tmp%71#0 {0u => block@13, * => block@14} to goto_nth [block@13][tmp%71#0] else goto block@14 +debug: adding block@1: // abi_routing_L6 as a predecessor of block@15: // after_if_else_L6 due to inlining of block@11: // switch_case_next_L6 +debug: simplified terminator of block@1: // abi_routing_L6 from switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@11} to switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@15} +debug: simplified terminator of block@12: // bare_routing_L6 from goto_nth [block@13][tmp%71#0] else goto block@14 to goto tmp%71#0 ? block@14 : block@13 +debug: simplified terminator of block@1: // abi_routing_L6 from switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => block@15} to switch tmp%1#0 {method "echo(string)string" => block@2, method "log_uint64(uint64)void" => block@3, method "log_uint512(uint512)void" => block@4, method "log_string(string)void" => block@5, method "log_bool(bool)void" => block@6, method "log_bytes(byte[])void" => block@7, method "log_asset_account_app(asset,account,application)void" => block@8, method "return_args_after_14th(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint8,uint8,uint8,uint8,(uint8,uint8,uint8,uint8),uint8)byte[]" => block@9, * => fail // reject transaction} +debug: inlining condition branch to err block into an assert false +debug: simplified terminator of block@12: // bare_routing_L6 from goto tmp%71#0 ? block@14 : block@13 to goto block@13 +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@11: // switch_case_next_L6 with block@10: // switch_case_default_L6 in block@15: // after_if_else_L6 +debug: Merged linear block@11: // switch_case_next_L6 into block@10: // switch_case_default_L6 +debug: Merged linear block@13: // create_L6 into block@12: // bare_routing_L6 +debug: Merged linear block@15: // after_if_else_L6 into block@10: // switch_case_default_L6 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Removing unreachable blocks: block@10: // switch_case_default_L6, block@14: // reject_bare_on_completion_L6 +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.echo +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified ((extract 2 0) "/x00/x06echo: ") to "echo: " +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_uint64 +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_uint512 +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_string +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_bool +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_bytes +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: value#0, awst_tmp%0#0 +debug: Replacing {awst_tmp%0#0} with value#0 made 4 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Replacing redundant declaration let tmp%2#0: uint64 = (len value#0) with copy of existing registers [Register(atype=uint64, name='tmp%1', version=0, source_location=typed_abi_call/logger.py:29:12-27)] +debug: Replacing redundant declaration let base_length%5#0: uint64 = (len value#0) with copy of existing registers [Register(atype=uint64, name='tmp%1', version=0, source_location=typed_abi_call/logger.py:29:12-27)] +debug: Found equivalence set: tmp%1#0, tmp%2#0, base_length%5#0 +debug: Replacing {tmp%2#0, base_length%5#0} with tmp%1#0 made 2 modifications +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat value%0#0 "") to value%0#0 +debug: Simplified (concat tmp%3#0 "") to tmp%3#0 +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: encoded_tuple_buffer%1#6, last_arg#0 +debug: Replacing {encoded_tuple_buffer%1#6} with last_arg#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x a15#0) to a15#0 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable current_tail_offset%0#0 +debug: Removing unused variable encoded_tuple_buffer%1#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Logger.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.echo +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable expr_value_trimmed%0#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_uint64 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_uint512 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_string +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_bool +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_bytes +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: value%0#0, tmp%2#0 +debug: Replacing {tmp%2#0} with value%0#0 made 1 modifications +debug: Found equivalence set: tmp%3#0, tmp%4#0 +debug: Replacing {tmp%4#0} with tmp%3#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: a15#0, encoded_tuple_buffer%1#1 +debug: Replacing {encoded_tuple_buffer%1#1} with a15#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Logger.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.echo +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_uint64 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_uint512 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_string +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_bool +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_bytes +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.log_asset_account_app +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.return_args_after_14th +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.logger.Logger.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: No optimizations performed in pass 3, ending loop +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.approval_program +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.echo +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.log_uint64 +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.log_uint512 +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.log_string +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.log_bool +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.log_bytes +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.log_asset_account_app +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.return_args_after_14th +debug: Removing Phis from test_cases.typed_abi_call.logger.Logger.clear_state_program +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.echo using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.log_uint64 using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.log_uint512 using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.log_string using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.log_bool using strategy RootOperandGrouping +debug: Coalescing ternary_result%1#0 with [ternary_result%1#5, ternary_result%1#1, ternary_result%1#2] +debug: Coalescing resulted in 7 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.log_bytes using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.log_asset_account_app using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.return_args_after_14th using strategy RootOperandGrouping +debug: Coalescing encoded_tuple_buffer%1#2 with [encoded_tuple_buffer%1#3, encoded_tuple_buffer%1#4, encoded_tuple_buffer%1#5] +debug: Coalescing resulted in 6 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.logger.Logger.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.approval_program +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.echo +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.log_uint64 +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.log_uint512 +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.log_string +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.log_bool +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.log_bytes +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.log_asset_account_app +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.return_args_after_14th +debug: Sequentializing parallel copies in test_cases.typed_abi_call.logger.Logger.clear_state_program +debug: Performing post-SSA optimizations +debug: Output IR to typed_abi_call/out/Logger.destructured.ir +debug: Inserted main_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@1.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_abi_routing@1.ops[11]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_echo_route@2.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_echo_route@2.ops[3]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_echo_route@2.ops[5]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_echo_route@2.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_echo_route@2.ops[10]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_echo_route@2.ops[12]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_echo_route@2.ops[15]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_echo_route@2.ops[17]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_echo_route@2.ops[23]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_echo_route@2.ops[25]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_echo_route@2.ops[19]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_echo_route@2.ops[22]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_log_uint64_route@3.ops[1]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_log_uint64_route@3.ops[3]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_log_uint64_route@3.ops[5]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_log_uint64_route@3.ops[7]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_log_uint64_route@3.ops[10]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_log_uint64_route@3.ops[12]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_log_uint64_route@3.ops[15]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_log_uint64_route@3.ops[17]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_log_uint512_route@4.ops[1]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_log_uint512_route@4.ops[3]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_log_uint512_route@4.ops[5]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_log_uint512_route@4.ops[7]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_log_uint512_route@4.ops[10]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_log_uint512_route@4.ops[12]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_log_uint512_route@4.ops[15]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_log_uint512_route@4.ops[17]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_log_string_route@5.ops[1]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_log_string_route@5.ops[3]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_log_string_route@5.ops[5]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_log_string_route@5.ops[7]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_log_string_route@5.ops[10]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_log_string_route@5.ops[12]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_log_string_route@5.ops[15]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_log_string_route@5.ops[17]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_log_bool_route@6.ops[1]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_log_bool_route@6.ops[3]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_log_bool_route@6.ops[5]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_log_bool_route@6.ops[7]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_log_bool_route@6.ops[10]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_log_bool_route@6.ops[12]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_log_bool_route@6.ops[15]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_log_bool_route@6.ops[17]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_log_bytes_route@7.ops[1]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_log_bytes_route@7.ops[3]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_log_bytes_route@7.ops[5]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_log_bytes_route@7.ops[7]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_log_bytes_route@7.ops[10]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_log_bytes_route@7.ops[12]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted main_log_bytes_route@7.ops[15]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced main_log_bytes_route@7.ops[17]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[1]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[3]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[5]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[7]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[10]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[12]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[15]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[17]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[19]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[21]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[25]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[27]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[29]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[31]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[35]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[37]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[39]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[41]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[43]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[47]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[33]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[47]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted main_log_asset_account_app_route@8.ops[23]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_log_asset_account_app_route@8.ops[47]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[1]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[3]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[5]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[7]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[10]: 'store tmp%42#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[12]: 'load tmp%42#0' with 'load tmp%42#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[43]: 'store tmp%57#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[45]: 'load tmp%57#0' with 'load tmp%57#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[49]: 'store tmp%59#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[51]: 'load tmp%59#0' with 'load tmp%59#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[55]: 'store tmp%61#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[57]: 'load tmp%61#0' with 'load tmp%61#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[61]: 'store tmp%63#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[63]: 'load tmp%63#0' with 'load tmp%63#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[67]: 'store tmp%65#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[69]: 'load tmp%65#0' with 'load tmp%65#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[73]: 'store tmp%67#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[75]: 'load tmp%67#0' with 'load tmp%67#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[103]: 'store tmp%70#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[105]: 'load tmp%70#0' with 'load tmp%70#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[99]: 'store tmp%69#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[102]: 'load tmp%69#0' with 'load tmp%69#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[77]: 'store tmp%68#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%68#0' with 'load tmp%68#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[71]: 'store tmp%66#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%66#0' with 'load tmp%66#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[65]: 'store tmp%64#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%64#0' with 'load tmp%64#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[59]: 'store tmp%62#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%62#0' with 'load tmp%62#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[53]: 'store tmp%60#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%60#0' with 'load tmp%60#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[47]: 'store tmp%58#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%58#0' with 'load tmp%58#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[41]: 'store tmp%56#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%56#0' with 'load tmp%56#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[39]: 'store tmp%55#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%55#0' with 'load tmp%55#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[37]: 'store tmp%54#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%54#0' with 'load tmp%54#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[35]: 'store tmp%53#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%53#0' with 'load tmp%53#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[33]: 'store tmp%52#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[31]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[29]: 'store tmp%50#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%50#0' with 'load tmp%50#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[27]: 'store tmp%49#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[25]: 'store tmp%48#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%48#0' with 'load tmp%48#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[23]: 'store tmp%47#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%47#0' with 'load tmp%47#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[21]: 'store tmp%46#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%46#0' with 'load tmp%46#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[19]: 'store tmp%45#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%45#0' with 'load tmp%45#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[17]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' +debug: Inserted main_return_args_after_14th_route@9.ops[15]: 'store tmp%43#0 to l-stack (copy)' +debug: Replaced main_return_args_after_14th_route@9.ops[98]: 'load tmp%43#0' with 'load tmp%43#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@12.ops[1]: 'store tmp%71#0 to l-stack (copy)' +debug: Replaced main_bare_routing@12.ops[3]: 'load tmp%71#0' with 'load tmp%71#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@12.ops[5]: 'store not%tmp%71#0 to l-stack (copy)' +debug: Replaced main_bare_routing@12.ops[7]: 'load not%tmp%71#0' with 'load not%tmp%71#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@12.ops[10]: 'store tmp%72#0 to l-stack (copy)' +debug: Replaced main_bare_routing@12.ops[12]: 'load tmp%72#0' with 'load tmp%72#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@12.ops[14]: 'store tmp%73#0 to l-stack (copy)' +debug: Replaced main_bare_routing@12.ops[16]: 'load tmp%73#0' with 'load tmp%73#0 from l-stack (no copy)' +debug: Found 2 edge set/s for test_cases.typed_abi_call.logger.Logger.approval_program +debug: Inserted echo_block@0.ops[6]: 'store concatenated%2#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[8]: 'load concatenated%2#0' with 'load concatenated%2#0 from l-stack (no copy)' +debug: Inserted echo_block@0.ops[10]: 'store len_%3#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[12]: 'load len_%3#0' with 'load len_%3#0 from l-stack (no copy)' +debug: Inserted echo_block@0.ops[14]: 'store len_bytes%4#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[16]: 'load len_bytes%4#0' with 'load len_bytes%4#0 from l-stack (no copy)' +debug: Inserted echo_block@0.ops[18]: 'store len_16_bit%5#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[20]: 'load len_16_bit%5#0' with 'load len_16_bit%5#0 from l-stack (no copy)' +debug: Inserted echo_block@0.ops[23]: 'store concat_result%6#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[25]: 'load concat_result%6#0' with 'load concat_result%6#0 from l-stack (no copy)' +debug: Inserted echo_block@0.ops[2]: 'store expr_value_trimmed%1#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[5]: 'load expr_value_trimmed%1#0' with 'load expr_value_trimmed%1#0 from l-stack (no copy)' +debug: Inserted echo_block@0.ops[10]: 'store concatenated%2#0 to l-stack (copy)' +debug: Replaced echo_block@0.ops[23]: 'load concatenated%2#0' with 'load concatenated%2#0 from l-stack (no copy)' +debug: Inserted log_string_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced log_string_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted log_bool_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced log_bool_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Found 2 edge set/s for test_cases.typed_abi_call.logger.Logger.log_bool +debug: Allocated 1 variable/s to x-stack: ternary_result%1#0 +debug: shared x-stack for log_bool_ternary_true@1 -> log_bool_ternary_merge@3: ternary_result%1#0 +debug: shared x-stack for log_bool_ternary_false@2 -> log_bool_ternary_merge@3: ternary_result%1#0 +debug: Inserted log_bytes_block@0.ops[16]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced log_bytes_block@0.ops[18]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted log_bytes_block@0.ops[2]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced log_bytes_block@0.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted log_bytes_block@0.ops[12]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced log_bytes_block@0.ops[15]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted log_bytes_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced log_bytes_block@0.ops[9]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted log_bytes_block@0.ops[8]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced log_bytes_block@0.ops[12]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted log_bytes_block@0.ops[11]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced log_bytes_block@0.ops[19]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted log_asset_account_app_block@0.ops[19]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced log_asset_account_app_block@0.ops[21]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted log_asset_account_app_block@0.ops[2]: 'store check%1#0 to l-stack (copy)' +debug: Replaced log_asset_account_app_block@0.ops[5]: 'load check%1#0' with 'load check%1#0 from l-stack (no copy)' +debug: Inserted log_asset_account_app_block@0.ops[13]: 'store check%6#0 to l-stack (copy)' +debug: Replaced log_asset_account_app_block@0.ops[16]: 'load check%6#0' with 'load check%6#0 from l-stack (no copy)' +debug: Inserted log_asset_account_app_block@0.ops[4]: 'store value%0#0 to l-stack (copy)' +debug: Replaced log_asset_account_app_block@0.ops[8]: 'load value%0#0' with 'load value%0#0 from l-stack (no copy)' +debug: Inserted log_asset_account_app_block@0.ops[16]: 'store value%5#0 to l-stack (copy)' +debug: Replaced log_asset_account_app_block@0.ops[21]: 'load value%5#0' with 'load value%5#0 from l-stack (no copy)' +debug: Inserted log_asset_account_app_block@0.ops[11]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced log_asset_account_app_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[3]: 'store encoded_tuple_buffer%1#2 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[5]: 'load encoded_tuple_buffer%1#2' with 'load encoded_tuple_buffer%1#2 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[8]: 'store encoded_tuple_buffer%1#2 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[10]: 'load encoded_tuple_buffer%1#2' with 'load encoded_tuple_buffer%1#2 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[13]: 'store encoded_tuple_buffer%1#2 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[15]: 'load encoded_tuple_buffer%1#2' with 'load encoded_tuple_buffer%1#2 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[18]: 'store encoded_tuple_buffer%1#2 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[20]: 'load encoded_tuple_buffer%1#2' with 'load encoded_tuple_buffer%1#2 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[25]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[27]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[30]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[32]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[36]: 'store length%4#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[38]: 'load length%4#0' with 'load length%4#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[40]: 'store value_as_bytes%5#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[42]: 'load value_as_bytes%5#0' with 'load value_as_bytes%5#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[44]: 'store value_as_uint16%6#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[46]: 'load value_as_uint16%6#0' with 'load value_as_uint16%6#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[49]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[51]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[23]: 'store last_arg#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[29]: 'load last_arg#0' with 'load last_arg#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[30]: 'store last_arg#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[36]: 'load last_arg#0' with 'load last_arg#0 from l-stack (no copy)' +debug: Inserted return_args_after_14th_block@0.ops[37]: 'store last_arg#0 to l-stack (copy)' +debug: Replaced return_args_after_14th_block@0.ops[50]: 'load last_arg#0' with 'load last_arg#0 from l-stack (no copy)' +debug: Output IR to typed_abi_call/out/Greeter.ssa.ir +info: Optimizing test_cases.typed_abi_call.typed_c2c.Greeter at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (== tmp%2#0 NoOp) to (! tmp%2#0) +debug: Simplified (== tmp%8#0 NoOp) to (! tmp%8#0) +debug: Simplified (== tmp%14#0 NoOp) to (! tmp%14#0) +debug: Simplified (== tmp%20#0 NoOp) to (! tmp%20#0) +debug: Simplified (== tmp%26#0 NoOp) to (! tmp%26#0) +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: adding block@1: // abi_routing_L6 as a predecessor of block@8: // switch_case_next_L6 due to inlining of block@7: // switch_case_default_L6 +debug: simplified terminator of block@1: // abi_routing_L6 from switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@7} to switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@8} +debug: simplified terminator of block@9: // bare_routing_L6 from switch tmp%35#0 {0u => block@10, * => block@11} to goto_nth [block@10][tmp%35#0] else goto block@11 +debug: adding block@1: // abi_routing_L6 as a predecessor of block@12: // after_if_else_L6 due to inlining of block@8: // switch_case_next_L6 +debug: simplified terminator of block@1: // abi_routing_L6 from switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@8} to switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@12} +debug: simplified terminator of block@9: // bare_routing_L6 from goto_nth [block@10][tmp%35#0] else goto block@11 to goto tmp%35#0 ? block@11 : block@10 +debug: simplified terminator of block@1: // abi_routing_L6 from switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => block@12} to switch tmp%1#0 {method "test_method_selector_kinds(application)void" => block@2, method "test_arg_conversion(application)void" => block@3, method "test_15plus_args(application)void" => block@4, method "test_void(application)void" => block@5, method "test_ref_types(application,asset)void" => block@6, * => fail // reject transaction} +debug: inlining condition branch to err block into an assert false +debug: simplified terminator of block@9: // bare_routing_L6 from goto tmp%35#0 ? block@11 : block@10 to goto block@10 +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@8: // switch_case_next_L6 with block@7: // switch_case_default_L6 in block@12: // after_if_else_L6 +debug: Merged linear block@8: // switch_case_next_L6 into block@7: // switch_case_default_L6 +debug: Merged linear block@10: // create_L6 into block@9: // bare_routing_L6 +debug: Merged linear block@12: // after_if_else_L6 into block@7: // switch_case_default_L6 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Removing unreachable blocks: block@7: // switch_case_default_L6, block@11: // reject_bare_on_completion_L6 +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: app#0, inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%8%%param_ApplicationID_idx_0#0, inner_txn_params%16%%param_ApplicationID_idx_0#0, inner_txn_params%24%%param_ApplicationID_idx_0#0, inner_txn_params%32%%param_ApplicationID_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%8%%param_ApplicationID_idx_0#0, inner_txn_params%16%%param_ApplicationID_idx_0#0, inner_txn_params%24%%param_ApplicationID_idx_0#0, inner_txn_params%32%%param_ApplicationID_idx_0#0} with app#0 made 5 modifications +debug: Found equivalence set: tmp_itxn_0%%LastLog#0, awst_tmp%1#0 +debug: Replacing {awst_tmp%1#0} with tmp_itxn_0%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%2#0, value%5#0, result#0 +debug: Replacing {tmp%2#0, value%5#0} with result#0 made 1 modifications +debug: Found equivalence set: tmp%4#0, check%6#0 +debug: Replacing {check%6#0} with tmp%4#0 made 1 modifications +debug: Found equivalence set: tmp_itxn_1%%LastLog#0, awst_tmp%9#0 +debug: Replacing {awst_tmp%9#0} with tmp_itxn_1%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%10#0, value%13#0, result#1 +debug: Replacing {tmp%10#0, value%13#0} with result#1 made 1 modifications +debug: Found equivalence set: tmp%12#0, check%14#0 +debug: Replacing {check%14#0} with tmp%12#0 made 1 modifications +debug: Found equivalence set: tmp_itxn_2%%LastLog#0, awst_tmp%17#0 +debug: Replacing {awst_tmp%17#0} with tmp_itxn_2%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%18#0, value%21#0, result#2 +debug: Replacing {tmp%18#0, value%21#0} with result#2 made 1 modifications +debug: Found equivalence set: tmp%20#0, check%22#0 +debug: Replacing {check%22#0} with tmp%20#0 made 1 modifications +debug: Found equivalence set: tmp_itxn_3%%LastLog#0, awst_tmp%25#0 +debug: Replacing {awst_tmp%25#0} with tmp_itxn_3%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%26#0, value%29#0, result#3 +debug: Replacing {tmp%26#0, value%29#0} with result#3 made 1 modifications +debug: Found equivalence set: tmp%28#0, check%30#0 +debug: Replacing {check%30#0} with tmp%28#0 made 1 modifications +debug: Found equivalence set: tmp_itxn_4%%LastLog#0, awst_tmp%33#0 +debug: Replacing {awst_tmp%33#0} with tmp_itxn_4%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%34#0, value%37#0, result#4 +debug: Replacing {tmp%34#0, value%37#0} with result#4 made 1 modifications +debug: Found equivalence set: tmp%36#0, check%38#0 +debug: Replacing {check%38#0} with tmp%36#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable inner_txn_params%0%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%0%%Amount_length#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%Applications_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%0%%Assets_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%Fee_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%0%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%0%%Note_length#0 +debug: Removing unused variable inner_txn_params%0%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%0%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%0%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%0%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%0%%Sender_length#0 +debug: Removing unused variable inner_txn_params%0%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%0%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%0%%Type_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%0%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%0%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#0 +debug: Removing unused variable tmp_itxn_0%%Amount#0 +debug: Removing unused variable tmp_itxn_0%%ApplicationID#0 +debug: Removing unused variable tmp_itxn_0%%ApprovalProgram#0 +debug: Removing unused variable tmp_itxn_0%%AssetAmount#0 +debug: Removing unused variable tmp_itxn_0%%AssetCloseTo#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetName#0 +debug: Removing unused variable tmp_itxn_0%%AssetReceiver#0 +debug: Removing unused variable tmp_itxn_0%%AssetSender#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetClawback#0 +debug: Removing unused variable tmp_itxn_0%%ClearStateProgram#0 +debug: Removing unused variable tmp_itxn_0%%CloseRemainderTo#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAsset#0 +debug: Removing unused variable tmp_itxn_0%%CreatedApplicationID#0 +debug: Removing unused variable tmp_itxn_0%%CreatedAssetID#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetDecimals#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable tmp_itxn_0%%ExtraProgramPages#0 +debug: Removing unused variable tmp_itxn_0%%Fee#0 +debug: Removing unused variable tmp_itxn_0%%FirstValid#0 +debug: Removing unused variable tmp_itxn_0%%FirstValidTime#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetFreeze#0 +debug: Removing unused variable tmp_itxn_0%%FreezeAssetAccount#0 +debug: Removing unused variable tmp_itxn_0%%FreezeAsset#0 +debug: Removing unused variable tmp_itxn_0%%FreezeAssetFrozen#0 +debug: Removing unused variable tmp_itxn_0%%GlobalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_0%%GlobalNumUint#0 +debug: Removing unused variable tmp_itxn_0%%GroupIndex#0 +debug: Removing unused variable tmp_itxn_0%%LastValid#0 +debug: Removing unused variable tmp_itxn_0%%Lease#0 +debug: Removing unused variable tmp_itxn_0%%LocalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_0%%LocalNumUint#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetManager#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetMetadataHash#0 +debug: Removing unused variable tmp_itxn_0%%Nonparticipation#0 +debug: Removing unused variable tmp_itxn_0%%Note#0 +debug: Removing unused variable tmp_itxn_0%%NumAccounts#0 +debug: Removing unused variable tmp_itxn_0%%NumAppArgs#0 +debug: Removing unused variable tmp_itxn_0%%NumApprovalProgramPages#0 +debug: Removing unused variable tmp_itxn_0%%NumApplications#0 +debug: Removing unused variable tmp_itxn_0%%NumAssets#0 +debug: Removing unused variable tmp_itxn_0%%NumClearStateProgramPages#0 +debug: Removing unused variable tmp_itxn_0%%NumLogs#0 +debug: Removing unused variable tmp_itxn_0%%OnCompletion#0 +debug: Removing unused variable tmp_itxn_0%%Receiver#0 +debug: Removing unused variable tmp_itxn_0%%RekeyTo#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetReserve#0 +debug: Removing unused variable tmp_itxn_0%%SelectionPK#0 +debug: Removing unused variable tmp_itxn_0%%Sender#0 +debug: Removing unused variable tmp_itxn_0%%StateProofPK#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetTotal#0 +debug: Removing unused variable tmp_itxn_0%%TxID#0 +debug: Removing unused variable tmp_itxn_0%%TypeEnum#0 +debug: Removing unused variable tmp_itxn_0%%Type#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetUnitName#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetURL#0 +debug: Removing unused variable tmp_itxn_0%%VoteFirst#0 +debug: Removing unused variable tmp_itxn_0%%VotePK#0 +debug: Removing unused variable tmp_itxn_0%%VoteKeyDilution#0 +debug: Removing unused variable tmp_itxn_0%%VoteLast#0 +debug: Removing unused variable tmp_itxn_0%%XferAsset#0 +debug: Removing unused variable inner_txn_params%8%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%8%%Amount_length#0 +debug: Removing unused variable inner_txn_params%8%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%8%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%8%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%8%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%8%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%8%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%8%%Applications_length#0 +debug: Removing unused variable inner_txn_params%8%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%8%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%8%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%8%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%8%%Assets_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%8%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%8%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%8%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%8%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%8%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%8%%Fee_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%8%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%8%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%8%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%8%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%8%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%8%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%8%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%8%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%8%%Note_length#0 +debug: Removing unused variable inner_txn_params%8%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%8%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%8%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%8%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%8%%Sender_length#0 +debug: Removing unused variable inner_txn_params%8%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%8%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%8%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%8%%Type_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%8%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%8%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%8%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%8%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%8%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%8%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#1 +debug: Removing unused variable tmp_itxn_1%%Amount#0 +debug: Removing unused variable tmp_itxn_1%%ApplicationID#0 +debug: Removing unused variable tmp_itxn_1%%ApprovalProgram#0 +debug: Removing unused variable tmp_itxn_1%%AssetAmount#0 +debug: Removing unused variable tmp_itxn_1%%AssetCloseTo#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetName#0 +debug: Removing unused variable tmp_itxn_1%%AssetReceiver#0 +debug: Removing unused variable tmp_itxn_1%%AssetSender#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetClawback#0 +debug: Removing unused variable tmp_itxn_1%%ClearStateProgram#0 +debug: Removing unused variable tmp_itxn_1%%CloseRemainderTo#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAsset#0 +debug: Removing unused variable tmp_itxn_1%%CreatedApplicationID#0 +debug: Removing unused variable tmp_itxn_1%%CreatedAssetID#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetDecimals#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable tmp_itxn_1%%ExtraProgramPages#0 +debug: Removing unused variable tmp_itxn_1%%Fee#0 +debug: Removing unused variable tmp_itxn_1%%FirstValid#0 +debug: Removing unused variable tmp_itxn_1%%FirstValidTime#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetFreeze#0 +debug: Removing unused variable tmp_itxn_1%%FreezeAssetAccount#0 +debug: Removing unused variable tmp_itxn_1%%FreezeAsset#0 +debug: Removing unused variable tmp_itxn_1%%FreezeAssetFrozen#0 +debug: Removing unused variable tmp_itxn_1%%GlobalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_1%%GlobalNumUint#0 +debug: Removing unused variable tmp_itxn_1%%GroupIndex#0 +debug: Removing unused variable tmp_itxn_1%%LastValid#0 +debug: Removing unused variable tmp_itxn_1%%Lease#0 +debug: Removing unused variable tmp_itxn_1%%LocalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_1%%LocalNumUint#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetManager#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetMetadataHash#0 +debug: Removing unused variable tmp_itxn_1%%Nonparticipation#0 +debug: Removing unused variable tmp_itxn_1%%Note#0 +debug: Removing unused variable tmp_itxn_1%%NumAccounts#0 +debug: Removing unused variable tmp_itxn_1%%NumAppArgs#0 +debug: Removing unused variable tmp_itxn_1%%NumApprovalProgramPages#0 +debug: Removing unused variable tmp_itxn_1%%NumApplications#0 +debug: Removing unused variable tmp_itxn_1%%NumAssets#0 +debug: Removing unused variable tmp_itxn_1%%NumClearStateProgramPages#0 +debug: Removing unused variable tmp_itxn_1%%NumLogs#0 +debug: Removing unused variable tmp_itxn_1%%OnCompletion#0 +debug: Removing unused variable tmp_itxn_1%%Receiver#0 +debug: Removing unused variable tmp_itxn_1%%RekeyTo#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetReserve#0 +debug: Removing unused variable tmp_itxn_1%%SelectionPK#0 +debug: Removing unused variable tmp_itxn_1%%Sender#0 +debug: Removing unused variable tmp_itxn_1%%StateProofPK#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetTotal#0 +debug: Removing unused variable tmp_itxn_1%%TxID#0 +debug: Removing unused variable tmp_itxn_1%%TypeEnum#0 +debug: Removing unused variable tmp_itxn_1%%Type#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetUnitName#0 +debug: Removing unused variable tmp_itxn_1%%ConfigAssetURL#0 +debug: Removing unused variable tmp_itxn_1%%VoteFirst#0 +debug: Removing unused variable tmp_itxn_1%%VotePK#0 +debug: Removing unused variable tmp_itxn_1%%VoteKeyDilution#0 +debug: Removing unused variable tmp_itxn_1%%VoteLast#0 +debug: Removing unused variable tmp_itxn_1%%XferAsset#0 +debug: Removing unused variable inner_txn_params%16%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%16%%Amount_length#0 +debug: Removing unused variable inner_txn_params%16%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%16%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%16%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%16%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%16%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%16%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%16%%Applications_length#0 +debug: Removing unused variable inner_txn_params%16%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%16%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%16%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%16%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%16%%Assets_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%16%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%16%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%16%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%16%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%16%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%16%%Fee_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%16%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%16%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%16%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%16%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%16%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%16%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%16%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%16%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%16%%Note_length#0 +debug: Removing unused variable inner_txn_params%16%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%16%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%16%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%16%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%16%%Sender_length#0 +debug: Removing unused variable inner_txn_params%16%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%16%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%16%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%16%%Type_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%16%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%16%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%16%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%16%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%16%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%16%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#2 +debug: Removing unused variable tmp_itxn_2%%Amount#0 +debug: Removing unused variable tmp_itxn_2%%ApplicationID#0 +debug: Removing unused variable tmp_itxn_2%%ApprovalProgram#0 +debug: Removing unused variable tmp_itxn_2%%AssetAmount#0 +debug: Removing unused variable tmp_itxn_2%%AssetCloseTo#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetName#0 +debug: Removing unused variable tmp_itxn_2%%AssetReceiver#0 +debug: Removing unused variable tmp_itxn_2%%AssetSender#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetClawback#0 +debug: Removing unused variable tmp_itxn_2%%ClearStateProgram#0 +debug: Removing unused variable tmp_itxn_2%%CloseRemainderTo#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAsset#0 +debug: Removing unused variable tmp_itxn_2%%CreatedApplicationID#0 +debug: Removing unused variable tmp_itxn_2%%CreatedAssetID#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetDecimals#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable tmp_itxn_2%%ExtraProgramPages#0 +debug: Removing unused variable tmp_itxn_2%%Fee#0 +debug: Removing unused variable tmp_itxn_2%%FirstValid#0 +debug: Removing unused variable tmp_itxn_2%%FirstValidTime#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetFreeze#0 +debug: Removing unused variable tmp_itxn_2%%FreezeAssetAccount#0 +debug: Removing unused variable tmp_itxn_2%%FreezeAsset#0 +debug: Removing unused variable tmp_itxn_2%%FreezeAssetFrozen#0 +debug: Removing unused variable tmp_itxn_2%%GlobalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_2%%GlobalNumUint#0 +debug: Removing unused variable tmp_itxn_2%%GroupIndex#0 +debug: Removing unused variable tmp_itxn_2%%LastValid#0 +debug: Removing unused variable tmp_itxn_2%%Lease#0 +debug: Removing unused variable tmp_itxn_2%%LocalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_2%%LocalNumUint#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetManager#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetMetadataHash#0 +debug: Removing unused variable tmp_itxn_2%%Nonparticipation#0 +debug: Removing unused variable tmp_itxn_2%%Note#0 +debug: Removing unused variable tmp_itxn_2%%NumAccounts#0 +debug: Removing unused variable tmp_itxn_2%%NumAppArgs#0 +debug: Removing unused variable tmp_itxn_2%%NumApprovalProgramPages#0 +debug: Removing unused variable tmp_itxn_2%%NumApplications#0 +debug: Removing unused variable tmp_itxn_2%%NumAssets#0 +debug: Removing unused variable tmp_itxn_2%%NumClearStateProgramPages#0 +debug: Removing unused variable tmp_itxn_2%%NumLogs#0 +debug: Removing unused variable tmp_itxn_2%%OnCompletion#0 +debug: Removing unused variable tmp_itxn_2%%Receiver#0 +debug: Removing unused variable tmp_itxn_2%%RekeyTo#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetReserve#0 +debug: Removing unused variable tmp_itxn_2%%SelectionPK#0 +debug: Removing unused variable tmp_itxn_2%%Sender#0 +debug: Removing unused variable tmp_itxn_2%%StateProofPK#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetTotal#0 +debug: Removing unused variable tmp_itxn_2%%TxID#0 +debug: Removing unused variable tmp_itxn_2%%TypeEnum#0 +debug: Removing unused variable tmp_itxn_2%%Type#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetUnitName#0 +debug: Removing unused variable tmp_itxn_2%%ConfigAssetURL#0 +debug: Removing unused variable tmp_itxn_2%%VoteFirst#0 +debug: Removing unused variable tmp_itxn_2%%VotePK#0 +debug: Removing unused variable tmp_itxn_2%%VoteKeyDilution#0 +debug: Removing unused variable tmp_itxn_2%%VoteLast#0 +debug: Removing unused variable tmp_itxn_2%%XferAsset#0 +debug: Removing unused variable inner_txn_params%24%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%24%%Amount_length#0 +debug: Removing unused variable inner_txn_params%24%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%24%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%24%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%24%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%24%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%24%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%24%%Applications_length#0 +debug: Removing unused variable inner_txn_params%24%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%24%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%24%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%24%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%24%%Assets_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%24%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%24%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%24%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%24%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%24%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%24%%Fee_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%24%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%24%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%24%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%24%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%24%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%24%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%24%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%24%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%24%%Note_length#0 +debug: Removing unused variable inner_txn_params%24%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%24%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%24%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%24%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%24%%Sender_length#0 +debug: Removing unused variable inner_txn_params%24%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%24%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%24%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%24%%Type_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%24%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%24%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%24%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%24%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%24%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%24%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#3 +debug: Removing unused variable tmp_itxn_3%%Amount#0 +debug: Removing unused variable tmp_itxn_3%%ApplicationID#0 +debug: Removing unused variable tmp_itxn_3%%ApprovalProgram#0 +debug: Removing unused variable tmp_itxn_3%%AssetAmount#0 +debug: Removing unused variable tmp_itxn_3%%AssetCloseTo#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetName#0 +debug: Removing unused variable tmp_itxn_3%%AssetReceiver#0 +debug: Removing unused variable tmp_itxn_3%%AssetSender#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetClawback#0 +debug: Removing unused variable tmp_itxn_3%%ClearStateProgram#0 +debug: Removing unused variable tmp_itxn_3%%CloseRemainderTo#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAsset#0 +debug: Removing unused variable tmp_itxn_3%%CreatedApplicationID#0 +debug: Removing unused variable tmp_itxn_3%%CreatedAssetID#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetDecimals#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable tmp_itxn_3%%ExtraProgramPages#0 +debug: Removing unused variable tmp_itxn_3%%Fee#0 +debug: Removing unused variable tmp_itxn_3%%FirstValid#0 +debug: Removing unused variable tmp_itxn_3%%FirstValidTime#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetFreeze#0 +debug: Removing unused variable tmp_itxn_3%%FreezeAssetAccount#0 +debug: Removing unused variable tmp_itxn_3%%FreezeAsset#0 +debug: Removing unused variable tmp_itxn_3%%FreezeAssetFrozen#0 +debug: Removing unused variable tmp_itxn_3%%GlobalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_3%%GlobalNumUint#0 +debug: Removing unused variable tmp_itxn_3%%GroupIndex#0 +debug: Removing unused variable tmp_itxn_3%%LastValid#0 +debug: Removing unused variable tmp_itxn_3%%Lease#0 +debug: Removing unused variable tmp_itxn_3%%LocalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_3%%LocalNumUint#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetManager#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetMetadataHash#0 +debug: Removing unused variable tmp_itxn_3%%Nonparticipation#0 +debug: Removing unused variable tmp_itxn_3%%Note#0 +debug: Removing unused variable tmp_itxn_3%%NumAccounts#0 +debug: Removing unused variable tmp_itxn_3%%NumAppArgs#0 +debug: Removing unused variable tmp_itxn_3%%NumApprovalProgramPages#0 +debug: Removing unused variable tmp_itxn_3%%NumApplications#0 +debug: Removing unused variable tmp_itxn_3%%NumAssets#0 +debug: Removing unused variable tmp_itxn_3%%NumClearStateProgramPages#0 +debug: Removing unused variable tmp_itxn_3%%NumLogs#0 +debug: Removing unused variable tmp_itxn_3%%OnCompletion#0 +debug: Removing unused variable tmp_itxn_3%%Receiver#0 +debug: Removing unused variable tmp_itxn_3%%RekeyTo#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetReserve#0 +debug: Removing unused variable tmp_itxn_3%%SelectionPK#0 +debug: Removing unused variable tmp_itxn_3%%Sender#0 +debug: Removing unused variable tmp_itxn_3%%StateProofPK#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetTotal#0 +debug: Removing unused variable tmp_itxn_3%%TxID#0 +debug: Removing unused variable tmp_itxn_3%%TypeEnum#0 +debug: Removing unused variable tmp_itxn_3%%Type#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetUnitName#0 +debug: Removing unused variable tmp_itxn_3%%ConfigAssetURL#0 +debug: Removing unused variable tmp_itxn_3%%VoteFirst#0 +debug: Removing unused variable tmp_itxn_3%%VotePK#0 +debug: Removing unused variable tmp_itxn_3%%VoteKeyDilution#0 +debug: Removing unused variable tmp_itxn_3%%VoteLast#0 +debug: Removing unused variable tmp_itxn_3%%XferAsset#0 +debug: Removing unused variable inner_txn_params%32%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%32%%Amount_length#0 +debug: Removing unused variable inner_txn_params%32%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%32%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%32%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%32%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%32%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%32%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%32%%Applications_length#0 +debug: Removing unused variable inner_txn_params%32%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%32%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%32%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%32%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%32%%Assets_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%32%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%32%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%32%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%32%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%32%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%32%%Fee_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%32%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%32%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%32%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%32%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%32%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%32%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%32%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%32%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%32%%Note_length#0 +debug: Removing unused variable inner_txn_params%32%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%32%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%32%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%32%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%32%%Sender_length#0 +debug: Removing unused variable inner_txn_params%32%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%32%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%32%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%32%%Type_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%32%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%32%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%32%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%32%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%32%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%32%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#4 +debug: Removing unused variable tmp_itxn_4%%Amount#0 +debug: Removing unused variable tmp_itxn_4%%ApplicationID#0 +debug: Removing unused variable tmp_itxn_4%%ApprovalProgram#0 +debug: Removing unused variable tmp_itxn_4%%AssetAmount#0 +debug: Removing unused variable tmp_itxn_4%%AssetCloseTo#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetName#0 +debug: Removing unused variable tmp_itxn_4%%AssetReceiver#0 +debug: Removing unused variable tmp_itxn_4%%AssetSender#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetClawback#0 +debug: Removing unused variable tmp_itxn_4%%ClearStateProgram#0 +debug: Removing unused variable tmp_itxn_4%%CloseRemainderTo#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAsset#0 +debug: Removing unused variable tmp_itxn_4%%CreatedApplicationID#0 +debug: Removing unused variable tmp_itxn_4%%CreatedAssetID#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetDecimals#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable tmp_itxn_4%%ExtraProgramPages#0 +debug: Removing unused variable tmp_itxn_4%%Fee#0 +debug: Removing unused variable tmp_itxn_4%%FirstValid#0 +debug: Removing unused variable tmp_itxn_4%%FirstValidTime#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetFreeze#0 +debug: Removing unused variable tmp_itxn_4%%FreezeAssetAccount#0 +debug: Removing unused variable tmp_itxn_4%%FreezeAsset#0 +debug: Removing unused variable tmp_itxn_4%%FreezeAssetFrozen#0 +debug: Removing unused variable tmp_itxn_4%%GlobalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_4%%GlobalNumUint#0 +debug: Removing unused variable tmp_itxn_4%%GroupIndex#0 +debug: Removing unused variable tmp_itxn_4%%LastValid#0 +debug: Removing unused variable tmp_itxn_4%%Lease#0 +debug: Removing unused variable tmp_itxn_4%%LocalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_4%%LocalNumUint#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetManager#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetMetadataHash#0 +debug: Removing unused variable tmp_itxn_4%%Nonparticipation#0 +debug: Removing unused variable tmp_itxn_4%%Note#0 +debug: Removing unused variable tmp_itxn_4%%NumAccounts#0 +debug: Removing unused variable tmp_itxn_4%%NumAppArgs#0 +debug: Removing unused variable tmp_itxn_4%%NumApprovalProgramPages#0 +debug: Removing unused variable tmp_itxn_4%%NumApplications#0 +debug: Removing unused variable tmp_itxn_4%%NumAssets#0 +debug: Removing unused variable tmp_itxn_4%%NumClearStateProgramPages#0 +debug: Removing unused variable tmp_itxn_4%%NumLogs#0 +debug: Removing unused variable tmp_itxn_4%%OnCompletion#0 +debug: Removing unused variable tmp_itxn_4%%Receiver#0 +debug: Removing unused variable tmp_itxn_4%%RekeyTo#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetReserve#0 +debug: Removing unused variable tmp_itxn_4%%SelectionPK#0 +debug: Removing unused variable tmp_itxn_4%%Sender#0 +debug: Removing unused variable tmp_itxn_4%%StateProofPK#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetTotal#0 +debug: Removing unused variable tmp_itxn_4%%TxID#0 +debug: Removing unused variable tmp_itxn_4%%TypeEnum#0 +debug: Removing unused variable tmp_itxn_4%%Type#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetUnitName#0 +debug: Removing unused variable tmp_itxn_4%%ConfigAssetURL#0 +debug: Removing unused variable tmp_itxn_4%%VoteFirst#0 +debug: Removing unused variable tmp_itxn_4%%VotePK#0 +debug: Removing unused variable tmp_itxn_4%%VoteKeyDilution#0 +debug: Removing unused variable tmp_itxn_4%%VoteLast#0 +debug: Removing unused variable tmp_itxn_4%%XferAsset#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@1: // next_txn_L9 with block@0: // L7 in block@2: // next_txn_L11 +debug: Merged linear block@1: // next_txn_L9 into block@0: // L7 +debug: Replaced predecessor block@2: // next_txn_L11 with block@0: // L7 in block@3: // next_txn_L13 +debug: Merged linear block@2: // next_txn_L11 into block@0: // L7 +debug: Replaced predecessor block@3: // next_txn_L13 with block@0: // L7 in block@4: // next_txn_L15 +debug: Merged linear block@3: // next_txn_L13 into block@0: // L7 +debug: Replaced predecessor block@4: // next_txn_L15 with block@0: // L7 in block@5: // next_txn_L17 +debug: Merged linear block@4: // next_txn_L15 into block@0: // L7 +debug: Merged linear block@5: // next_txn_L17 into block@0: // L7 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: app#0, inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%2%%param_ApplicationID_idx_0#0, inner_txn_params%5%%param_ApplicationID_idx_0#0, inner_txn_params%10%%param_ApplicationID_idx_0#0, inner_txn_params%12%%param_ApplicationID_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%2%%param_ApplicationID_idx_0#0, inner_txn_params%5%%param_ApplicationID_idx_0#0, inner_txn_params%10%%param_ApplicationID_idx_0#0, inner_txn_params%12%%param_ApplicationID_idx_0#0} with app#0 made 5 modifications +debug: Found equivalence set: tmp%13#0, inner_txn_params%12%%param_ApplicationArgs_idx_1#0 +debug: Replacing {inner_txn_params%12%%param_ApplicationArgs_idx_1#0} with tmp%13#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat tmp%6#0 tmp%7#0) to 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003 +debug: Simplified (setbit 0x00 0u 1u) to 0x80 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable inner_txn_params%0%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%0%%Amount_length#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%Applications_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%0%%Assets_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%Fee_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%0%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%0%%Note_length#0 +debug: Removing unused variable inner_txn_params%0%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%0%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%0%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%0%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%0%%Sender_length#0 +debug: Removing unused variable inner_txn_params%0%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%0%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%0%%Type_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%0%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%0%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#0 +debug: Removing unused variable txn%%Amount#0 +debug: Removing unused variable txn%%ApplicationID#0 +debug: Removing unused variable txn%%ApprovalProgram#0 +debug: Removing unused variable txn%%AssetAmount#0 +debug: Removing unused variable txn%%AssetCloseTo#0 +debug: Removing unused variable txn%%ConfigAssetName#0 +debug: Removing unused variable txn%%AssetReceiver#0 +debug: Removing unused variable txn%%AssetSender#0 +debug: Removing unused variable txn%%ConfigAssetClawback#0 +debug: Removing unused variable txn%%ClearStateProgram#0 +debug: Removing unused variable txn%%CloseRemainderTo#0 +debug: Removing unused variable txn%%ConfigAsset#0 +debug: Removing unused variable txn%%CreatedApplicationID#0 +debug: Removing unused variable txn%%CreatedAssetID#0 +debug: Removing unused variable txn%%ConfigAssetDecimals#0 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable txn%%ExtraProgramPages#0 +debug: Removing unused variable txn%%Fee#0 +debug: Removing unused variable txn%%FirstValid#0 +debug: Removing unused variable txn%%FirstValidTime#0 +debug: Removing unused variable txn%%ConfigAssetFreeze#0 +debug: Removing unused variable txn%%FreezeAssetAccount#0 +debug: Removing unused variable txn%%FreezeAsset#0 +debug: Removing unused variable txn%%FreezeAssetFrozen#0 +debug: Removing unused variable txn%%GlobalNumByteSlice#0 +debug: Removing unused variable txn%%GlobalNumUint#0 +debug: Removing unused variable txn%%GroupIndex#0 +debug: Removing unused variable txn%%LastValid#0 +debug: Removing unused variable txn%%Lease#0 +debug: Removing unused variable txn%%LocalNumByteSlice#0 +debug: Removing unused variable txn%%LocalNumUint#0 +debug: Removing unused variable txn%%ConfigAssetManager#0 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#0 +debug: Removing unused variable txn%%Nonparticipation#0 +debug: Removing unused variable txn%%Note#0 +debug: Removing unused variable txn%%NumAccounts#0 +debug: Removing unused variable txn%%NumAppArgs#0 +debug: Removing unused variable txn%%NumApprovalProgramPages#0 +debug: Removing unused variable txn%%NumApplications#0 +debug: Removing unused variable txn%%NumAssets#0 +debug: Removing unused variable txn%%NumClearStateProgramPages#0 +debug: Removing unused variable txn%%NumLogs#0 +debug: Removing unused variable txn%%OnCompletion#0 +debug: Removing unused variable txn%%Receiver#0 +debug: Removing unused variable txn%%RekeyTo#0 +debug: Removing unused variable txn%%ConfigAssetReserve#0 +debug: Removing unused variable txn%%SelectionPK#0 +debug: Removing unused variable txn%%Sender#0 +debug: Removing unused variable txn%%StateProofPK#0 +debug: Removing unused variable txn%%ConfigAssetTotal#0 +debug: Removing unused variable txn%%TxID#0 +debug: Removing unused variable txn%%TypeEnum#0 +debug: Removing unused variable txn%%Type#0 +debug: Removing unused variable txn%%ConfigAssetUnitName#0 +debug: Removing unused variable txn%%ConfigAssetURL#0 +debug: Removing unused variable txn%%VoteFirst#0 +debug: Removing unused variable txn%%VotePK#0 +debug: Removing unused variable txn%%VoteKeyDilution#0 +debug: Removing unused variable txn%%VoteLast#0 +debug: Removing unused variable txn%%XferAsset#0 +debug: Removing unused variable inner_txn_params%2%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%2%%Amount_length#0 +debug: Removing unused variable inner_txn_params%2%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%2%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%2%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%2%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%2%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%2%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%2%%Applications_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%2%%Assets_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%2%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%2%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%2%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%2%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%2%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%2%%Fee_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%2%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%2%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%2%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%2%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%2%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%2%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%2%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%2%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%2%%Note_length#0 +debug: Removing unused variable inner_txn_params%2%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%2%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%2%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%2%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%2%%Sender_length#0 +debug: Removing unused variable inner_txn_params%2%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%2%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%2%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%2%%Type_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%2%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%2%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%2%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%2%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%2%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#1 +debug: Removing unused variable txn%%Amount#1 +debug: Removing unused variable txn%%ApplicationID#1 +debug: Removing unused variable txn%%ApprovalProgram#1 +debug: Removing unused variable txn%%AssetAmount#1 +debug: Removing unused variable txn%%AssetCloseTo#1 +debug: Removing unused variable txn%%ConfigAssetName#1 +debug: Removing unused variable txn%%AssetReceiver#1 +debug: Removing unused variable txn%%AssetSender#1 +debug: Removing unused variable txn%%ConfigAssetClawback#1 +debug: Removing unused variable txn%%ClearStateProgram#1 +debug: Removing unused variable txn%%CloseRemainderTo#1 +debug: Removing unused variable txn%%ConfigAsset#1 +debug: Removing unused variable txn%%CreatedApplicationID#1 +debug: Removing unused variable txn%%CreatedAssetID#1 +debug: Removing unused variable txn%%ConfigAssetDecimals#1 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#1 +debug: Removing unused variable txn%%ExtraProgramPages#1 +debug: Removing unused variable txn%%Fee#1 +debug: Removing unused variable txn%%FirstValid#1 +debug: Removing unused variable txn%%FirstValidTime#1 +debug: Removing unused variable txn%%ConfigAssetFreeze#1 +debug: Removing unused variable txn%%FreezeAssetAccount#1 +debug: Removing unused variable txn%%FreezeAsset#1 +debug: Removing unused variable txn%%FreezeAssetFrozen#1 +debug: Removing unused variable txn%%GlobalNumByteSlice#1 +debug: Removing unused variable txn%%GlobalNumUint#1 +debug: Removing unused variable txn%%GroupIndex#1 +debug: Removing unused variable txn%%LastValid#1 +debug: Removing unused variable txn%%Lease#1 +debug: Removing unused variable txn%%LocalNumByteSlice#1 +debug: Removing unused variable txn%%LocalNumUint#1 +debug: Removing unused variable txn%%ConfigAssetManager#1 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#1 +debug: Removing unused variable txn%%Nonparticipation#1 +debug: Removing unused variable txn%%Note#1 +debug: Removing unused variable txn%%NumAccounts#1 +debug: Removing unused variable txn%%NumAppArgs#1 +debug: Removing unused variable txn%%NumApprovalProgramPages#1 +debug: Removing unused variable txn%%NumApplications#1 +debug: Removing unused variable txn%%NumAssets#1 +debug: Removing unused variable txn%%NumClearStateProgramPages#1 +debug: Removing unused variable txn%%NumLogs#1 +debug: Removing unused variable txn%%OnCompletion#1 +debug: Removing unused variable txn%%Receiver#1 +debug: Removing unused variable txn%%RekeyTo#1 +debug: Removing unused variable txn%%ConfigAssetReserve#1 +debug: Removing unused variable txn%%SelectionPK#1 +debug: Removing unused variable txn%%Sender#1 +debug: Removing unused variable txn%%StateProofPK#1 +debug: Removing unused variable txn%%ConfigAssetTotal#1 +debug: Removing unused variable txn%%TxID#1 +debug: Removing unused variable txn%%TypeEnum#1 +debug: Removing unused variable txn%%Type#1 +debug: Removing unused variable txn%%ConfigAssetUnitName#1 +debug: Removing unused variable txn%%ConfigAssetURL#1 +debug: Removing unused variable txn%%VoteFirst#1 +debug: Removing unused variable txn%%VotePK#1 +debug: Removing unused variable txn%%VoteKeyDilution#1 +debug: Removing unused variable txn%%VoteLast#1 +debug: Removing unused variable txn%%XferAsset#1 +debug: Removing unused variable inner_txn_params%5%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%5%%Amount_length#0 +debug: Removing unused variable inner_txn_params%5%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%5%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%5%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%5%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%5%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%5%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%5%%Applications_length#0 +debug: Removing unused variable inner_txn_params%5%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%5%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%5%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%5%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%5%%Assets_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%5%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%5%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%5%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%5%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%5%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%5%%Fee_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%5%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%5%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%5%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%5%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%5%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%5%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%5%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%5%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%5%%Note_length#0 +debug: Removing unused variable inner_txn_params%5%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%5%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%5%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%5%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%5%%Sender_length#0 +debug: Removing unused variable inner_txn_params%5%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%5%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%5%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%5%%Type_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%5%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%5%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%5%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%5%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%5%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%5%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#2 +debug: Removing unused variable txn%%Amount#2 +debug: Removing unused variable txn%%ApplicationID#2 +debug: Removing unused variable txn%%ApprovalProgram#2 +debug: Removing unused variable txn%%AssetAmount#2 +debug: Removing unused variable txn%%AssetCloseTo#2 +debug: Removing unused variable txn%%ConfigAssetName#2 +debug: Removing unused variable txn%%AssetReceiver#2 +debug: Removing unused variable txn%%AssetSender#2 +debug: Removing unused variable txn%%ConfigAssetClawback#2 +debug: Removing unused variable txn%%ClearStateProgram#2 +debug: Removing unused variable txn%%CloseRemainderTo#2 +debug: Removing unused variable txn%%ConfigAsset#2 +debug: Removing unused variable txn%%CreatedApplicationID#2 +debug: Removing unused variable txn%%CreatedAssetID#2 +debug: Removing unused variable txn%%ConfigAssetDecimals#2 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#2 +debug: Removing unused variable txn%%ExtraProgramPages#2 +debug: Removing unused variable txn%%Fee#2 +debug: Removing unused variable txn%%FirstValid#2 +debug: Removing unused variable txn%%FirstValidTime#2 +debug: Removing unused variable txn%%ConfigAssetFreeze#2 +debug: Removing unused variable txn%%FreezeAssetAccount#2 +debug: Removing unused variable txn%%FreezeAsset#2 +debug: Removing unused variable txn%%FreezeAssetFrozen#2 +debug: Removing unused variable txn%%GlobalNumByteSlice#2 +debug: Removing unused variable txn%%GlobalNumUint#2 +debug: Removing unused variable txn%%GroupIndex#2 +debug: Removing unused variable txn%%LastValid#2 +debug: Removing unused variable txn%%Lease#2 +debug: Removing unused variable txn%%LocalNumByteSlice#2 +debug: Removing unused variable txn%%LocalNumUint#2 +debug: Removing unused variable txn%%ConfigAssetManager#2 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#2 +debug: Removing unused variable txn%%Nonparticipation#2 +debug: Removing unused variable txn%%Note#2 +debug: Removing unused variable txn%%NumAccounts#2 +debug: Removing unused variable txn%%NumAppArgs#2 +debug: Removing unused variable txn%%NumApprovalProgramPages#2 +debug: Removing unused variable txn%%NumApplications#2 +debug: Removing unused variable txn%%NumAssets#2 +debug: Removing unused variable txn%%NumClearStateProgramPages#2 +debug: Removing unused variable txn%%NumLogs#2 +debug: Removing unused variable txn%%OnCompletion#2 +debug: Removing unused variable txn%%Receiver#2 +debug: Removing unused variable txn%%RekeyTo#2 +debug: Removing unused variable txn%%ConfigAssetReserve#2 +debug: Removing unused variable txn%%SelectionPK#2 +debug: Removing unused variable txn%%Sender#2 +debug: Removing unused variable txn%%StateProofPK#2 +debug: Removing unused variable txn%%ConfigAssetTotal#2 +debug: Removing unused variable txn%%TxID#2 +debug: Removing unused variable txn%%TypeEnum#2 +debug: Removing unused variable txn%%Type#2 +debug: Removing unused variable txn%%ConfigAssetUnitName#2 +debug: Removing unused variable txn%%ConfigAssetURL#2 +debug: Removing unused variable txn%%VoteFirst#2 +debug: Removing unused variable txn%%VotePK#2 +debug: Removing unused variable txn%%VoteKeyDilution#2 +debug: Removing unused variable txn%%VoteLast#2 +debug: Removing unused variable txn%%XferAsset#2 +debug: Removing unused variable tmp%6#0 +debug: Removing unused variable tmp%7#0 +debug: Removing unused variable inner_txn_params%10%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%10%%Amount_length#0 +debug: Removing unused variable inner_txn_params%10%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%10%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%10%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%10%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%10%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%10%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%10%%Applications_length#0 +debug: Removing unused variable inner_txn_params%10%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%10%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%10%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%10%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%10%%Assets_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%10%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%10%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%10%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%10%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%10%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%10%%Fee_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%10%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%10%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%10%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%10%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%10%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%10%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%10%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%10%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%10%%Note_length#0 +debug: Removing unused variable inner_txn_params%10%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%10%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%10%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%10%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%10%%Sender_length#0 +debug: Removing unused variable inner_txn_params%10%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%10%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%10%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%10%%Type_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%10%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%10%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%10%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%10%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%10%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%10%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#3 +debug: Removing unused variable txn%%Amount#3 +debug: Removing unused variable txn%%ApplicationID#3 +debug: Removing unused variable txn%%ApprovalProgram#3 +debug: Removing unused variable txn%%AssetAmount#3 +debug: Removing unused variable txn%%AssetCloseTo#3 +debug: Removing unused variable txn%%ConfigAssetName#3 +debug: Removing unused variable txn%%AssetReceiver#3 +debug: Removing unused variable txn%%AssetSender#3 +debug: Removing unused variable txn%%ConfigAssetClawback#3 +debug: Removing unused variable txn%%ClearStateProgram#3 +debug: Removing unused variable txn%%CloseRemainderTo#3 +debug: Removing unused variable txn%%ConfigAsset#3 +debug: Removing unused variable txn%%CreatedApplicationID#3 +debug: Removing unused variable txn%%CreatedAssetID#3 +debug: Removing unused variable txn%%ConfigAssetDecimals#3 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#3 +debug: Removing unused variable txn%%ExtraProgramPages#3 +debug: Removing unused variable txn%%Fee#3 +debug: Removing unused variable txn%%FirstValid#3 +debug: Removing unused variable txn%%FirstValidTime#3 +debug: Removing unused variable txn%%ConfigAssetFreeze#3 +debug: Removing unused variable txn%%FreezeAssetAccount#3 +debug: Removing unused variable txn%%FreezeAsset#3 +debug: Removing unused variable txn%%FreezeAssetFrozen#3 +debug: Removing unused variable txn%%GlobalNumByteSlice#3 +debug: Removing unused variable txn%%GlobalNumUint#3 +debug: Removing unused variable txn%%GroupIndex#3 +debug: Removing unused variable txn%%LastValid#3 +debug: Removing unused variable txn%%Lease#3 +debug: Removing unused variable txn%%LocalNumByteSlice#3 +debug: Removing unused variable txn%%LocalNumUint#3 +debug: Removing unused variable txn%%ConfigAssetManager#3 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#3 +debug: Removing unused variable txn%%Nonparticipation#3 +debug: Removing unused variable txn%%Note#3 +debug: Removing unused variable txn%%NumAccounts#3 +debug: Removing unused variable txn%%NumAppArgs#3 +debug: Removing unused variable txn%%NumApprovalProgramPages#3 +debug: Removing unused variable txn%%NumApplications#3 +debug: Removing unused variable txn%%NumAssets#3 +debug: Removing unused variable txn%%NumClearStateProgramPages#3 +debug: Removing unused variable txn%%NumLogs#3 +debug: Removing unused variable txn%%OnCompletion#3 +debug: Removing unused variable txn%%Receiver#3 +debug: Removing unused variable txn%%RekeyTo#3 +debug: Removing unused variable txn%%ConfigAssetReserve#3 +debug: Removing unused variable txn%%SelectionPK#3 +debug: Removing unused variable txn%%Sender#3 +debug: Removing unused variable txn%%StateProofPK#3 +debug: Removing unused variable txn%%ConfigAssetTotal#3 +debug: Removing unused variable txn%%TxID#3 +debug: Removing unused variable txn%%TypeEnum#3 +debug: Removing unused variable txn%%Type#3 +debug: Removing unused variable txn%%ConfigAssetUnitName#3 +debug: Removing unused variable txn%%ConfigAssetURL#3 +debug: Removing unused variable txn%%VoteFirst#3 +debug: Removing unused variable txn%%VotePK#3 +debug: Removing unused variable txn%%VoteKeyDilution#3 +debug: Removing unused variable txn%%VoteLast#3 +debug: Removing unused variable txn%%XferAsset#3 +debug: Removing unused variable inner_txn_params%12%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%12%%Amount_length#0 +debug: Removing unused variable inner_txn_params%12%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%12%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%12%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%12%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%12%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%12%%Applications_length#0 +debug: Removing unused variable inner_txn_params%12%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%12%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%12%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%12%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%12%%Assets_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%12%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%12%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%12%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%12%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%12%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%12%%Fee_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%12%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%12%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%12%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%12%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%12%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%12%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%12%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%12%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%12%%Note_length#0 +debug: Removing unused variable inner_txn_params%12%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%12%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%12%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%12%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%12%%Sender_length#0 +debug: Removing unused variable inner_txn_params%12%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%12%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%12%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%12%%Type_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%12%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%12%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%12%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%12%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%12%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%12%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#4 +debug: Removing unused variable txn%%Amount#4 +debug: Removing unused variable txn%%ApplicationID#4 +debug: Removing unused variable txn%%ApprovalProgram#4 +debug: Removing unused variable txn%%AssetAmount#4 +debug: Removing unused variable txn%%AssetCloseTo#4 +debug: Removing unused variable txn%%ConfigAssetName#4 +debug: Removing unused variable txn%%AssetReceiver#4 +debug: Removing unused variable txn%%AssetSender#4 +debug: Removing unused variable txn%%ConfigAssetClawback#4 +debug: Removing unused variable txn%%ClearStateProgram#4 +debug: Removing unused variable txn%%CloseRemainderTo#4 +debug: Removing unused variable txn%%ConfigAsset#4 +debug: Removing unused variable txn%%CreatedApplicationID#4 +debug: Removing unused variable txn%%CreatedAssetID#4 +debug: Removing unused variable txn%%ConfigAssetDecimals#4 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#4 +debug: Removing unused variable txn%%ExtraProgramPages#4 +debug: Removing unused variable txn%%Fee#4 +debug: Removing unused variable txn%%FirstValid#4 +debug: Removing unused variable txn%%FirstValidTime#4 +debug: Removing unused variable txn%%ConfigAssetFreeze#4 +debug: Removing unused variable txn%%FreezeAssetAccount#4 +debug: Removing unused variable txn%%FreezeAsset#4 +debug: Removing unused variable txn%%FreezeAssetFrozen#4 +debug: Removing unused variable txn%%GlobalNumByteSlice#4 +debug: Removing unused variable txn%%GlobalNumUint#4 +debug: Removing unused variable txn%%GroupIndex#4 +debug: Removing unused variable txn%%LastValid#4 +debug: Removing unused variable txn%%Lease#4 +debug: Removing unused variable txn%%LocalNumByteSlice#4 +debug: Removing unused variable txn%%LocalNumUint#4 +debug: Removing unused variable txn%%ConfigAssetManager#4 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#4 +debug: Removing unused variable txn%%Nonparticipation#4 +debug: Removing unused variable txn%%Note#4 +debug: Removing unused variable txn%%NumAccounts#4 +debug: Removing unused variable txn%%NumAppArgs#4 +debug: Removing unused variable txn%%NumApprovalProgramPages#4 +debug: Removing unused variable txn%%NumApplications#4 +debug: Removing unused variable txn%%NumAssets#4 +debug: Removing unused variable txn%%NumClearStateProgramPages#4 +debug: Removing unused variable txn%%NumLogs#4 +debug: Removing unused variable txn%%OnCompletion#4 +debug: Removing unused variable txn%%Receiver#4 +debug: Removing unused variable txn%%RekeyTo#4 +debug: Removing unused variable txn%%ConfigAssetReserve#4 +debug: Removing unused variable txn%%SelectionPK#4 +debug: Removing unused variable txn%%Sender#4 +debug: Removing unused variable txn%%StateProofPK#4 +debug: Removing unused variable txn%%ConfigAssetTotal#4 +debug: Removing unused variable txn%%TxID#4 +debug: Removing unused variable txn%%TypeEnum#4 +debug: Removing unused variable txn%%Type#4 +debug: Removing unused variable txn%%ConfigAssetUnitName#4 +debug: Removing unused variable txn%%ConfigAssetURL#4 +debug: Removing unused variable txn%%VoteFirst#4 +debug: Removing unused variable txn%%VotePK#4 +debug: Removing unused variable txn%%VoteKeyDilution#4 +debug: Removing unused variable txn%%VoteLast#4 +debug: Removing unused variable txn%%XferAsset#4 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@1: // next_txn_L22 with block@0: // L20 in block@2: // next_txn_L25 +debug: Merged linear block@1: // next_txn_L22 into block@0: // L20 +debug: Replaced predecessor block@2: // next_txn_L25 with block@0: // L20 in block@3: // next_txn_L28 +debug: Merged linear block@2: // next_txn_L25 into block@0: // L20 +debug: Replaced predecessor block@3: // next_txn_L28 with block@0: // L20 in block@4: // next_txn_L31 +debug: Merged linear block@3: // next_txn_L28 into block@0: // L20 +debug: Replaced predecessor block@4: // next_txn_L31 with block@0: // L20 in block@5: // next_txn_L34 +debug: Merged linear block@4: // next_txn_L31 into block@0: // L20 +debug: Merged linear block@5: // next_txn_L34 into block@0: // L20 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: encoded_tuple_buffer%4#6, inner_txn_params%0%%param_ApplicationArgs_idx_15#0 +debug: Replacing {inner_txn_params%0%%param_ApplicationArgs_idx_15#0} with encoded_tuple_buffer%4#6 made 1 modifications +debug: Found equivalence set: app#0, inner_txn_params%0%%param_ApplicationID_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_ApplicationID_idx_0#0} with app#0 made 1 modifications +debug: Found equivalence set: tmp_itxn_0%%LastLog#0, awst_tmp%5#0 +debug: Replacing {awst_tmp%5#0} with tmp_itxn_0%%LastLog#0 made 2 modifications +debug: Found equivalence set: tmp%6#0, value%9#0, result#0 +debug: Replacing {tmp%6#0, value%9#0} with result#0 made 1 modifications +debug: Found equivalence set: tmp%8#0, check%10#0 +debug: Replacing {check%10#0} with tmp%8#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x 0xde) to 0xde +debug: Simplified (concat 0x 0x0f) to 0x0f +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable inner_txn_params%0%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%0%%Amount_length#0 +debug: Removing unused variable current_tail_offset%1#0 +debug: Removing unused variable encoded_tuple_buffer%2#0 +debug: Removing unused variable current_tail_offset%3#0 +debug: Removing unused variable encoded_tuple_buffer%4#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_2#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_3#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_4#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_5#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_6#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_7#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_8#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_9#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_10#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_11#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_12#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_13#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_14#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%Applications_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%0%%Assets_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%Fee_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%0%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%0%%Note_length#0 +debug: Removing unused variable inner_txn_params%0%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%0%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%0%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%0%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%0%%Sender_length#0 +debug: Removing unused variable inner_txn_params%0%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%0%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%0%%Type_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%0%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%0%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#0 +debug: Removing unused variable tmp_itxn_0%%Amount#0 +debug: Removing unused variable tmp_itxn_0%%ApplicationID#0 +debug: Removing unused variable tmp_itxn_0%%ApprovalProgram#0 +debug: Removing unused variable tmp_itxn_0%%AssetAmount#0 +debug: Removing unused variable tmp_itxn_0%%AssetCloseTo#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetName#0 +debug: Removing unused variable tmp_itxn_0%%AssetReceiver#0 +debug: Removing unused variable tmp_itxn_0%%AssetSender#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetClawback#0 +debug: Removing unused variable tmp_itxn_0%%ClearStateProgram#0 +debug: Removing unused variable tmp_itxn_0%%CloseRemainderTo#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAsset#0 +debug: Removing unused variable tmp_itxn_0%%CreatedApplicationID#0 +debug: Removing unused variable tmp_itxn_0%%CreatedAssetID#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetDecimals#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable tmp_itxn_0%%ExtraProgramPages#0 +debug: Removing unused variable tmp_itxn_0%%Fee#0 +debug: Removing unused variable tmp_itxn_0%%FirstValid#0 +debug: Removing unused variable tmp_itxn_0%%FirstValidTime#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetFreeze#0 +debug: Removing unused variable tmp_itxn_0%%FreezeAssetAccount#0 +debug: Removing unused variable tmp_itxn_0%%FreezeAsset#0 +debug: Removing unused variable tmp_itxn_0%%FreezeAssetFrozen#0 +debug: Removing unused variable tmp_itxn_0%%GlobalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_0%%GlobalNumUint#0 +debug: Removing unused variable tmp_itxn_0%%GroupIndex#0 +debug: Removing unused variable tmp_itxn_0%%LastValid#0 +debug: Removing unused variable tmp_itxn_0%%Lease#0 +debug: Removing unused variable tmp_itxn_0%%LocalNumByteSlice#0 +debug: Removing unused variable tmp_itxn_0%%LocalNumUint#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetManager#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetMetadataHash#0 +debug: Removing unused variable tmp_itxn_0%%Nonparticipation#0 +debug: Removing unused variable tmp_itxn_0%%Note#0 +debug: Removing unused variable tmp_itxn_0%%NumAccounts#0 +debug: Removing unused variable tmp_itxn_0%%NumAppArgs#0 +debug: Removing unused variable tmp_itxn_0%%NumApprovalProgramPages#0 +debug: Removing unused variable tmp_itxn_0%%NumApplications#0 +debug: Removing unused variable tmp_itxn_0%%NumAssets#0 +debug: Removing unused variable tmp_itxn_0%%NumClearStateProgramPages#0 +debug: Removing unused variable tmp_itxn_0%%NumLogs#0 +debug: Removing unused variable tmp_itxn_0%%OnCompletion#0 +debug: Removing unused variable tmp_itxn_0%%Receiver#0 +debug: Removing unused variable tmp_itxn_0%%RekeyTo#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetReserve#0 +debug: Removing unused variable tmp_itxn_0%%SelectionPK#0 +debug: Removing unused variable tmp_itxn_0%%Sender#0 +debug: Removing unused variable tmp_itxn_0%%StateProofPK#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetTotal#0 +debug: Removing unused variable tmp_itxn_0%%TxID#0 +debug: Removing unused variable tmp_itxn_0%%TypeEnum#0 +debug: Removing unused variable tmp_itxn_0%%Type#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetUnitName#0 +debug: Removing unused variable tmp_itxn_0%%ConfigAssetURL#0 +debug: Removing unused variable tmp_itxn_0%%VoteFirst#0 +debug: Removing unused variable tmp_itxn_0%%VotePK#0 +debug: Removing unused variable tmp_itxn_0%%VoteKeyDilution#0 +debug: Removing unused variable tmp_itxn_0%%VoteLast#0 +debug: Removing unused variable tmp_itxn_0%%XferAsset#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Merged linear block@1: // next_txn_L39 into block@0: // L37 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: app#0, inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%2%%param_ApplicationID_idx_0#0, inner_txn_params%4%%param_ApplicationID_idx_0#0, inner_txn_params%6%%param_ApplicationID_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%2%%param_ApplicationID_idx_0#0, inner_txn_params%4%%param_ApplicationID_idx_0#0, inner_txn_params%6%%param_ApplicationID_idx_0#0} with app#0 made 4 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable inner_txn_params%0%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%0%%Amount_length#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%Applications_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%0%%Assets_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%Fee_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%0%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%0%%Note_length#0 +debug: Removing unused variable inner_txn_params%0%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%0%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%0%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%0%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%0%%Sender_length#0 +debug: Removing unused variable inner_txn_params%0%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%0%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%0%%Type_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%0%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%0%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#0 +debug: Removing unused variable txn%%Amount#0 +debug: Removing unused variable txn%%ApplicationID#0 +debug: Removing unused variable txn%%ApprovalProgram#0 +debug: Removing unused variable txn%%AssetAmount#0 +debug: Removing unused variable txn%%AssetCloseTo#0 +debug: Removing unused variable txn%%ConfigAssetName#0 +debug: Removing unused variable txn%%AssetReceiver#0 +debug: Removing unused variable txn%%AssetSender#0 +debug: Removing unused variable txn%%ConfigAssetClawback#0 +debug: Removing unused variable txn%%ClearStateProgram#0 +debug: Removing unused variable txn%%CloseRemainderTo#0 +debug: Removing unused variable txn%%ConfigAsset#0 +debug: Removing unused variable txn%%CreatedApplicationID#0 +debug: Removing unused variable txn%%CreatedAssetID#0 +debug: Removing unused variable txn%%ConfigAssetDecimals#0 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable txn%%ExtraProgramPages#0 +debug: Removing unused variable txn%%Fee#0 +debug: Removing unused variable txn%%FirstValid#0 +debug: Removing unused variable txn%%FirstValidTime#0 +debug: Removing unused variable txn%%ConfigAssetFreeze#0 +debug: Removing unused variable txn%%FreezeAssetAccount#0 +debug: Removing unused variable txn%%FreezeAsset#0 +debug: Removing unused variable txn%%FreezeAssetFrozen#0 +debug: Removing unused variable txn%%GlobalNumByteSlice#0 +debug: Removing unused variable txn%%GlobalNumUint#0 +debug: Removing unused variable txn%%GroupIndex#0 +debug: Removing unused variable txn%%LastValid#0 +debug: Removing unused variable txn%%Lease#0 +debug: Removing unused variable txn%%LocalNumByteSlice#0 +debug: Removing unused variable txn%%LocalNumUint#0 +debug: Removing unused variable txn%%ConfigAssetManager#0 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#0 +debug: Removing unused variable txn%%Nonparticipation#0 +debug: Removing unused variable txn%%Note#0 +debug: Removing unused variable txn%%NumAccounts#0 +debug: Removing unused variable txn%%NumAppArgs#0 +debug: Removing unused variable txn%%NumApprovalProgramPages#0 +debug: Removing unused variable txn%%NumApplications#0 +debug: Removing unused variable txn%%NumAssets#0 +debug: Removing unused variable txn%%NumClearStateProgramPages#0 +debug: Removing unused variable txn%%NumLogs#0 +debug: Removing unused variable txn%%OnCompletion#0 +debug: Removing unused variable txn%%Receiver#0 +debug: Removing unused variable txn%%RekeyTo#0 +debug: Removing unused variable txn%%ConfigAssetReserve#0 +debug: Removing unused variable txn%%SelectionPK#0 +debug: Removing unused variable txn%%Sender#0 +debug: Removing unused variable txn%%StateProofPK#0 +debug: Removing unused variable txn%%ConfigAssetTotal#0 +debug: Removing unused variable txn%%TxID#0 +debug: Removing unused variable txn%%TypeEnum#0 +debug: Removing unused variable txn%%Type#0 +debug: Removing unused variable txn%%ConfigAssetUnitName#0 +debug: Removing unused variable txn%%ConfigAssetURL#0 +debug: Removing unused variable txn%%VoteFirst#0 +debug: Removing unused variable txn%%VotePK#0 +debug: Removing unused variable txn%%VoteKeyDilution#0 +debug: Removing unused variable txn%%VoteLast#0 +debug: Removing unused variable txn%%XferAsset#0 +debug: Removing unused variable inner_txn_params%2%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%2%%Amount_length#0 +debug: Removing unused variable inner_txn_params%2%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%2%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%2%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%2%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%2%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%2%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%2%%Applications_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%2%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%2%%Assets_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%2%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%2%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%2%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%2%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%2%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%2%%Fee_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%2%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%2%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%2%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%2%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%2%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%2%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%2%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%2%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%2%%Note_length#0 +debug: Removing unused variable inner_txn_params%2%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%2%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%2%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%2%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%2%%Sender_length#0 +debug: Removing unused variable inner_txn_params%2%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%2%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%2%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%2%%Type_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%2%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%2%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%2%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%2%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%2%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%2%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#1 +debug: Removing unused variable txn%%Amount#1 +debug: Removing unused variable txn%%ApplicationID#1 +debug: Removing unused variable txn%%ApprovalProgram#1 +debug: Removing unused variable txn%%AssetAmount#1 +debug: Removing unused variable txn%%AssetCloseTo#1 +debug: Removing unused variable txn%%ConfigAssetName#1 +debug: Removing unused variable txn%%AssetReceiver#1 +debug: Removing unused variable txn%%AssetSender#1 +debug: Removing unused variable txn%%ConfigAssetClawback#1 +debug: Removing unused variable txn%%ClearStateProgram#1 +debug: Removing unused variable txn%%CloseRemainderTo#1 +debug: Removing unused variable txn%%ConfigAsset#1 +debug: Removing unused variable txn%%CreatedApplicationID#1 +debug: Removing unused variable txn%%CreatedAssetID#1 +debug: Removing unused variable txn%%ConfigAssetDecimals#1 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#1 +debug: Removing unused variable txn%%ExtraProgramPages#1 +debug: Removing unused variable txn%%Fee#1 +debug: Removing unused variable txn%%FirstValid#1 +debug: Removing unused variable txn%%FirstValidTime#1 +debug: Removing unused variable txn%%ConfigAssetFreeze#1 +debug: Removing unused variable txn%%FreezeAssetAccount#1 +debug: Removing unused variable txn%%FreezeAsset#1 +debug: Removing unused variable txn%%FreezeAssetFrozen#1 +debug: Removing unused variable txn%%GlobalNumByteSlice#1 +debug: Removing unused variable txn%%GlobalNumUint#1 +debug: Removing unused variable txn%%GroupIndex#1 +debug: Removing unused variable txn%%LastValid#1 +debug: Removing unused variable txn%%Lease#1 +debug: Removing unused variable txn%%LocalNumByteSlice#1 +debug: Removing unused variable txn%%LocalNumUint#1 +debug: Removing unused variable txn%%ConfigAssetManager#1 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#1 +debug: Removing unused variable txn%%Nonparticipation#1 +debug: Removing unused variable txn%%Note#1 +debug: Removing unused variable txn%%NumAccounts#1 +debug: Removing unused variable txn%%NumAppArgs#1 +debug: Removing unused variable txn%%NumApprovalProgramPages#1 +debug: Removing unused variable txn%%NumApplications#1 +debug: Removing unused variable txn%%NumAssets#1 +debug: Removing unused variable txn%%NumClearStateProgramPages#1 +debug: Removing unused variable txn%%NumLogs#1 +debug: Removing unused variable txn%%OnCompletion#1 +debug: Removing unused variable txn%%Receiver#1 +debug: Removing unused variable txn%%RekeyTo#1 +debug: Removing unused variable txn%%ConfigAssetReserve#1 +debug: Removing unused variable txn%%SelectionPK#1 +debug: Removing unused variable txn%%Sender#1 +debug: Removing unused variable txn%%StateProofPK#1 +debug: Removing unused variable txn%%ConfigAssetTotal#1 +debug: Removing unused variable txn%%TxID#1 +debug: Removing unused variable txn%%TypeEnum#1 +debug: Removing unused variable txn%%Type#1 +debug: Removing unused variable txn%%ConfigAssetUnitName#1 +debug: Removing unused variable txn%%ConfigAssetURL#1 +debug: Removing unused variable txn%%VoteFirst#1 +debug: Removing unused variable txn%%VotePK#1 +debug: Removing unused variable txn%%VoteKeyDilution#1 +debug: Removing unused variable txn%%VoteLast#1 +debug: Removing unused variable txn%%XferAsset#1 +debug: Removing unused variable inner_txn_params%4%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%4%%Amount_length#0 +debug: Removing unused variable inner_txn_params%4%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%4%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%4%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%4%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%4%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%4%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%4%%Applications_length#0 +debug: Removing unused variable inner_txn_params%4%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%4%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%4%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%4%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%4%%Assets_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%4%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%4%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%4%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%4%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%4%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%4%%Fee_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%4%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%4%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%4%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%4%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%4%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%4%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%4%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%4%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%4%%Note_length#0 +debug: Removing unused variable inner_txn_params%4%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%4%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%4%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%4%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%4%%Sender_length#0 +debug: Removing unused variable inner_txn_params%4%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%4%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%4%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%4%%Type_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%4%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%4%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%4%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%4%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%4%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%4%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#2 +debug: Removing unused variable txn%%Amount#2 +debug: Removing unused variable txn%%ApplicationID#2 +debug: Removing unused variable txn%%ApprovalProgram#2 +debug: Removing unused variable txn%%AssetAmount#2 +debug: Removing unused variable txn%%AssetCloseTo#2 +debug: Removing unused variable txn%%ConfigAssetName#2 +debug: Removing unused variable txn%%AssetReceiver#2 +debug: Removing unused variable txn%%AssetSender#2 +debug: Removing unused variable txn%%ConfigAssetClawback#2 +debug: Removing unused variable txn%%ClearStateProgram#2 +debug: Removing unused variable txn%%CloseRemainderTo#2 +debug: Removing unused variable txn%%ConfigAsset#2 +debug: Removing unused variable txn%%CreatedApplicationID#2 +debug: Removing unused variable txn%%CreatedAssetID#2 +debug: Removing unused variable txn%%ConfigAssetDecimals#2 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#2 +debug: Removing unused variable txn%%ExtraProgramPages#2 +debug: Removing unused variable txn%%Fee#2 +debug: Removing unused variable txn%%FirstValid#2 +debug: Removing unused variable txn%%FirstValidTime#2 +debug: Removing unused variable txn%%ConfigAssetFreeze#2 +debug: Removing unused variable txn%%FreezeAssetAccount#2 +debug: Removing unused variable txn%%FreezeAsset#2 +debug: Removing unused variable txn%%FreezeAssetFrozen#2 +debug: Removing unused variable txn%%GlobalNumByteSlice#2 +debug: Removing unused variable txn%%GlobalNumUint#2 +debug: Removing unused variable txn%%GroupIndex#2 +debug: Removing unused variable txn%%LastValid#2 +debug: Removing unused variable txn%%Lease#2 +debug: Removing unused variable txn%%LocalNumByteSlice#2 +debug: Removing unused variable txn%%LocalNumUint#2 +debug: Removing unused variable txn%%ConfigAssetManager#2 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#2 +debug: Removing unused variable txn%%Nonparticipation#2 +debug: Removing unused variable txn%%Note#2 +debug: Removing unused variable txn%%NumAccounts#2 +debug: Removing unused variable txn%%NumAppArgs#2 +debug: Removing unused variable txn%%NumApprovalProgramPages#2 +debug: Removing unused variable txn%%NumApplications#2 +debug: Removing unused variable txn%%NumAssets#2 +debug: Removing unused variable txn%%NumClearStateProgramPages#2 +debug: Removing unused variable txn%%NumLogs#2 +debug: Removing unused variable txn%%OnCompletion#2 +debug: Removing unused variable txn%%Receiver#2 +debug: Removing unused variable txn%%RekeyTo#2 +debug: Removing unused variable txn%%ConfigAssetReserve#2 +debug: Removing unused variable txn%%SelectionPK#2 +debug: Removing unused variable txn%%Sender#2 +debug: Removing unused variable txn%%StateProofPK#2 +debug: Removing unused variable txn%%ConfigAssetTotal#2 +debug: Removing unused variable txn%%TxID#2 +debug: Removing unused variable txn%%TypeEnum#2 +debug: Removing unused variable txn%%Type#2 +debug: Removing unused variable txn%%ConfigAssetUnitName#2 +debug: Removing unused variable txn%%ConfigAssetURL#2 +debug: Removing unused variable txn%%VoteFirst#2 +debug: Removing unused variable txn%%VotePK#2 +debug: Removing unused variable txn%%VoteKeyDilution#2 +debug: Removing unused variable txn%%VoteLast#2 +debug: Removing unused variable txn%%XferAsset#2 +debug: Removing unused variable inner_txn_params%6%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%6%%Amount_length#0 +debug: Removing unused variable inner_txn_params%6%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%6%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%6%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%6%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%6%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%6%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%6%%Applications_length#0 +debug: Removing unused variable inner_txn_params%6%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%6%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%6%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%6%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%6%%Assets_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%6%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%6%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%6%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%6%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%6%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%6%%Fee_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%6%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%6%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%6%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%6%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%6%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%6%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%6%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%6%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%6%%Note_length#0 +debug: Removing unused variable inner_txn_params%6%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%6%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%6%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%6%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%6%%Sender_length#0 +debug: Removing unused variable inner_txn_params%6%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%6%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%6%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%6%%Type_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%6%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%6%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%6%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%6%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%6%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%6%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#3 +debug: Removing unused variable txn%%Amount#3 +debug: Removing unused variable txn%%ApplicationID#3 +debug: Removing unused variable txn%%ApprovalProgram#3 +debug: Removing unused variable txn%%AssetAmount#3 +debug: Removing unused variable txn%%AssetCloseTo#3 +debug: Removing unused variable txn%%ConfigAssetName#3 +debug: Removing unused variable txn%%AssetReceiver#3 +debug: Removing unused variable txn%%AssetSender#3 +debug: Removing unused variable txn%%ConfigAssetClawback#3 +debug: Removing unused variable txn%%ClearStateProgram#3 +debug: Removing unused variable txn%%CloseRemainderTo#3 +debug: Removing unused variable txn%%ConfigAsset#3 +debug: Removing unused variable txn%%CreatedApplicationID#3 +debug: Removing unused variable txn%%CreatedAssetID#3 +debug: Removing unused variable txn%%ConfigAssetDecimals#3 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#3 +debug: Removing unused variable txn%%ExtraProgramPages#3 +debug: Removing unused variable txn%%Fee#3 +debug: Removing unused variable txn%%FirstValid#3 +debug: Removing unused variable txn%%FirstValidTime#3 +debug: Removing unused variable txn%%ConfigAssetFreeze#3 +debug: Removing unused variable txn%%FreezeAssetAccount#3 +debug: Removing unused variable txn%%FreezeAsset#3 +debug: Removing unused variable txn%%FreezeAssetFrozen#3 +debug: Removing unused variable txn%%GlobalNumByteSlice#3 +debug: Removing unused variable txn%%GlobalNumUint#3 +debug: Removing unused variable txn%%GroupIndex#3 +debug: Removing unused variable txn%%LastValid#3 +debug: Removing unused variable txn%%Lease#3 +debug: Removing unused variable txn%%LocalNumByteSlice#3 +debug: Removing unused variable txn%%LocalNumUint#3 +debug: Removing unused variable txn%%ConfigAssetManager#3 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#3 +debug: Removing unused variable txn%%Nonparticipation#3 +debug: Removing unused variable txn%%Note#3 +debug: Removing unused variable txn%%NumAccounts#3 +debug: Removing unused variable txn%%NumAppArgs#3 +debug: Removing unused variable txn%%NumApprovalProgramPages#3 +debug: Removing unused variable txn%%NumApplications#3 +debug: Removing unused variable txn%%NumAssets#3 +debug: Removing unused variable txn%%NumClearStateProgramPages#3 +debug: Removing unused variable txn%%NumLogs#3 +debug: Removing unused variable txn%%OnCompletion#3 +debug: Removing unused variable txn%%Receiver#3 +debug: Removing unused variable txn%%RekeyTo#3 +debug: Removing unused variable txn%%ConfigAssetReserve#3 +debug: Removing unused variable txn%%SelectionPK#3 +debug: Removing unused variable txn%%Sender#3 +debug: Removing unused variable txn%%StateProofPK#3 +debug: Removing unused variable txn%%ConfigAssetTotal#3 +debug: Removing unused variable txn%%TxID#3 +debug: Removing unused variable txn%%TypeEnum#3 +debug: Removing unused variable txn%%Type#3 +debug: Removing unused variable txn%%ConfigAssetUnitName#3 +debug: Removing unused variable txn%%ConfigAssetURL#3 +debug: Removing unused variable txn%%VoteFirst#3 +debug: Removing unused variable txn%%VotePK#3 +debug: Removing unused variable txn%%VoteKeyDilution#3 +debug: Removing unused variable txn%%VoteLast#3 +debug: Removing unused variable txn%%XferAsset#3 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@1: // next_txn_L68 with block@0: // L66 in block@2: // next_txn_L71 +debug: Merged linear block@1: // next_txn_L68 into block@0: // L66 +debug: Replaced predecessor block@2: // next_txn_L71 with block@0: // L66 in block@3: // next_txn_L74 +debug: Merged linear block@2: // next_txn_L71 into block@0: // L66 +debug: Replaced predecessor block@3: // next_txn_L74 with block@0: // L66 in block@4: // next_txn_L77 +debug: Merged linear block@3: // next_txn_L74 into block@0: // L66 +debug: Merged linear block@4: // next_txn_L77 into block@0: // L66 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tmp%1#0, inner_txn_params%0%%param_Accounts_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_Accounts_idx_0#0} with tmp%1#0 made 1 modifications +debug: Found equivalence set: app#0, inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%0%%param_Applications_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_ApplicationID_idx_0#0, inner_txn_params%0%%param_Applications_idx_0#0} with app#0 made 2 modifications +debug: Found equivalence set: asset#0, inner_txn_params%0%%param_Assets_idx_0#0 +debug: Replacing {inner_txn_params%0%%param_Assets_idx_0#0} with asset#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable inner_txn_params%0%%Accounts_length#0 +debug: Removing unused variable inner_txn_params%0%%Amount_length#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_1#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_2#0 +debug: Removing unused variable inner_txn_params%0%%param_ApplicationArgs_idx_3#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationArgs_length#0 +debug: Removing unused variable inner_txn_params%0%%ApplicationID_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ApprovalProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%Applications_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetAmount_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetCloseTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetName_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetReceiver_length#0 +debug: Removing unused variable inner_txn_params%0%%AssetSender_length#0 +debug: Removing unused variable inner_txn_params%0%%Assets_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetClawback_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgram_length#0 +debug: Removing unused variable inner_txn_params%0%%ClearStateProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%CloseRemainderTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDecimals_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetDefaultFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%ExtraProgramPages_length#0 +debug: Removing unused variable inner_txn_params%0%%param_Fee_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%Fee_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetFreeze_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetAccount_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAsset_length#0 +debug: Removing unused variable inner_txn_params%0%%FreezeAssetFrozen_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%GlobalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumByteSlice_length#0 +debug: Removing unused variable inner_txn_params%0%%LocalNumUint_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetManager_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetMetadataHash_length#0 +debug: Removing unused variable inner_txn_params%0%%Nonparticipation_length#0 +debug: Removing unused variable inner_txn_params%0%%Note_length#0 +debug: Removing unused variable inner_txn_params%0%%OnCompletion_length#0 +debug: Removing unused variable inner_txn_params%0%%Receiver_length#0 +debug: Removing unused variable inner_txn_params%0%%RekeyTo_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetReserve_length#0 +debug: Removing unused variable inner_txn_params%0%%SelectionPK_length#0 +debug: Removing unused variable inner_txn_params%0%%Sender_length#0 +debug: Removing unused variable inner_txn_params%0%%StateProofPK_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetTotal_length#0 +debug: Removing unused variable inner_txn_params%0%%param_TypeEnum_idx_0#0 +debug: Removing unused variable inner_txn_params%0%%TypeEnum_length#0 +debug: Removing unused variable inner_txn_params%0%%Type_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetUnitName_length#0 +debug: Removing unused variable inner_txn_params%0%%ConfigAssetURL_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteFirst_length#0 +debug: Removing unused variable inner_txn_params%0%%VotePK_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteKeyDilution_length#0 +debug: Removing unused variable inner_txn_params%0%%VoteLast_length#0 +debug: Removing unused variable inner_txn_params%0%%XferAsset_length#0 +debug: Removing unused variable %%inner_txn_submit_id#0 +debug: Removing unused variable txn%%Amount#0 +debug: Removing unused variable txn%%ApplicationID#0 +debug: Removing unused variable txn%%ApprovalProgram#0 +debug: Removing unused variable txn%%AssetAmount#0 +debug: Removing unused variable txn%%AssetCloseTo#0 +debug: Removing unused variable txn%%ConfigAssetName#0 +debug: Removing unused variable txn%%AssetReceiver#0 +debug: Removing unused variable txn%%AssetSender#0 +debug: Removing unused variable txn%%ConfigAssetClawback#0 +debug: Removing unused variable txn%%ClearStateProgram#0 +debug: Removing unused variable txn%%CloseRemainderTo#0 +debug: Removing unused variable txn%%ConfigAsset#0 +debug: Removing unused variable txn%%CreatedApplicationID#0 +debug: Removing unused variable txn%%CreatedAssetID#0 +debug: Removing unused variable txn%%ConfigAssetDecimals#0 +debug: Removing unused variable txn%%ConfigAssetDefaultFrozen#0 +debug: Removing unused variable txn%%ExtraProgramPages#0 +debug: Removing unused variable txn%%Fee#0 +debug: Removing unused variable txn%%FirstValid#0 +debug: Removing unused variable txn%%FirstValidTime#0 +debug: Removing unused variable txn%%ConfigAssetFreeze#0 +debug: Removing unused variable txn%%FreezeAssetAccount#0 +debug: Removing unused variable txn%%FreezeAsset#0 +debug: Removing unused variable txn%%FreezeAssetFrozen#0 +debug: Removing unused variable txn%%GlobalNumByteSlice#0 +debug: Removing unused variable txn%%GlobalNumUint#0 +debug: Removing unused variable txn%%GroupIndex#0 +debug: Removing unused variable txn%%LastValid#0 +debug: Removing unused variable txn%%Lease#0 +debug: Removing unused variable txn%%LocalNumByteSlice#0 +debug: Removing unused variable txn%%LocalNumUint#0 +debug: Removing unused variable txn%%ConfigAssetManager#0 +debug: Removing unused variable txn%%ConfigAssetMetadataHash#0 +debug: Removing unused variable txn%%Nonparticipation#0 +debug: Removing unused variable txn%%Note#0 +debug: Removing unused variable txn%%NumAccounts#0 +debug: Removing unused variable txn%%NumAppArgs#0 +debug: Removing unused variable txn%%NumApprovalProgramPages#0 +debug: Removing unused variable txn%%NumApplications#0 +debug: Removing unused variable txn%%NumAssets#0 +debug: Removing unused variable txn%%NumClearStateProgramPages#0 +debug: Removing unused variable txn%%NumLogs#0 +debug: Removing unused variable txn%%OnCompletion#0 +debug: Removing unused variable txn%%Receiver#0 +debug: Removing unused variable txn%%RekeyTo#0 +debug: Removing unused variable txn%%ConfigAssetReserve#0 +debug: Removing unused variable txn%%SelectionPK#0 +debug: Removing unused variable txn%%Sender#0 +debug: Removing unused variable txn%%StateProofPK#0 +debug: Removing unused variable txn%%ConfigAssetTotal#0 +debug: Removing unused variable txn%%TxID#0 +debug: Removing unused variable txn%%TypeEnum#0 +debug: Removing unused variable txn%%Type#0 +debug: Removing unused variable txn%%ConfigAssetUnitName#0 +debug: Removing unused variable txn%%ConfigAssetURL#0 +debug: Removing unused variable txn%%VoteFirst#0 +debug: Removing unused variable txn%%VotePK#0 +debug: Removing unused variable txn%%VoteKeyDilution#0 +debug: Removing unused variable txn%%VoteLast#0 +debug: Removing unused variable txn%%XferAsset#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Merged linear block@1: // next_txn_L82 into block@0: // L80 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%8#0 +debug: Removing unused variable tmp%13#0 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0xde 0xad) to 0xdead +debug: Simplified (concat 0x0f 0x10) to 0x0f10 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%2#1 +debug: Removing unused variable encoded_tuple_buffer%4#1 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0xdead 0xbe) to 0xdeadbe +debug: Simplified (concat 0x0f10 0x11) to 0x0f1011 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%2#2 +debug: Removing unused variable encoded_tuple_buffer%4#2 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0xdeadbe 0xef) to 0xdeadbeef +debug: Simplified (concat 0x0f1011 0x12) to 0x0f101112 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%2#3 +debug: Removing unused variable encoded_tuple_buffer%4#3 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x0f101112 0xdeadbeef) to 0x0f101112deadbeef +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%2#4 +debug: Removing unused variable encoded_tuple_buffer%4#4 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (concat 0x0f101112deadbeef 0x14) to 0x0f101112deadbeef14 +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%4#5 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%4#6 +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Output IR to typed_abi_call/out/Greeter.ssa.opt_pass_7.ir +debug: Begin optimization pass 8/100 +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: No optimizations performed in pass 8, ending loop +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Removing Phis from test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds using strategy RootOperandGrouping +debug: Coalescing result#0 with [result#1, result#2, result#3, result#4] +debug: Coalescing resulted in 8 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion using strategy RootOperandGrouping +debug: Coalescing txn%%LastLog#0 with [txn%%LastLog#1, txn%%LastLog#2, txn%%LastLog#3, txn%%LastLog#4] +debug: Coalescing resulted in 8 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.test_void using strategy RootOperandGrouping +debug: Coalescing txn%%LastLog#0 with [txn%%LastLog#1, txn%%LastLog#2, txn%%LastLog#3] +debug: Coalescing resulted in 6 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.test_method_selector_kinds +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.test_arg_conversion +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.test_15plus_args +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.test_void +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.test_ref_types +debug: Sequentializing parallel copies in test_cases.typed_abi_call.typed_c2c.Greeter.clear_state_program +debug: Performing post-SSA optimizations +debug: Output IR to typed_abi_call/out/Greeter.destructured.ir +debug: Inserted main_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@1.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_abi_routing@1.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_test_method_selector_kinds_route@2.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_test_method_selector_kinds_route@2.ops[3]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_test_method_selector_kinds_route@2.ops[5]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_test_method_selector_kinds_route@2.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_test_method_selector_kinds_route@2.ops[10]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_test_method_selector_kinds_route@2.ops[12]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_test_method_selector_kinds_route@2.ops[15]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_test_method_selector_kinds_route@2.ops[17]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_test_method_selector_kinds_route@2.ops[19]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_test_method_selector_kinds_route@2.ops[21]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_test_method_selector_kinds_route@2.ops[23]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_test_method_selector_kinds_route@2.ops[25]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_test_arg_conversion_route@3.ops[1]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_test_arg_conversion_route@3.ops[3]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_test_arg_conversion_route@3.ops[5]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_test_arg_conversion_route@3.ops[7]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_test_arg_conversion_route@3.ops[10]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_test_arg_conversion_route@3.ops[12]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_test_arg_conversion_route@3.ops[15]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_test_arg_conversion_route@3.ops[17]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_test_arg_conversion_route@3.ops[19]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_test_arg_conversion_route@3.ops[21]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_test_arg_conversion_route@3.ops[23]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_test_arg_conversion_route@3.ops[25]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_test_15plus_args_route@4.ops[1]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_test_15plus_args_route@4.ops[3]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_test_15plus_args_route@4.ops[5]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_test_15plus_args_route@4.ops[7]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_test_15plus_args_route@4.ops[10]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_test_15plus_args_route@4.ops[12]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_test_15plus_args_route@4.ops[15]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_test_15plus_args_route@4.ops[17]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_test_15plus_args_route@4.ops[19]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_test_15plus_args_route@4.ops[21]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_test_15plus_args_route@4.ops[23]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_test_15plus_args_route@4.ops[25]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_test_void_route@5.ops[1]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_test_void_route@5.ops[3]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_test_void_route@5.ops[5]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_test_void_route@5.ops[7]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_test_void_route@5.ops[10]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_test_void_route@5.ops[12]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_test_void_route@5.ops[15]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_test_void_route@5.ops[17]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_test_void_route@5.ops[19]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_test_void_route@5.ops[21]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_test_void_route@5.ops[23]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_test_void_route@5.ops[25]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[1]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[3]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[5]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[7]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[10]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[12]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[15]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[17]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[19]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[21]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[25]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[27]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[29]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[31]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[33]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[36]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_test_ref_types_route@6.ops[23]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_test_ref_types_route@6.ops[36]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@9.ops[1]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced main_bare_routing@9.ops[3]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@9.ops[5]: 'store not%tmp%35#0 to l-stack (copy)' +debug: Replaced main_bare_routing@9.ops[7]: 'load not%tmp%35#0' with 'load not%tmp%35#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@9.ops[10]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_bare_routing@9.ops[12]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@9.ops[14]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_bare_routing@9.ops[16]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Found 2 edge set/s for test_cases.typed_abi_call.typed_c2c.Greeter.approval_program +debug: Inserted test_method_selector_kinds_block@0.ops[13]: 'store tmp_itxn_0%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[15]: 'load tmp_itxn_0%%LastLog#0' with 'load tmp_itxn_0%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[20]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[22]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[27]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[32]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[34]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[49]: 'store tmp_itxn_1%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[51]: 'load tmp_itxn_1%%LastLog#0' with 'load tmp_itxn_1%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[56]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[58]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[61]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[63]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[68]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[70]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[85]: 'store tmp_itxn_2%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[87]: 'load tmp_itxn_2%%LastLog#0' with 'load tmp_itxn_2%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[92]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[94]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[97]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[99]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[104]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[106]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[121]: 'store tmp_itxn_3%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[123]: 'load tmp_itxn_3%%LastLog#0' with 'load tmp_itxn_3%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[128]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[130]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[133]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[135]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[140]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[142]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[157]: 'store tmp_itxn_4%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[159]: 'load tmp_itxn_4%%LastLog#0' with 'load tmp_itxn_4%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[164]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[166]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[169]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[171]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[176]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[178]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[16]: 'store tmp_itxn_0%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[19]: 'load tmp_itxn_0%%LastLog#0' with 'load tmp_itxn_0%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[53]: 'store tmp_itxn_1%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[56]: 'load tmp_itxn_1%%LastLog#0' with 'load tmp_itxn_1%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[90]: 'store tmp_itxn_2%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[93]: 'load tmp_itxn_2%%LastLog#0' with 'load tmp_itxn_2%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[127]: 'store tmp_itxn_3%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[130]: 'load tmp_itxn_3%%LastLog#0' with 'load tmp_itxn_3%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[164]: 'store tmp_itxn_4%%LastLog#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[167]: 'load tmp_itxn_4%%LastLog#0' with 'load tmp_itxn_4%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[18]: 'store result#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[31]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[56]: 'store result#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[69]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[94]: 'store result#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[107]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[132]: 'store result#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[145]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted test_method_selector_kinds_block@0.ops[170]: 'store result#0 to l-stack (copy)' +debug: Replaced test_method_selector_kinds_block@0.ops[183]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[13]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[15]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[18]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[20]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[42]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[44]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[59]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[61]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[64]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[66]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[81]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[83]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[86]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[88]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[103]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[105]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[108]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[110]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[38]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[41]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted test_arg_conversion_block@0.ops[35]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_arg_conversion_block@0.ops[41]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[41]: 'store tmp_itxn_0%%LastLog#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[43]: 'load tmp_itxn_0%%LastLog#0' with 'load tmp_itxn_0%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[48]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[50]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[53]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[55]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[59]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[61]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[64]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[66]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[44]: 'store tmp_itxn_0%%LastLog#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[47]: 'load tmp_itxn_0%%LastLog#0' with 'load tmp_itxn_0%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_15plus_args_block@0.ops[46]: 'store result#0 to l-stack (copy)' +debug: Replaced test_15plus_args_block@0.ops[59]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[13]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[15]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[18]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[20]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[35]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[37]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[40]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[42]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[57]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[59]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[62]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[64]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[79]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[81]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +debug: Inserted test_void_block@0.ops[84]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced test_void_block@0.ops[86]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[51]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[53]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[28]: 'store check%3#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[31]: 'load check%3#0' with 'load check%3#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[34]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[37]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[42]: 'store check%7#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[45]: 'load check%7#0' with 'load check%7#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[50]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[53]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[44]: 'store value%6#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[49]: 'load value%6#0' with 'load value%6#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[30]: 'store value%2#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[37]: 'load value%2#0' with 'load value%2#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[40]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[50]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[2]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[22]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted test_ref_types_block@0.ops[26]: 'store txn%%LastLog#0 to l-stack (copy)' +debug: Replaced test_ref_types_block@0.ops[57]: 'load txn%%LastLog#0' with 'load txn%%LastLog#0 from l-stack (no copy)' +info: Writing typed_abi_call/out/Logger.approval.teal +info: Writing typed_abi_call/out/Logger.clear.teal +info: Writing typed_abi_call/out/Logger.arc32.json +info: Writing typed_abi_call/out/client_Logger.py +info: Writing typed_abi_call/out/Greeter.approval.teal +info: Writing typed_abi_call/out/Greeter.clear.teal +info: Writing typed_abi_call/out/Greeter.arc32.json +info: Writing typed_abi_call/out/client_Greeter.py \ No newline at end of file diff --git a/test_cases/typed_abi_call/typed_c2c.py b/test_cases/typed_abi_call/typed_c2c.py new file mode 100644 index 0000000000..18ae09f235 --- /dev/null +++ b/test_cases/typed_abi_call/typed_c2c.py @@ -0,0 +1,93 @@ +from puyapy import Application, ARC4Contract, Asset, Bytes, Global, arc4, op + +from test_cases.typed_abi_call.logger import Logger, LoggerClient + + +class Greeter(ARC4Contract): + @arc4.abimethod() + def test_method_selector_kinds(self, app: Application) -> None: + result, _txn = arc4.abi_call(Logger.echo, arc4.String("test1"), app_id=app, fee=0) + assert result == "echo: test1" + result, _txn = arc4.abi_call(LoggerClient.echo, "test2", app_id=app, fee=0) + assert result == "echo: test2" + result, _txn = arc4.abi_call[arc4.String]("echo", "test3", app_id=app, fee=0) + assert result == "echo: test3" + result, _txn = arc4.abi_call[arc4.String]("echo(string)", "test4", app_id=app, fee=0) + assert result == "echo: test4" + result, _txn = arc4.abi_call[arc4.String]("echo(string)string", "test5", app_id=app, fee=0) + assert result == "echo: test5" + + @arc4.abimethod() + def test_arg_conversion(self, app: Application) -> None: + txn = arc4.abi_call(Logger.log_string, "converted1", app_id=app, fee=0) + assert txn.last_log == b"converted1" + + txn = arc4.abi_call(Logger.log_uint64, 2, app_id=app, fee=0) + assert txn.last_log == op.itob(2) + + txn = arc4.abi_call(Logger.log_uint512, 3, app_id=app, fee=0) + assert txn.last_log == (op.bzero(56) + op.itob(3)) + + txn = arc4.abi_call(Logger.log_bytes, b"4", app_id=app, fee=0) + assert txn.last_log == b"4" + + txn = arc4.abi_call(Logger.log_bool, True, app_id=app, fee=0) + assert txn.last_log == b"True" + + @arc4.abimethod() + def test_15plus_args(self, app: Application) -> None: + result, txn = arc4.abi_call( + Logger.return_args_after_14th, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + arc4.Tuple((arc4.UInt8(0xDE), arc4.UInt8(0xAD), arc4.UInt8(0xBE), arc4.UInt8(0xEF))), + 20, + app_id=app, + fee=0, + ) + assert result.decode() == Bytes.from_hex("0F101112DEADBEEF14") + + @arc4.abimethod() + def test_void(self, app: Application) -> None: + txn = arc4.abi_call("log_string(string)void", "World1", app_id=app, fee=0) + assert txn.last_log == b"World1" + + txn = arc4.abi_call("log_string(string)", "World2", app_id=app, fee=0) + assert txn.last_log == b"World2" + + txn = arc4.abi_call("log_string", arc4.String("World3"), app_id=app, fee=0) + assert txn.last_log == b"World3" + + txn = arc4.abi_call(Logger.log_string, "World4", app_id=app, fee=0) + assert txn.last_log == b"World4" + + @arc4.abimethod() + def test_ref_types(self, app: Application, asset: Asset) -> None: + txn = arc4.abi_call( + Logger.log_asset_account_app, + asset, + Global.current_application_address, + app, + app_id=app, + fee=0, + ) + assert ( + txn.last_log + == asset.name + Global.current_application_address.bytes + app.address.bytes + ) diff --git a/test_cases/unary/puya.log b/test_cases/unary/puya.log index bf4a165fe3..8f0232576e 100644 --- a/test_cases/unary/puya.log +++ b/test_cases/unary/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['unary'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['unary'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/undefined_phi_args/puya.log b/test_cases/undefined_phi_args/puya.log index 7fbed53c1c..6bfb843841 100644 --- a/test_cases/undefined_phi_args/puya.log +++ b/test_cases/undefined_phi_args/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['undefined_phi_args'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['undefined_phi_args'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L19 diff --git a/test_cases/unssa/puya.log b/test_cases/unssa/puya.log index df55fa73d5..a441506c81 100644 --- a/test_cases/unssa/puya.log +++ b/test_cases/unssa/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['unssa'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['unssa'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) unssa/contract.py:6:9 warning: expression result is ignored unssa/contract.py:13:9 warning: expression result is ignored unssa/contract.py:15:9 warning: expression result is ignored diff --git a/test_cases/with_reentrancy/puya.log b/test_cases/with_reentrancy/puya.log index 560395d6cc..6a49ddc6ce 100644 --- a/test_cases/with_reentrancy/puya.log +++ b/test_cases/with_reentrancy/puya.log @@ -1,4 +1,4 @@ -debug: PuyaOptions(paths=['with_reentrancy'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) +debug: PuyaOptions(paths=['with_reentrancy'], output_teal=True, output_arc32=True, output_client=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) with_reentrancy/contract.py:9:9 warning: expression result is ignored debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 diff --git a/tests/test_arc32.py b/tests/test_arc32.py index b51d53a953..2df0bb81a2 100644 --- a/tests/test_arc32.py +++ b/tests/test_arc32.py @@ -752,3 +752,59 @@ def test_merkle(algod_client: AlgodClient, account: algokit_utils.Account) -> No assert app_client.call( call_abi_method="verify", leaf=sha_256_raw(b"a"), proof=test_tree.get_proof(b"a") ).return_value + + +def test_typed_abi_call( + algod_client: AlgodClient, account: algokit_utils.Account, asset_a: int +) -> None: + logger = algokit_utils.ApplicationClient( + algod_client, + algokit_utils.ApplicationSpecification.from_json( + compile_arc32(TEST_CASES_DIR / "typed_abi_call" / "logger.py") + ), + signer=account, + ) + logger.create() + + example = TEST_CASES_DIR / "typed_abi_call" / "typed_c2c.py" + app_spec = algokit_utils.ApplicationSpecification.from_json(compile_arc32(example)) + + # deploy greeter + app_client = algokit_utils.ApplicationClient(algod_client, app_spec, signer=account) + app_client.create() + + increased_fee = algod_client.suggested_params() + increased_fee.flat_fee = True + increased_fee.fee = constants.min_txn_fee * 6 + txn_params = algokit_utils.OnCompleteCallParameters(suggested_params=increased_fee) + + app_client.call( + "test_method_selector_kinds", + transaction_parameters=txn_params, + app=logger.app_id, + ) + + app_client.call( + "test_arg_conversion", + transaction_parameters=txn_params, + app=logger.app_id, + ) + + app_client.call( + "test_15plus_args", + transaction_parameters=txn_params, + app=logger.app_id, + ) + + app_client.call( + "test_void", + transaction_parameters=txn_params, + app=logger.app_id, + ) + + app_client.call( + "test_ref_types", + transaction_parameters=txn_params, + app=logger.app_id, + asset=asset_a, + ) diff --git a/tests/test_compile.py b/tests/test_compile.py index fec8bf5e1b..9294f1b522 100644 --- a/tests/test_compile.py +++ b/tests/test_compile.py @@ -125,6 +125,7 @@ def compile_with_level1_optimizations(test_case: PuyaExample) -> None: output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, + output_client=True, ), write_logs=True, suffix=SUFFIX_O1, diff --git a/tests/test_execution.py b/tests/test_execution.py index 263f207249..6a8b52df54 100644 --- a/tests/test_execution.py +++ b/tests/test_execution.py @@ -920,6 +920,10 @@ def test_abi_array(harness: _TestHarness) -> None: ) +def test_dynamic_bytes(harness: _TestHarness) -> None: + harness.deploy(TEST_CASES_DIR / "arc4_types" / "dynamic_bytes.py") + + def test_abi_bool(harness: _TestHarness) -> None: harness.deploy( TEST_CASES_DIR / "arc4_types" / "bool.py", diff --git a/tests/test_expected_output/itxn.test b/tests/test_expected_output/itxn.test new file mode 100644 index 0000000000..5dfff59ac2 --- /dev/null +++ b/tests/test_expected_output/itxn.test @@ -0,0 +1,115 @@ + +## case: test_cant_instantiate_inner_transaction + +from puyapy import Contract, itxn + + +class MyContract(Contract): + def approval_program(self) -> bool: + txn = itxn.InnerTransactionResult() ## E: puyapy.itxn.InnerTransactionResult cannot be instantiated directly, create a puyapy.itxn.InnerTransaction and submit instead + return True + + def clear_state_program(self) -> bool: + return True + + +## case: test_inner_txn_cant_be_aliased + +from puyapy import Contract, TransactionType, itxn, subroutine + + +class MyContract(Contract): + def approval_program(self) -> bool: + params = itxn.InnerTransaction(type=TransactionType.Payment) + txn = params.submit() + self.cant_pass_inner_txn(txn) ## E: puyapy.itxn.InnerTransactionResult cannot be passed to a subroutine + txn2 = self.cant_return_inner_txn() ## E: puyapy.itxn.InnerTransactionResult cannot be reassigned + if (txn3 := params.submit()).created_app: ## E: puyapy.itxn.InnerTransactionResult cannot be used in assignment expressions + pass + txn4 = txn ## E: puyapy.itxn.InnerTransactionResult cannot be reassigned + return True + + def clear_state_program(self) -> bool: + return True + + @subroutine + def cant_pass_inner_txn(self, txn: itxn.InnerTransactionResult) -> None: ## E: puyapy.itxn.InnerTransactionResult cannot be used as a subroutine argument type: txn + assert txn.type + + @subroutine ## E: puyapy.itxn.InnerTransactionResult cannot be used as a subroutine return type + def cant_return_inner_txn(self) -> itxn.InnerTransactionResult: + return itxn.InnerTransaction(type=TransactionType.Payment).submit() + + @subroutine + def must_unpack_tuple(self) -> None: + t1, t2 = itxn.submit_txns(itxn.InnerTransaction(type=TransactionType.Payment), itxn.InnerTransaction(type=TransactionType.Payment)) # this is ok + txn_tuple = itxn.submit_txns(itxn.InnerTransaction(type=TransactionType.Payment), itxn.InnerTransaction(type=TransactionType.Payment)) # this is not ## E: Inner Transactions cannot be part of an unpacked tuple: tuple[puyapy.itxn.InnerTransactionResult, puyapy.itxn.InnerTransactionResult] + + +## case: test_inner_txn_param_cant_be_aliased + +from puyapy import Contract, TransactionType, itxn, subroutine + + +class MyContract(Contract): + def approval_program(self) -> bool: + params = itxn.InnerTransaction(type=TransactionType.Payment) + self.cant_pass_inner_txn_params(params) ## E: puyapy.itxn.InnerTransaction cannot be passed to a subroutine + params2 = self.cant_return_inner_txn_params() ## E: puyapy.itxn.InnerTransaction cannot be aliased + if (params3 := itxn.InnerTransaction(type=TransactionType.Payment)).submit().created_app: ## E: puyapy.itxn.InnerTransaction cannot be used in assignment expressions + pass + params4 = params ## E: puyapy.itxn.InnerTransaction must be copied using .copy() when assigning to a new local: params + txn = (params5 := itxn.InnerTransaction(type=TransactionType.Payment)).submit() ## E: puyapy.itxn.InnerTransaction cannot be used in assignment expressions + return True + + def clear_state_program(self) -> bool: + return True + + @subroutine + def cant_pass_inner_txn_params(self, txn: itxn.InnerTransaction) -> None: ## E: puyapy.itxn.InnerTransaction cannot be used as a subroutine argument type: txn + pass + + @subroutine ## E: puyapy.itxn.InnerTransaction cannot be used as a subroutine return type + def cant_return_inner_txn_params(self) -> itxn.InnerTransaction: + return itxn.InnerTransaction(type=TransactionType.Payment) + + +## case: test_abi_call_errors + +from puyapy import arc4, subroutine + +class Client(arc4.ARC4Client): + + @arc4.abimethod + def foo(self, uint: arc4.UInt64) -> None: + raise NotImplementedError + + +@subroutine +def wrong_arg_type1() -> None: + arc4.abi_call(Client.foo, b"") ## E: Invalid puyapy.arc4.UInt64 value: b'' + +@subroutine +def wrong_arg_type2() -> None: + arc4.abi_call(Client.foo, "") ## E: Invalid puyapy.arc4.UInt64 value: + +@subroutine +def wrong_arg_type3() -> None: + arc4.abi_call("foo(uint64)void", b"") ## E: Invalid puyapy.arc4.UInt64 value: b'' + +@subroutine +def wrong_arg_type4() -> None: + arc4.abi_call("foo(uint8)void", 256) ## E: Invalid puyapy.arc4.UInt8 value: 256 + +@subroutine +def wrong_arg_type5() -> None: + arc4.abi_call("foo", 2 ** 64 + 1) ## E: Invalid puyapy.UInt64 value: 18446744073709551617 + +@subroutine +def method_selector_mismatch() -> None: + arc4.abi_call[arc4.UInt64]("foo(uint8)void", 1) ## E: Method selector from args 'foo(uint8)uint64' does not match provided method selector: 'foo(uint8)void' + +@subroutine +def allowed_coercions() -> None: + arc4.abi_call("foo", 256) # value inferred from args + arc4.abi_call(Client.foo, 1) \ No newline at end of file diff --git a/tests/test_expected_output/subroutine.test b/tests/test_expected_output/subroutine.test index ea98ddb09b..d6518c0b59 100644 --- a/tests/test_expected_output/subroutine.test +++ b/tests/test_expected_output/subroutine.test @@ -271,7 +271,7 @@ from puyapy import UInt64, subroutine @subroutine def test() -> None: - return UInt64(1) # type: ignore[return-value] ## E: invalid return type + return UInt64(1) # type: ignore[return-value] ## E: invalid return type of puyapy.UInt64, expected None ## case: typed_return_must_return_a_value @@ -298,7 +298,7 @@ from puyapy import Bytes, UInt64, subroutine @subroutine def test() -> UInt64: a = UInt64(1) - return Bytes(b"1") # type: ignore[return-value] ## E: invalid return type + return Bytes(b"1") # type: ignore[return-value] ## E: invalid return type of puyapy.Bytes, expected puyapy.UInt64 ## case: no_dunder_all_name diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py index 87287b6921..29025b9122 100644 --- a/tests/utils/__init__.py +++ b/tests/utils/__init__.py @@ -30,7 +30,6 @@ "Skipping stdlib stub ", "Discovered user module ", ), - "warning": ("Skipping stub: ",), } @@ -144,7 +143,10 @@ def _filter_logs(logs: list[Log], root_dir: Path, src_path: Path) -> list[Log]: for log in logs: # ignore logs that come from files outside of src_path as these are # logs emitted during the cached AWST parsing step - if log.relative_path and relative_src_root not in log.relative_path.parents: + if log.relative_path and relative_src_root not in ( + log.relative_path, + *log.relative_path.parents, + ): continue # ignore logs that are not output in a consistent order @@ -204,6 +206,7 @@ def compile_src( output_ssa_ir=optimization_level < 2, output_optimization_ir=optimization_level < 2, output_memory_ir=True, + output_client=True, out_dir=tmp_dir, ), )